07-09-2010 08:38 AM
I'm using ACT Version 220.127.116.111
I'm writing in vb.net (a visual studio 2005 app)
I've been able to create new contacts and opportunities, create associations, query, etc.
If I want to update a single opportunity record and know it's opportunityID, how do I locate the record and place values into it's fields. The fields to be updated are both original (out of the box) opportunity fields and new added fields.
A code snippet that includes the locating/pointing to an opportunity record as well as a field being updated would be greatly appreciated.
Thanks in advance!
07-09-2010 09:22 AM - edited 07-09-2010 09:22 AM
You can use
OpportunityList myOppList = ActApp.ActFramework.Opportunities.GetOpportunitiesByID(null, oppGuid);
to retrieve an opportunity by ID
//isolate this opportunity from the list
Opportunity myOpp = myOppList;
With this opportunity object you can set it's various fields either like this:
myOpp.Name = "";
myOpp.Fields["Company", true] = "";
once you've made your desired changes just call the update method for said opportunity.
07-12-2010 11:21 AM
Thanks for the quick response!
I spent time converting your example to vb and encountered a little difficulty:
1) What type of object is oppGuid? An array, memory variable, ACT object?
2) Any chance you could provide the same example in VB? My C->VB skills aren't strong.
Thanks in advance, I appreciate it!
07-12-2010 11:55 AM
07-12-2010 11:58 AM
07-12-2010 12:11 PM
Thanks again for the quick replies!
In your last example (thanks for the VB by the way), where do you use a known opportunity ID (guid)?
I have the ID (as a GUID) in a memory variable for example.
Thanks again! Huge help!
07-12-2010 12:50 PM