1
votes

Using CRM 2013 On Premise I have created a dialog process that basically creates a new entity record. For this example lets say we are creating an opportunity.

The dialog creates the opportunity and then proceeds on to allow the user to find products to add to the opportunity. This is where I run into my problem. I see no way using OOB dialogs, workflows, actions etc. to add a relationship.

I am capable of creating a custom plug-in or workflow but since I am new to CRM 2013 I wanted to make sure there wasn't a way to do this OOB.

If I do have to develop custom code are there samples / tutorials (I do have the 2013 sdk installed) to get me started?

Further how would this be implemented with regards to interacting with the dialogs?

For example the user has selected a product. The prodid is sent to my custom code. How do I keep the dialog from proceeding until custom code is complete?

Thank you for your help!


Edit to add information...

@mydevexperience...

I can get the list of products no problem. The user selects a product no problem. I have that product ID but the update is where I am having my difficulty....and based upon the inferred ease of your answer I must be missing something.

When I select update opportunity then go to Set Properties what field do I populate? In the GUI I select a product from the "products grid" on the form.

Obviously I can't update the grid....however there is some field (a collection field of some sort) that maintains a list of all the 1:N (in this case N is the Products) items...???

So sorry for the lack of understanding but I'm not sure how to do the actual update step...outside custom code.

Further...There is a relationship called: product_opportunities. The grid on the form pulls a view from OpportunityProduct entity. Looking in the DB the OpportunitProductsBase table is basically...really simplified here....OpportunityID & ProductID.

The view of the grid resolves these ID's into meaningful human readable text.

So I want to update that relationship table and it just seems like I'll be needing to write code to do that...but just thought that would have been addressed by Msoft but of course they have a long to do list and can't get to everything.

1
If I understand correctly set the focus of field by pressing the mouse you want to update. Then on the right hand side menu click look for and you can see the under local values the selected product. Select the Id. Click Add and press ok.mydevexperience
Right...what field? There is a relationship called: product_opportunities.GPGVM
Dialog step > Update : Select a product. Set the Opportunity look up id.mydevexperience
Sorry these images are too small. I can't make out what they are showing...?GPGVM

1 Answers

0
votes

You are using opportunity products entity. By design you can't create Opportunity Products using out of the box dialogs or workflows.

You need custom code to acheive this.

Store the opportunity id and product id in a temporary entity and write a plugin to update the products.

http://msdn.microsoft.com/en-us/library/gg509009.aspx