web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Service | Customer Service, Contact Center, Fie...
Suggested Answer

"addCustomView" function is not working on Party lookups

(0) ShareShare
ReportReport
Posted on by 5

Hello,
Currently we are on MS Dynamics 365 8.2 version On Premise
I have existing code on Appointment form, I am setting custom default view for one of the party lookup "Required Attendeeds"
using javascript function "addCustomView".
It was previously working fine but now I observed that this function "addCustomView" do not work for Party lookup though this works on normal lookup.
Please let me know if any one faced this issue.

I have the same question (0)
  • Suggested answer
    sdfasdf Profile Picture
    842 on at

    Hi,

    I just tested with the following sample code and it worked in UCI, just like is does with the legacy Web client:

    function appointmentOnLoad(context) {

        debugger;
        var form = context.getFormContext();
        var requiredAttendeesControl = form.getControl("requiredattendees");

        var viewId = "00000000-0000-0000-0000-000000000001";
        var entityName = "account";
        var viewDisplayName = "Accounts whose name begin with A";
        var fetchXml = [
            "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>",
                "<entity name='account'>",
                    "<attribute name='name' />",
                    "<attribute name='telephone1' />",
                    "<attribute name='accountid' />",
                    "<filter type='and'>",
                        "<condition attribute='name' operator='like' value='A%' />",
                    "</filter>",
                "</entity>",
            "</fetch>"
        ].join();

        var layoutXml = [
            "<grid name='resultset' object='1' jump='name' select='1' icon='1' preview='2'>",
                "<row name='result' id='accountid'>",
                    "<cell name='name' width='200' />",
                    "<cell name='telephone1' width='150' />",
                    "<cell name='createdon' width='150' />",
                "</row>",
            "</grid>"
        ].join();
        
        var isDefault = true;

        requiredAttendeesControl.addCustomView(viewIdentityNameviewDisplayNamefetchXmllayoutXmlisDefault);
    }

    Hope it helps.

  • KHL Profile Picture
    5 on at

    Thanks for reply.

    Ours is OnPremise and I am calling this same function from onload of Appointment form, but it is not working.

  • KHL Profile Picture
    5 on at

    Any one face this issue?? Please reply.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Service | Customer Service, Contact Center, Field Service, Guides

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 73 Super User 2025 Season 2

#2
Siv Sagar Profile Picture

Siv Sagar 52 Super User 2025 Season 2

#3
Daniyal Khaleel Profile Picture

Daniyal Khaleel 42 Most Valuable Professional

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans