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)

Call Javascript function on parent form from lead dialog

(0) ShareShare
ReportReport
Posted on by 200

Hi,

How to call javascript function on lead parent form from lead qualify dialog box? We are unable to get the parent form object from lead qualify dialog screen.

 

 

 

*This post is locked for comments

I have the same question (0)
  • Vijay Waghmare Profile Picture
    on at

    Refer below URL for accessing parent functionality through dialog box (unsupported, since customizing native CRM dialog box is not supported by MS CRM),

    blogs.infinite-x.net/.../crm-2011-accessing-the-parent-form-from-a-child-form

    bingsoft.wordpress.com/.../accessing-the-parent-form-xrm-page-in-crm-2011

    If you just want to populate information from parent i.e. lead entity while qualifying lead

    You can have a create plugin register it on Step QualifyLead on Lead Entity in Pre-Operation record and then update the context parameters as per requirement

    Thanks,

    Vijay

  • Vinayak chavan Profile Picture
    200 on at

    Hi Vijay, thanks for the prompt response.

    We tried using above reference links to get the parent form object.  'window.top.opener.parent.Xrm.Page' is getting null for parent.

    We wont to call javascript function available on web resource of lead form when lead will disqualified from lead qualify dialog screen. Lead disqualify screen will set a value on main lead form.

    Any more inputs?

  • Suggested answer
    Vijay Waghmare Profile Picture
    on at

    Whenever you disqualify the lead it save the Lead form, so you can have  JS registered on save event to check if user initiated action to disqualify lead

    Refer below URL for Save mode, in your case you need to check for savemode() equal to 15 on save event of lead

    msdn.microsoft.com/.../gg509060.aspx

    if your condition matches, then you can perform your desired operation.

    Thanks,

    Vijay

  • Vinayak chavan Profile Picture
    200 on at

    Hi Vijay,

    Let me explain you the flow.

    1) User will click on qualify screen.

    2) For disqualification he will select reason as 'Others'.

    3) On selection of Others, javascript function will prompt for user input (using input box).

    4) We have to set this user input on lead main form as rejection reason.

    So issue is to set the javascript variable value on lead main form. We are not getting parent form object using window.top.opener.parent.Xrm and other options too.

  • Vinayak chavan Profile Picture
    200 on at

    Hi Vijay,

    Thanks for the response. I can have javascript function on disqualify lead event using savemode=15.

    Any idea, how can I get the status reason selected on Qualify Lead aspx? If I try to get the status code using xrm.page context then I get the old status code i.e. 'New' and it is expected one as new value is not yet saved.

    I need status code or discqualification reason selected on qualify lead aspx page on main lead form javascript.

  • Vijay Waghmare Profile Picture
    on at

    As CRM standard functionality you cannot get control over the “Disqualify Lead” dialog box and customizing it will be treated as unsupported.

    I’ll suggest you to have a pre-operation plugin registered on Lead save event, where you can check the status and update field accordingly. Doing this on form load (once save performed) you will get required value on respective field (write your logic in plugin to fetch and set value in target).

    Hope this help.

    Thanks,

    Vijay

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