USD – Create Opportunity

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]+]

6 thoughts on “USD – Create Opportunity

  1. Pingback: USD – Agent Scripts Collection | Microsoft Dynamics CRM and Unified Service Desk

  2. Hi Neil,
    I have created opportunity host control as it was not there in USD. then I have tried to run above code. still it does not work. when I used “incident” as host control in above action call and used data as “LogicalName=incident” then it worked.
    Please let me know why this is happening?
    Regards,
    Vivek

    Like

    • Hi Vivek,

      Firstly thanks for reading my blog and posting a comment.

      Have you checked you window navigation rule? The most common reason for a tab not loading in this situation is a missing or incorrectly defined window navigation rule.

      I am confident that the approach I have described works. Can you please check you navigation rules first?

      If that isn’t the answer feel free to reply back with more details and also let me know you USD version?

      Thanks again,

      Neil.

      Like

  3. Hi Neil,
    As you said, windows rule was missing so I have to create a windows rule like “LoadOpportunityPage” which was quite similar to “LoadContactPage” in which I have to replace “contact” word with “Opportunity”.
    Thanks a lot for a great help.
    Regards,
    Vivek

    Like

  4. Pingback: USD – The Book | Microsoft Dynamics CRM and Unified Service Desk

Leave a Reply to Vivek Kumar Cancel reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s