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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics 365 | Integration, Dataverse...
Answered

error passing default parameters to a form in classic interface but not in unified interface

(0) ShareShare
ReportReport
Posted on by 20

I feel like I'm doing something fundamentally wrong here. 

var entityFormOptions = {};
entityFormOptions["entityName"] = "connection";

var formParameters = {};
formParameters["record1id"] = node.data.id;
formParameters["record1idname"] = node.text;

if (Xrm.Internal.isUci()) {
    formParameters["record1idtype"] = node.data.typename; 
} else {
    formParameters["record1idobjecttypecode"] = node.data.typename; 
}

Xrm.Navigation.openForm(entityFormOptions, formParameters);

The above code works, but:

1) It uses a method from the Internal workspace (Why does record1idtype not work in classic interface?)

2) I'm passing a string entity name to objecttypecode instead of an actual integer object type code (which fails if I do it)

All I'm trying to do is set a default record1 lookup value when I open a new connection form. But it either doesn't work in classic or unified interface, depending on what "type" property I'm setting.

Any help is appreciated.

I have the same question (0)
  • a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Hello,

    I don't see anything wrong in your approach. Different UI-s - different approaches. If you're looking for consistent code try to use createFrom parameter instead - no guarantees but it could work.

  • marcelxrm Profile Picture
    20 on at

    but this will get flagged when submitting to AppSource, won't it?

  • Suggested answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    It should not - technically your code doesn't do anything unsupported. In order to check that you can create solution and run App Checker against it.

  • marcelxrm Profile Picture
    20 on at

    Thanks, I'll try running solution checker against it. My only concern is that, per Microsoft docs, the use of Internal namespace functions is unsupported.

  • Verified answer
    a33ik Profile Picture
    84,331 Most Valuable Professional on at

    Oh. You mean usage of Xrm.Internal.isUci... that's the other question. Unfortunately Microsoft doesn't provide any other way to detect what type of interface is it...

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Microsoft Dynamics 365 | Integration, Dataverse, and general topics

#1
#ManoVerse Profile Picture

#ManoVerse 93

#1
Siv Sagar Profile Picture

Siv Sagar 93 Super User 2025 Season 2

#3
Martin Dráb Profile Picture

Martin Dráb 62 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans