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

Announcements

No record found.

News and Announcements icon
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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Congratulations to our 2025 Community Spotlights

Thanks to all of our 2025 Community Spotlight stars!

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

#1
Pallavi Phade Profile Picture

Pallavi Phade 102 Super User 2026 Season 1

#2
Abhilash Warrier Profile Picture

Abhilash Warrier 55 Super User 2026 Season 1

#3
ManoVerse Profile Picture

ManoVerse 53 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans