Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

JavaScript for update of field value On Click of the Subgrid Button

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi all,

when i select one record from subgrid and click won button on the subgrid i have to update the value of the status field on the form to WON, below is the code with which i tried to achieve this task. 

its entering into inside if statement, can we the code inside if statement

WonButtonAsscoicate: function (recordId) {
debugger;
var oDataEndpointUrl = CEC.ProjectBid.GetOdataURL();
oDataEndpointUrl += "ccc_projectbidsSet?$filter=ccc_Status/Value eq 280000000 and ccc_projectbidsId eq guid'" + recordId + "'";
var requestResults = CEC.ProjectBid.ExecuteODATAQuery(oDataEndpointUrl);
if (requestResults != null && requestResults.results.length == 1) {

Xrm.Page.getAttribute("ccc_status").setValue(280000002);
Xrm.Page.data.save();

}
},

Thanks,

Tharun

*This post is locked for comments

  • Suggested answer
    Tim Dutcher Profile Picture
    Tim Dutcher 2,100 on at
    RE: JavaScript for update of field value On Click of the Subgrid Button

    If the ccc_status value is not being saved for the record, it could be that you need to use setSubmitMode and set it to "always".

    msdn.microsoft.com/.../gg334409.aspx

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans