This blog post will provide instructions on retrieving or removing the metadata of an Option Set or Multi-Select Option Set using the Web API.
1.1 Get Option Set/Multi-Select Option Set metadata from Web API
In MSCRM, the String Map table can be utilized to retrieve details regarding option sets. This table is primarily utilized to store information related to option set fields that exist within the organization. It contains all pertinent data regarding the option set, such as the attribute name, option set name, option value, option name, and object type code.
Consider the following example where we will retrieve the metadata of the ‘industrycode‘ attribute from the ‘account‘ table.
Get Request :
https://younggod.api.crm.dynamics.com/api/data/v9.1/stringmaps?$select=value,attributevalue,displayorder&$filter=objecttypecode eq 'account' and attributename eq 'industrycode'&$orderby=displayorder asc&$count=true
1.2 Remove OptionSet Name from Option Set/Multi-Select Option Set metadata using Web API
Here, we will remove the option name ‘Accounting‘ from the ‘industrycode‘ attribute on the ‘account‘ table.
Get Request :
https://younggod.api.crm.dynamics.com/api/data/v9.1/stringmaps?$select=value,attributevalue,displayorder&$filter=objecttypecode eq 'account' and attributename eq 'industrycode' and attributevalue ne 1&$orderby=displayorder asc&$count=true
Happy D365ing.
Related blog links of Web API:
Set up a Postman Environment and Application User for Dynamics 365 CE – Nebulaa IT Solutions,
Filter in expand query of OData (D365 CE) – Nebulaa IT Solutions,
Batch Request to Create, Update and Delete records in Dynamics 365 CE – Nebulaa IT Solutions,
Create Notes with Attachment using Web API in Dynamics 365 – Nebulaa IT Solutions,
Create Parent – Child Record in Single D365 Web API Request – Nebulaa IT Solutions,
Use postman to Create record in Dynamics with the Web API – Nebulaa IT Solutions
The post Retrieving and Removing Option Set/Multi-Select Option Set Values in D365 CE with Web API appeared first on Nebulaa IT Solutions.
*This post is locked for comments