Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Run Script at OnLoad Event when user tap on Create Invoice In Dynamics CRM

(0) ShareShare
ReportReport
Posted on by 3,614

I need to run a script at onLoad event of Invoice whenever user tap on button on Order ribbon CREATE INVOICE. I tried it but nothing go in my way. is there any idea or suggestion to make this working.

*This post is locked for comments

  • Verified answer
    Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: Run Script at OnLoad Event when user tap on Create Invoice In Dynamics CRM

    you can use a workflow to achieve it

    1. Create a Workflow under Invoice.

    2. Set it to Real Time Workflow ( CRM 2013 and above)

    3. Set it trigger when Record is Created

    if your sales person is a custom field , use update step

    if your sales person = Invoice record owner , use assign

    0488.4.PNG                 

    Update    

    first select the sales person field, then follow the below setting                                                                                                                                                

                   0488.4.PNG                                                   

    Assign

    Set to Assign = Invoice, Click on Set Properties, follow the below setting.

          7827.2.PNG

    Activate your Workflow.

  • Mohsin Ali Profile Picture
    Mohsin Ali 3,614 on at
    RE: Run Script at OnLoad Event when user tap on Create Invoice In Dynamics CRM

    no I want to run it on Invoice form and also no it is not a custom button it is in built button. Also, I want to set the Order owner as sales person on Invoice form.

  • Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: Run Script at OnLoad Event when user tap on Create Invoice In Dynamics CRM

    the script should run in "Order" Entity?

    is it a custom button or?

    would be better if you can explain your script, so we can figure an alternative way for you.

  • Mohsin Ali Profile Picture
    Mohsin Ali 3,614 on at
    RE: Run Script at OnLoad Event when user tap on Create Invoice In Dynamics CRM

    no, actually tapping on the button will create new invoice and load in the same window. So, I need to run the script as soon as the invoice is created.

  • Suggested answer
    Alex Fun Wei Jie Profile Picture
    Alex Fun Wei Jie 33,626 on at
    RE: Run Script at OnLoad Event when user tap on Create Invoice In Dynamics CRM

    i believed what you need is a on click event right?

    if yes, Please follow the below article

    mahenderpal.wordpress.com/.../calling-java-script-on-click-of-command-button-ms-crm-2015-step-by-step

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

Announcing Our 2025 Season 1 Super Users!

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

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 231,287 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans