Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Upload Javascipt file in CRM Opportunity Form

(0) ShareShare
ReportReport
Posted on by

Hi.

How can I upload a JS file that points to that part of the form?

I want to make a contact filter according to the account, but I don't know where to put the javascript file to interact5584.JPG.

4-_2D00_-copia.JPG

*This post is locked for comments

  • Poornimaa Profile Picture
    Poornimaa 102 on at
    RE: Upload Javascipt file in CRM Opportunity Form

    Thanks, Pavan for your answer. I resolved my query. !!

    Cheers,

    Poornimaa

  • RE: Upload Javascipt file in CRM Opportunity Form

    Hi Poornima,

    In that case you need to do following steps

    1. Write a javascript and call it on save of the form. (https://community.dynamics.com/365/b/goutamdas/posts/how-to-prevent-moving-bpf-next-stage-or-set-current-stage-active-based-on-sub-grid-record-count-or-any-type-condition-in-dynamics-365) use formcontext instead of Xrm.Page

    2. In the javascript make sure to prefix attribute name :header_process_<attributename> (that's how you read fields from BPF in Javascript)

    3. On save (when ever BPF stage changes it saves the record) Retrieve the current stage and if the field doesn't have required value then prevent moving to next stage.

    Note: In case my answer helped you. Kindly mark it as verified.

    Warm Regards,

    Pavan Kumar Garlapati

    Follow my Blog: https://pavankumargarlapati.wordpress.com

  • Poornimaa Profile Picture
    Poornimaa 102 on at
    RE: Upload Javascipt file in CRM Opportunity Form

    Hello,

    I have a business process flow that has almost 5 stages. My Business process flow should not move to another until it satisfies some condition in that stage.

    (Eg. 1st stage name -> Verify Contact.In this 1st stage, I have a header field called “Trainee Validation Section”.

    It is the option set containing more than 5 values.

    When the “Trainee Validation Section “is “waiting with Employer for more information or canceled or something”, BPF should not move to the

    next stage.

    When this field holds the value of “Approved”, then the BPF should move to the next stage.

    Likewise, I have the same kind of condition in all 5 stages. I tried doing this with workflow when the stage ID changes, check on the field. But my workflow is working fine only for the first stage, and when I click on the next stage before hitting the 2nd stage, it is throwing the error.

    Can you please help me how can I do this with my javascript? I have questioned the same on the forum but haven’t got any information.

    Link to the forum:

    community.dynamics.com/.../preventing-bpf-to-move-to-next-stage-without-satisfying-the-condition-on-the-first-stage

  • Suggested answer
    gdas Profile Picture
    gdas 50,089 Moderator on at
    RE: Upload Javascipt file in CRM Opportunity Form

    Hi,

    You can not attach JS directly in the  BPF Llike form editor.However you can keep the same control inside form and make it visible off and attach JS  over there.

    You can also attach  function in the  form onload event and access BPF control using "header_process_fieldname".

    See here  sample code -

    community.dynamics.com/.../how-to-show-related-contact-records-from-account

    Use formcontext instead of Xrm.page.

    Another option which is no code approach , set the related in the lookup properties in the form fields , BPF field will be apply automatically.

    www.powerobjects.com/.../

    m.youtube.com/watch

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,436 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans