Customer Engagement & Dynamics CRM Forum

 View Only

Looking for advice on adding a custom entity to the Required Attendee field on Appointments

  • 1.  Looking for advice on adding a custom entity to the Required Attendee field on Appointments

    GOLD CONTRIBUTOR
    Posted Aug 31, 2022 04:22 PM
    I would like to confirm if it's possible to add a custom entity to the list of entity record types on the Required Attendee field for Appointments.  It's currently listing only Contacts, Accounts and Users.  I've tried a number of JavaScript methods but it's not working.  

    Here's what my function looks like but if I include the custom entity "new_fruit" to the array, I get an error message that reads, "Invalid value new_fruit for entityType",  Otherwise, without it, the record types do filter to just Contacts and Accounts.

    function SetPartyListEntity(executionContext) {

        if (executionContext !== undefined) {

            formContext = executionContext.getFormContext();

            console.log('~~ SetPartyListEntity ~~ formContext ~~');

            console.log(formContext);

            var field = formContext.getControl('requiredattendees');

            console.log('~~ SetPartyListEntity ~~ field ~~');

            console.log(field);

            var filter = "<filter type='and'><condition attribute='statecode' operator='eq' value='0' /></filter>";

            field.addCustomFilter(filter, "new_fruit");

            field.setEntityTypes(['contact','account']);

            console.log('~~ SetPartyListEntity ~~ field.getEntityTypes ~~');

            console.log(field.getEntityTypes());

        } else {

            console.log('*** FATAL ERROR *** Missing executionContext');

        }

    }

    Thank you,

    Bob

    ------------------------------
    Bob Chang
    CRM Application Developer
    Cystic Fibrosis Foundation
    Bethesda MD
    ------------------------------


If you've found this thread useful, dive deeper into User Group community content by role