Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Xrm.Utility.openEntityForm not working for Customer data type for custom entities

(0) ShareShare
ReportReport
Posted on by 275

Hello,

I am trying to set the foreign key of type Customer using following way.

parameters["new_customer"] = "D6EDEADA-EED4-E711-A949-000D3A308373";
parameters["new_customertype"] = "account";
parameters["new_customername"] = "test";

Xrm.Utility.openEntityForm("new_test", null, parameters, null);

While the same code works fine for System entities, it throws following error for Custom entities.

"System.InvalidOperationException: CRM Parameter Filter - Invalid parameter 'new_customertype=account'"

Did anyone else faced the same?

*This post is locked for comments

  • Suggested answer
    shivaram Profile Picture
    shivaram 3,315 on at
    RE: Xrm.Utility.openEntityForm not working for Customer data type for custom entities

    Hi,

    I am not sure about exact issue.. Recently I worked on this.. I wrote syntax like following.. You can try it..

    function OpenEvent() {
       if (Xrm.Page.data.entity.getIsDirty()) {
           alert("One or more fields are modified. Please save the form.");
           return;
       }
       var thisEvent = {
           entityType: "Entity Logical Name"
       };
       var windowOptions = {
           openInNewWindow: true
       };
       var parameters = {};
       //your parameters
       Xrm.Utility.openEntityForm(thisEvent.entityType, null, parameters, windowOptions);
    }

    Hope it helps you.

    Best regards,

    Shivaram.

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…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans