Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Updating a field for existing open and closed opportunities in Dynamics crm

(0) ShareShare
ReportReport
Posted on by 310

Hello,

I created a new field on the Opportunity form named "Annual Total" on which I have set a javascript file which adds a bunch of fields.

I have set the JS file to execute on OnSave method of the form.

Is there a way I can update this field for all the existing opportunities (Open and Closed)?

Thank you.

*This post is locked for comments

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Updating a field for existing open and closed opportunities in Dynamics crm

    Hi Syed,

    This pop is not available for customization. If you are not familiar with JavaScript then it may be difficult for you to achieve it through HTMl web resource.

    You could refer the below thread on the same topic and ry to implement the workaround mentioned. If you face any issue, open a new thread to get answer specific to your issues.

    community.dynamics.com/.../189434

  • Syed_Faisal Profile Picture
    Syed_Faisal 815 on at
    RE: Updating a field for existing open and closed opportunities in Dynamics crm

    Hi Ravi,

    Thanks for the reply, Please the attached screen.

    On the Opportunity, When clicked on Close As Won, it brings up a small window. 

    Here need to extra add 2 Field as shown in images.

    Could you please direct me easy way.

    I can create HTML file and post on the web resources but i am not familiar with JavaScript code how to push update to the form.

    5852.close-opportunity.png

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Updating a field for existing open and closed opportunities in Dynamics crm

    Hi Syed,

    What's the issue you are facing?

  • Huzefa Bootwala Profile Picture
    Huzefa Bootwala 310 on at
    RE: Updating a field for existing open and closed opportunities in Dynamics crm

    Hello,

    Are you trying to customise close as won forms or updating some fields when the opportunity is closed?

    This thread is for updating fields when the opportunity is closed.

    Export the opportunities to Excel. Change the field value which needs to be updated. Import the records back in to CRM.

    The field would be updated with the values.

    Thank you.

  • Syed_Faisal Profile Picture
    Syed_Faisal 815 on at
    RE: Updating a field for existing open and closed opportunities in Dynamics crm

    Hi Huzefa,

    Could you please share the steps the one which you did.

    I am also trying to customize the close as won form but unable to do it.

  • Huzefa Bootwala Profile Picture
    Huzefa Bootwala 310 on at
    RE: Updating a field for existing open and closed opportunities in Dynamics crm

    Hello,

    Appreciate your reply.

    Updated the field by using Import/Export in Excel.

    Worked fine.

    Thank you.

  • Verified answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Updating a field for existing open and closed opportunities in Dynamics crm

    Hi Huzefa,

    The ondemand workflow runs on the records you have selected by click run workflow button on the entity home oage or entity form.  There tools 'Bulk Workflow Execution [XRM Toolbox' which you can use to run a specifc ondemand workflow on the results returned by a fetchxml.

    You may also need to check the state of the record and if it is closed then reopen, update and then close again. This is again something you need to check if this works for you cause re-opening and closing will trigger any plugins/ workflows you have in your system.

    I think you first need to write you custom workflow and verify if it is working fine. Ince done then you can rtun it on all the other records.

    You can refer the below sample to create the custom workflow activity.

    msdn.microsoft.com/.../gg334455.aspx

    Hope this helps.

  • Huzefa Bootwala Profile Picture
    Huzefa Bootwala 310 on at
    RE: Updating a field for existing open and closed opportunities in Dynamics crm

    Hello,

    Thank you for the reply.

    On demand workflow will update all existing records? Should it start when "Records are created"?

    I tried doing it, where should I write my logic.

    Logic contains addition and multiplication of some fields.

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: Updating a field for existing open and closed opportunities in Dynamics crm

    Hi Huzefa,

    As you have done the calculation on save using JavaScript, it would only work when you manually open the record and save it. To update existing record, you need to write a custom workflow with the same calculation logic and run it as ondemand on all the existing records.

    Hope this helps.

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…

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,516 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,407 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans