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

How to check if entity form is opened programmatically?

(0) ShareShare
ReportReport
Posted on by

Hi!

I use Xrm.Utility.openEntityForm to open a contact or a phone call in separate window.

Is there a way to check with js on newly opened window if it was opened with the function above?

*This post is locked for comments

I have the same question (0)
  • Verified answer
    shennu Profile Picture
    702 on at

    Without knowing exactly why you need to know if the form is opened by js or not... following is just a theory, I haven't tried any of it out...

    First of all openEntityForm is deprecated. You might want to use openForm instead. see docs.microsoft.com/.../openform

    Now I don't know if you could check if the window is opened up by your js function, however I guess you could do the following to indicate that the window was opend by js or not.

    Add a new field to the entity and maybe call it openedbyJS. Make it a yes / no field. Default it to No.

    use the formParameters parm to set the openedbyJS to yes.

    From there on you could then simply check the field value openedbyJS...

    Alternatively you could configure the formXml to accept custom querystring then work with the querystring... (see docs.microsoft.com/.../configure-form-accept-custom-querystring-parameters)

  • Verified answer
    Pawar Pravin  Profile Picture
    5,237 on at

    Hi,

    This is actually not possible directly, this is because current page and window page have a different context.

    You can achieve this one by using back-end attribute workaround.

    1. Create one field in main entity with name Isopen (two option)

    2. On close of window call js function to update that record as Yes

    "window.parent.opener.Xrm.Page.getAttribute("logicalnameofattribute").setValue(true);"

    Please do refer following url for reference:

    stackoverflow.com/.../open-popup-and-refresh-parent-page-on-close-popup

    community.dynamics.com/.../194914

  • Community Member Profile Picture
    on at

    This would work if i needed to add this feature for a specific entity or form. But i need to do this check regardless of the entity or form that is being opened

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

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans