Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Customer experience | Sales, Customer Insights,...
Unanswered

Not able to pass parameters to existing record using Xrm.navigation.openForm nor Xrm.Utility.openEntityForm

(0) ShareShare
ReportReport
Posted on by 15

Hello,

I have been trying to set a text field with a value for an existing record using Xrm.Utility.openEntityForm and Xrm.Navigation.openForm but the field is still not getting set.

This is my code, I am applying it to a system view and it works fine when I try to create a new record but it does not update any existing records as the parameters are not passed as the cmdbar is still visible.

I passed the selectedControlSelectedItemReferences CRM parameter from the ribbon workbench and I am using the recordID to navigate to the record I am trying to update.

Here is my code.

function setTextField(selectedItem){

parameters["mci_casereopeningreason"] = "ANY RANDOM DATA";

parameters["cmdbar"] = false;

Xrm.Utility.openEntityForm("incident", selectedItem[0].Id, parameters);

}


Thanks in advance.

  • Mohamed Elshaer Profile Picture
    15 on at
    RE: Not able to pass parameters to existing record using Xrm.navigation.openForm nor Xrm.Utility.openEntityForm

    After doing some debugging, I found that my successCallback function is getting called and my console.log(success); line actually prints in my console.

    But anyways, I do not update the record in my success function, I do it in the calling function call itself.

  • Community Member Profile Picture
    on at
    RE: Not able to pass parameters to existing record using Xrm.navigation.openForm nor Xrm.Utility.openEntityForm

    Hi,

    On MS documentation says:

    • The successCallback function is not executed when you open a form for an existing or new record.
    • The successCallback function is executed only when you save a record in a quick create form that was opened using the openForm method.

    Link: https://docs.microsoft.com/en-gb/powerapps/developer/model-driven-apps/clientapi/reference/xrm-navigation/openform

  • Mohamed Elshaer Profile Picture
    15 on at
    RE: Not able to pass parameters to existing record using Xrm.navigation.openForm nor Xrm.Utility.openEntityForm

    web client, and I am sure I the field on the form.

    My problem is that it sets the field when open new record form, yet fails to set it when opening existing record.

  • Mohamed Elshaer Profile Picture
    15 on at
    RE: Not able to pass parameters to existing record using Xrm.navigation.openForm nor Xrm.Utility.openEntityForm

    Yes. I did it using the following code, but still not setting the value of the field right.

    var entityFormOptions = {};

    entityFormOptions["openInNewWindow"] = false;

    entityFormOptions["entityName"] = "incident";

    entityFormOptions["entityId"] = selectedItem[0].Id;

    var parameters = {};

    parameters["mci_casereopeningreason"] = "ANY RANDOM DATA";

    Xrm.Navigation.openForm(entityFormOptions,parameters).then(

      function (success) {

          console.log(success);

      },

      function (error) {

          console.log(error);

      });

  • Kunal Sharma 2019 Profile Picture
    on at
    RE: Not able to pass parameters to existing record using Xrm.navigation.openForm nor Xrm.Utility.openEntityForm

    which client UCI or web Client ?  also make sure you have the field on the form

  • Kipetcoff Profile Picture
    1,037 on at
    RE: Not able to pass parameters to existing record using Xrm.navigation.openForm nor Xrm.Utility.openEntityForm

    Are you sure that you can use this method for existing record?

    https://docs.microsoft.com/en-us/dynamics365/customerengagement/on-premises/developer/set-field-values-using-parameters-passed-form

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Customer experience | Sales, Customer Insights, CRM

#1
Daivat Vartak (v-9davar) Profile Picture

Daivat Vartak (v-9d... 225 Super User 2025 Season 1

#2
Muhammad Shahzad Shafique Profile Picture

Muhammad Shahzad Sh... 106

#3
Vahid Ghafarpour Profile Picture

Vahid Ghafarpour 82 Super User 2025 Season 1

Overall leaderboard

Product updates

Dynamics 365 release plans