Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Send Form Id id in Create Record command

(0) ShareShare
ReportReport
Posted on by

Hi Experts,

I want to create record of a custom entity in JavaScript which I am able to do but I also want to send Form Id into it. 

How can I do that?

e.g. For entity X, I have two forms "Main1" and "Main2" 

Scenario:

if(condition){

Create record of entity X with form "Main1"

}

else{

Create record of entity X with form "Main2"

}

Code:

I am using code something like this

var objectValues= new Object();

 SDK.REST.createRecord(objectValues, "<EntityName>", callBackFuction, function (error) { alert(error.message); });

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    on at
    RE: Send Form Id id in Create Record command

    Thanks all for the suggestions. I solved it doing following.

    I created new field on the form.

    While creating entity record, I set that variable to some unique value.

    I created 2 different forms

    On form load I added js code to check variable data

    and according to the data I change form navigation

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: Send Form Id id in Create Record command

    Hi ,

    There is no parameter to pass form id in createRecord method , this is only for Opening any record like OpenEntityForm . Is there any specific reason you are  passing form id in create record ?

    If you still want to pass form id you can create a text field in the entity fill it the "objectValues" parameter , you can hard code the form id without any issue.

  • Suggested answer
    Pawar Pravin  Profile Picture
    5,237 on at
    RE: Send Form Id id in Create Record command

    Hi ,

    Actually while creating record in CRM it never affect with form because form is not part of attributes. In other way if you want to open that record into two different form then you need to create one flag/option set with respective form name.

    While opening that record you can check flag to open form.

  • Suggested answer
    Dynamics365 Rocker Profile Picture
    7,755 on at
    RE: Send Form Id id in Create Record command

    You have to get name of form not id. Below link may help you:

    community.dynamics.com/.../crm2013-getting-current-form-name-via-javascript

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 > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
dkrishna Profile Picture

dkrishna 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans