In an earlier post I explained how to create an entity from a Unified Service Desk agent script.

This essentially described the process needed to use the CRM_New_Page action to create an entity. In other examples I have triggered this action from an agent script and also from a toolbar.

I have recently created another example of this to create an opportunity from a contact.

In this my toolbar button looked like this ….

opportuntiy action 2

The action it called, that did all the work, looked like this …..

opportuntiy action

The data portion looked like this ….

LogicalName=opportunity
customerid=EntityReference(contact,[[contact.Id]])
customeridname=[[contact.fullname]]
parentcontactid=[[contact.Id]+]
parentcontactidname=[[contact.fullname]+]
parentaccountid=[[contact.parentcustomerid.Id]+]
parentaccountidname=[[contact.parentcustomerid.name]+]

I also created another similar action to allow me to create an opportunity for an account. With that the data portion was change to look like this ….

LogicalName=opportunity
customerid=EntityReference(account,[[account.Id]]) 
customeridname=[[account.name]] 
parentaccountid=[[account.Id]+] 
parentaccountidname=[[account.name]+] 
parentcontactid=[[account.primarycontactid.Id]+]
parentcontactidname=[[account.primarycontactid.name]+]