07-04-2014 07:23 AM
Hello everyone and thanks in advance for anyone who can help me with my issue.
My company provides services to clients and we are using opportunity products to track the services.
I am looking for a way that our users can link a contact to an opportunity product through the Add/Edit Product dialog box ideally.
In the worst case I will create a text field on the Opportunity Products and through my plugins allow the user to select a contact for a specific product which would then add the contact's name to the Product field.
This would be half of a solution.
I know that if I have an OpportunityProduct object in the SDK there is an option to say opp.SetContacts() which I haven't tried but even if this worked how would I display that for the user.
Ideally I would like it to be like a group contact where you can select the contact link and it would switch to the contact clicked.
Any thoughts on the best way I could achieve this?
07-04-2014 08:16 AM
I'm not sure that you're going to be able to do this as well as you'd like.
SetContacts just seems to be an inherited method from the CustomEntities class. However as Products are exclusively a subentity of Opportunities then I can't see that it actually does anything here. I did some testing and although it does actually accept a Contact and update the Product to the Opportunity correctly, I couldn't see that it had been recorded anywhere so I couldn't read it back out.
Additionally it is not possible to modify any of the dialogs in Act! using the SDK. It is possible to override the dialog with one of your own design to mimic this effect, but that's not something that we offer support with.
Admittedly my initial thoughts on this were the same as the method that you had already suggested, that a Product field is created to store the Contact(s) information.
I'll do some more testing and get back to you if I can think of a better way to do this.
07-04-2014 08:32 AM
Thanks for your quick response.
I would have to agree with you that there is likely no way to directly relate a contact to the Product. After looking at the database tables I didn't see a table which would relate the two. Only Opportunities and Products so I would have to figure out another method.
Most likely I will create two fields on the Product one for Contact name and one for Contact ID (which would be hidden). This way I can create some sort of custom form which would display the contact's name but have a reference to the contact ID and allow the user to click a button or link of some sort and then just use the SDK to show the contact detail view based on the Contact ID.
I figured I would have to inherit from the dialog box and create my own version inorder to achieve what I want. Still trying to figure that one out.
Thanks again for your response!