Show selective entities in Activity Party List in D365 Activities - CloudFronts

Show selective entities in Activity Party List in D365 Activities

Out-of-the-box, D365 Activity Party List field, say, Appointment’s Required/Optional Attendees fields lets you choose among multiple Activity Party enabled entities when you want to select records. And perhaps you don’t even want users to select what’s not relevant.

default

Let’s look at how we can show only the required entities in the selection list.

Before that, if you want to check how you can enable custom entities for the Activity Party, you can refer this post of mine – Enable entity for Party List selection in Appointment

Hide entities from the Activity Party List field

This can be achieved by writing a simple JS code and calling it onLoad of the Appointment form where the Party List field exists.

  1. Let’s say you only want to show the entities Lead and Contact in the Required Attendees Party List field
  2. Here’s the JS code that goes on the onLoad function of the Appointment form
    // JavaScript source code
    oAppointmentFormCustomization =
    {
    filterRequiredAttendees: function () {
    Xrm.Page.getAttribute("requiredattendees").setLookupTypes(["lead","contact"]);
    }
    };

     

  3. And call the method filterRequiredAttendees onLoad as below
    onLoad
  4. The Appointment’s Required Attendees field will show only the entities you provided in the setLookupTypes([“lead”,”contact”]);
    filtered

Hope this helps!


Share Story :

SEARCH BLOGS :

FOLLOW CLOUDFRONTS BLOG :


Secured By miniOrange