Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Dynamics 365 general forum

Regarding field does not populate in UCI using Xrm.Navigation.openForm client API

(0) ShareShare
ReportReport
Posted on by 140

Hi,

I am trying to open an Activity entity form for new record with auto populating the regarding field by using Xrm.Navigation.openForm client API in D365 UCI. However, it is not setting the value for the regarding field in UCI. Could you please let us know the reason why it is not showing the value or provide a way to set the regarding field value using this client API.

Thanks in advance!

Categories:
  • Vikas Negi Profile Picture
    Vikas Negi 140 on at
    RE: Regarding field does not populate in UCI using Xrm.Navigation.openForm client API

    Thank you T.I.A

    I am able to set the party list field by using above code. However, I want to set the party list field for different activities. I can not set the hard code value for particular activity. Is there any way I can set the party list field for any activity.

    Thanks!

  • Suggested answer
    T.I.A Profile Picture
    T.I.A 1,760 on at
    RE: Regarding field does not populate in UCI using Xrm.Navigation.openForm client API

    Hi VIkas,

    Could you try this


    var value = new Array();
    value[0] = new Object();
    value[0].id = "34cf15jk-445a-e843-80bb-a5334caf8811";
    value[0].name = "richard smith";
    value[0].entityType = "contact";

    parameters["what ever the field name is"] = value;

  • Vikas Negi Profile Picture
    Vikas Negi 140 on at
    RE: Regarding field does not populate in UCI using Xrm.Navigation.openForm client API

    Thank you T.I.A

    var parameters = [];

           parameters["regardingobjectid"] = "2312bf7b-c57b-e911-a99a-00224800c5e8";

           parameters["regardingobjectidname"] = "IGN Consortium";

           parameters["regardingobjectidtype"] = 1;   //object type code

    By using above code I am able to set the regarding field value. However, the value for party list field is not set. I have mentioned the code for partylist field as well above. Could you please help me to the party list field?

    Thanks!

  • Suggested answer
    Antonio Lamanna Profile Picture
    Antonio Lamanna 165 on at
    RE: Regarding field does not populate in UCI using Xrm.Navigation.openForm client API

    Hi, try this

    var entityFormOptions = {};
    entityFormOptions["entityName"] = "contact";
    
    // Set default values for the Contact form
    var formParameters = {};
    formParameters["firstname"] = "Sample";
    formParameters["lastname"] = "Contact";
    formParameters["fullname"] = "Sample Contact";
    formParameters["emailaddress1"] = "contact@adventure-works.com";
    formParameters["jobtitle"] = "Sr. Marketing Manager";
    formParameters["donotemail"] = "1";
    formParameters["description"] = "Default values for this record were set programmatically.";
    
    // Open the form.
    Xrm.Navigation.openForm(entityFormOptions, formParameters).then(
        function (success) {
            console.log(success);
        },
        function (error) {
            console.log(error);
        });

    Source: https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/reference/xrm-navigation/openform
    If it helps you please mark as verified!

  • Suggested answer
    T.I.A Profile Picture
    T.I.A 1,760 on at
    RE: Regarding field does not populate in UCI using Xrm.Navigation.openForm client API

    var parameters = [];

           parameters["regardingobjectid"] = "2312bf7b-c57b-e911-a99a-00224800c5e8";

           parameters["regardingobjectidname"] = "IGN Consortium";

           parameters["regardingobjectidtype"] = 1;   //object type code

    This works fine for me. Let me know how you get on

  • Vikas Negi Profile Picture
    Vikas Negi 140 on at
    RE: Regarding field does not populate in UCI using Xrm.Navigation.openForm client API

    Below is the code I am using:

    //Set the reqarding field value
    parameters["pId"] = "2878282E-94D6-E111-9B1D-00155D9D700B";  
    parameters["pName"] = "Contoso";
    parameters["pType"] = 1;   //object type code

    //set required attendees

    parameters["partyid"] = "2878282E-94D6-E111-9B1D-00155D9D700B";

    parameters["partyname"] = "Contoso";

    parameters["partytype"] = 1; //object type code

    //open new record

    entityFormOption.entityName = "appointment";
    entityFormOption.entityId = null;
    entityFormOption.openInNewWindow = true;
    //open the entity record
    Xrm.Navigation.openForm(entityFormOption, parameters, successCallback, errorCallback);

    Thanks!

  • T.I.A Profile Picture
    T.I.A 1,760 on at
    RE: Regarding field does not populate in UCI using Xrm.Navigation.openForm client API

    can we see your code?

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

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,321 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans