Show specific entities in Activity Party List Lookup in D365 Activity entity

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!

Advertisements

Enable entity for Party List selection in Appointment

Out-of-the-box, you have fixed set of entities enabled for Party List fields in Appointment entity. Of which, you can select to be either in Required or Optional fields on Appointments.

But, what if you want to enable a custom entity for the same? You can do that was well.

Enable Entity for Sending Email

  1. In your custom entity, you can turn on Sending Email option on the entity level and the entity will be enabled for Party List.sendingemails
  2. And Publish your customization.
    Now, when you select the Required/Optional field in Appointment, Look for More Records
    lookForMoreRecords.png
  3. Select the Look For option to expose available entities
    expandlookfor
  4. And look for the custom entity you created i.e. Office Representatives my this case.
    selectentity
  5. And select the record you want
    jamieg
  6. And the custom entity record will be added to the Party List field
    addedtolist

The reason your see them enabled is because Email Address (emailaddress) field has been created for the entity i.e. the entity is now Email enabled.

Hope this helps!