Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

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

Posted on by 3,610

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,610 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,610 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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,253 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans