Setting Lookup and Option Set Fields in USD Forms Using New_CRM_Page

Leave a comment

In Unified Service Desk, we can create a new entity using the New_CRM_Page action call. When we run this command, we can default fields on the new record. Setting these fields is pretty simple. Let’s look at how to set lookups and option sets fields.

Let’s say we want to create an Account record and set the Relationship Type option set and the Product Price List lookup fields:

Relationship Type:

And Product Price List looks like:

First, let’s find the name of the fields we’re setting by opening the customizations.

  • customertypecode
  • defaultpricelevelid

Next, we’ll need to know the entity name of the lookup field. For Product Price List, this is msdyn_projectpricelist:

Finally, let’s grab the GUID of a lookup field, e.g. B068786C-6908-EA11-A823-000D3A35B658. And for the Option Set, we can open the field properties to get the value we want to set to, in our case Partner = 5.

Now let’s open the USD Debugger and build the command:

LogicalName=account
defaultpricelevelid=EntityReference(msdyn_projectpricelist, "B068786C-6908-EA11-A823-000D3A35B658")
defaultpricelevelidname=CRM Service USA (Sample)
customertypecode=OptionSetValue(5)

Note to send the “name” field for the lookup – if this is not populated, the lookup field displays without text and only with the icon, like below:

Click to run the command:

The new record is opened with the fields defaulted:

 

Carl de Souza
Keep learning. Keep building.

Explore AI, agents & Microsoft technology.

I share practical ideas, tutorials, and videos about AI, AI agents, Microsoft technologies, and the Power Platform.

Subscribe on YouTube →
Carl de Souza Enterprise Architect at Microsoft · AI Technology Expert

Leave a Reply

Your email address will not be published. Required fields are marked *