Last active
April 24, 2018 16:47
-
-
Save DynCon365/bcdcaba61bd6051116eed7bcb7a4c11f to your computer and use it in GitHub Desktop.
Dynamics 365/CRM | Set the value of an Option Set
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Set the value of the Opportunity Status Reason field | |
// Note: Option Set fields are set based on the database id, rather than the name | |
Xrm.Page.data.entity.attributes.get("statuscode").setValue(100000001); | |
// Set the value of the Opportunity Status Reason field to a variable | |
var statusReasonId = 100000001; | |
Xrm.Page.data.entity.attributes.get("statuscode").setValue(statusReasonId); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment