Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

How to - On clicking "Mark complete"button, custom field status change in crm 2016

Posted on by 100

Hi All,

Could you please help me in writing the java script on how to change the custom field value when clicked on the "Mark Complete" button on the Task entity?

Many Thanks,

Poornimaa AN

  • Suggested answer
    Ajay  Dhingra Profile Picture
    Ajay Dhingra on at
    RE: How to - On clicking "Mark complete"button, custom field status change in crm 2016

    Hi Instead of writing Javascript I reckon you may consider a Workflow or Plugin in this case. Is JavaScript is required ?

  • a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: How to - On clicking "Mark complete"button, custom field status change in crm 2016

    Hello,

    You can try following code:

    function onSaveHandler(executionContext){

    if (executionContext.getEventArgs().getSaveMode() !== 58) {

    return;

    }

    executionContext.getFormContext().getAttribute("yourcustomfield").setValue(your value);

    }

    You will have to use proper schema name of the field and proper value.

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!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans