Skip to main content

Notifications

Microsoft Dynamics 365 | Integration, Dataverse...
Answered

Issue in unified interface (Model driven App) unable to set parameters on new form

(1) ShareShare
ReportReport
Posted on by 35

this code is working in web client but not in unified interface, how can fix it in model driven app (Unified interface) ?

var formParameters = {};
formParameters['partyid'] = partid;
formParameters['partyname'] = partname;
formParameters['partytype'] = pratytypeCode;

var entityFormOptions = {};
entityFormOptions.entityName = "phonecall";
entityFormOptions.openInNewWindow = true;


parent.Xrm.Navigation.openForm(entityFormOptions, formParameters).then(
function (success) {

},
function (error) {
console.log(error);
});

  • Nadeem Hassan Profile Picture
    Nadeem Hassan 35 on at
    RE: Issue in unified interface (Model driven App) unable to set parameters on new form

    Hello Johao Larios ,

    Can you please mention link here where it is answered.?

  • Nadeem Hassan Profile Picture
    Nadeem Hassan 35 on at
    RE: Issue in unified interface (Model driven App) unable to set parameters on new form

    Thanks Andrew Butenko,

    Your post is very helpful.

    regards

    Nadeem Hassan

  • Verified answer
    a33ik Profile Picture
    a33ik 84,325 Most Valuable Professional on at
    RE: Issue in unified interface (Model driven App) unable to set parameters on new form

    Here is my post - butenko.pro/.../

  • Suggested answer
    miguelbeja Profile Picture
    miguelbeja on at
    RE: Issue in unified interface (Model driven App) unable to set parameters on new form

    Hello Nadeem

    You can try to use this code, it will work.

    It is needed to query for the fullname since it isn't in the form.

    function test()
    {
    var fullname = "";
    var req = new XMLHttpRequest();
    req.open("GET", Xrm.Page.context.getClientUrl()   "/api/data/v9.1/contacts(" Xrm.Page.data.entity.getId().replace("{", "").replace("}","") ")?$select=fullname", false);
    req.setRequestHeader("OData-MaxVersion", "4.0");
    req.setRequestHeader("OData-Version", "4.0");
    req.setRequestHeader("Accept", "application/json");
    req.setRequestHeader("Content-Type", "application/json; charset=utf-8");
    req.setRequestHeader("Prefer", "odata.include-annotations=\"*\"");
    req.onreadystatechange = function() {
    if (this.readyState === 4) {
    req.onreadystatechange = null;
    if (this.status === 200) {
    var result = JSON.parse(this.response);
    fullname = result["fullname"];
    } else {
    Xrm.Utility.alertDialog(this.statusText);
    }
    }
    };
    req.send();
    
    var partyid = Xrm.Page.data.entity.getId();
    var partyname = fullname;
    var partytypecode = "2";
    var formParameters = {};
    
    var value = new Array();
    value[0] = new Object();
    value[0].id = partyid;
    value[0].name = partyname;
    value[0].entityType = "contact";
    
    formParameters["to"] = value;
    
    var entityFormOptions = {};
    entityFormOptions["entityName"] = "phonecall";
    entityFormOptions["openInNewWindow"] = true;
    
    Xrm.Navigation.openForm(entityFormOptions, formParameters).then(
    function (success) {
    
    },
    function (error) {
    console.log(error);
    });
    }

  • a33ik Profile Picture
    a33ik 84,325 Most Valuable Professional on at
    RE: Issue in unified interface (Model driven App) unable to set parameters on new form

    Nadeem,

    I found an answer and it will be posted on my blog today/tomorrow. Subscribe to it or to my twitter to see the notification about new posts.

  • Suggested answer
    Johao Larios Profile Picture
    Johao Larios 1,795 on at
    RE: Issue in unified interface (Model driven App) unable to set parameters on new form

    Hello Nadeem,

    This was answered in another forum, please verify.

    Regards.

  • Suggested answer
    Johao Larios Profile Picture
    Johao Larios 1,795 on at
    RE: Issue in unified interface (Model driven App) unable to set parameters on new form

    Hello Nadeem,

    If you are not getting errors, please create a ticket with MSFT. I don't get why you are using the word "parent". Before opening the ticket I would suggest you please try as is mentioned on this link:

    docs.microsoft.com/.../openform

    Xrm.Navigation.openForm(entityFormOptions,formParameters).then(successCallback,errorCallback);

    I have use it on UCI without issues. But if you use this and you are still getting problems, please create a ticket.

  • a33ik Profile Picture
    a33ik 84,325 Most Valuable Professional on at
    RE: Issue in unified interface (Model driven App) unable to set parameters on new form

    Nadeem,

    Please, don't create duplicated threads.

  • Nadeem Hassan Profile Picture
    Nadeem Hassan 35 on at
    RE: Issue in unified interface (Model driven App) unable to set parameters on new form

    Thanks Henry Jammes,

    Yes there in no any error in console.

    thanks for support link.

  • Suggested answer
    Henry J. Profile Picture
    Henry J. 5,237 on at
    RE: Issue in unified interface (Model driven App) unable to set parameters on new form

    Thanks Nadeem.

    Even in the console (F12)?

    If you can't share more details, I suggest you open a Support Request here to have someone help you troubleshoot this: https://admin.powerplatform.microsoft.com/support

    Henry

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Congratulations to the January Top 10 leaders!

Check out the January community rock stars...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,962 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans