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

Is there a way to know from which form/entityrecord a new record is created

(0) ShareShare
ReportReport
Posted on by 645

I need to prevent a creation of a new record by the + add one button (near a grid-view), I want to know if there is an option to find out from where record/entity  the form (from + button)  is opened, I thought maybe I can use the pagetype=entityrecord#267084237 which is shown in the url, but I'm not sure how.
basically what I'm planning to do is to check on onload-event (js) from which page/entity/record the new form is opened and if it comes from the wrong entity the form will be closed.
Would like to get some guidance on this topic 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi Sahara,

    There isn't really any supported method to know from which page/entity/record the record is opened. However when you click on the '+' button, it copies the values from you main entity to your child entity i.e. if you try to create an opportunity from Account, the lookup parentaccount would be populated with that record and same for contact. So you can write a script on load which check if the form type is create and if the lookup field contains data.

    Hope this helps.

  • Suggested answer
    Dynamics365 Rocker Profile Picture
    7,755 on at

    This is not possible in supported way.

    Even you can do your scripting to prevent creating new record if it comes from + button of subgrid.

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi ,

    Which button you are talking about is it subgrid button? or Create New button in from anywhere of any entity?

    If you are talking about subgrid +  button you can control by using enable rule of ribbon workbench , you can add your custom logic in the enable rule . Similar thing can be apply for entity home grid as well.

    In addition you can control the new button using security role .

    Apart from above you need to go for unsupported code like using URL concatenation you could get the internal redirect url  in the form onload using below line of code .

    var internalurl = window.location.href;

    So you can try with this .

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi Sahara,

    Check this thread which has something similar. You could have similar implementation. Basically you can get the fields of the entity the record is opened so once you get teh details, you can check what you want to do with the fields.

    community.dynamics.com/.../847923

    Hope this helps.

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!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ScottDurow Profile Picture

ScottDurow 2

#2
GJones Profile Picture

GJones 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans