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

Announcements

No record found.

News and Announcements icon
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.

  • 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(viewId, entityName, viewDisplayName, fetchXml, layoutXml, isDefault);
    }

    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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

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

#1
11manish Profile Picture

11manish 48 Super User 2026 Season 2

#2
Travis South Profile Picture

Travis South 45

#3
Ayesha Wajahat Profile Picture

Ayesha Wajahat 18

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans