|
I've created a custom field called "Program Name" through the ACT! GUI. I'm struggling to access the field through the SDK though. Using the Framework, I’m able to identify the field. Dim f As MutableEntities.MutableEntityFieldDescriptor For Each f In ACTFWK.Opportunities.GetMutableEntityFieldDescriptors() Debug.Print(f.ColumnName & ", " & f.DisplayName & ", " & f.TableName) If f.Description = "Program Name" Then Exit For Next I can see the following information regarding f in the debug window: CUST_ProgramName_031511146, Program Name, TBL_OPPORTUNITY However, I’m not sure how to read this field or write to it. Here’s my code to find and loop through the Opportunities. It’s probably not the most efficient, but it works. Dim opp As Opportunities.Opportunity Dim cOpps As OpportunityList Dim cColumn1 = ACTFWK.Lookups.GetCriteriaColumn("TBL_OPPORTUNITY.NAME", True) Dim lCriteria() As Criteria = New Criteria() {New Criteria(LogicalOperator.End, CType(0, Byte), CType(0, Byte), cColumn1, OperatorEnum.ContainsData, ValueEnum.Nothing)} cOppLookup = ACTFWK.Lookups.LookupOpportunitiesReplace(lCriteria) cOpps = cOppLookup.GetOpportunities(Nothing) For Each opp In cOpps Debug.Print(opp.Name & ", " & opp.User1) Next I was looking for a method that would allow me to access this custom field that I added using a reference to the field identified above. Psuedocode: Debug.print Opp.Field(f).Value I attempted to Debug.Print(opp.Fields(strFieldName)) with various combinations of names, and got an error every time I tried. (strFieldname = "TBL_OPPORTUNITY.CUST_ProgramName_031511146" or strFieldName = "Program Name" and even strFieldName = "TBL_OPPORTUNITY.NAME") Could someone please point me in the right direction? Are code examples available anywhere? Thanks, Rob Message Edited by rlepard on 11-06-2009 03:19 PM
|