Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 46379

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

$
0
0

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


Viewing all articles
Browse latest Browse all 46379

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>