11-11-2009 01:02 PM
I have created extra fields in Opportunities/Add Products and am now trying to access them via the SDK. I am having difficulty visualising where the fields are actually stored; as after connecting to Act through Excel, the fields don't appear to be in any of the tables I would have expected?
It maybe easier to ask if what I am trying to achieve is even possible and perhaps put me out of my misery: Get data from two of the fields I have created, add them together and return it to a third field?
09-21-2010 06:22 PM
I still have the same problem. The SDK documentation isn't of a good help.
When adding Custom fields to product (menu manage fields / products) , these are not retrievable via ActFramework.Products.GetFieldDescriptors.
We can however find out these fields using ActFramework.Fields.GetFields(RecordType.Product)
However the result is a collection of FieldDescriptor and not DBFieldDescriptor. This is not good because i do not figure it out how to get/set values for such fields.
Any help is very very welcome.
I have the similar requirement to programmatically access and add new Product fields.
Does anyone has the idea how to do this in ACT! SDK 2010?
09-22-2010 09:52 AM
@Marko The new fields you've created can be viewed in the Product_Service view of the OLE.
You can definetly get the values from two fields, perform an operation on them and then update another field with this information. I am however encountering something similar to what taha has discovered. We cannot get the Field via:
DBFieldDescriptor Products = _ActApp.ActFramework.Products.GetFieldDescriptors();
We can capture the field like this:
FieldDescriptorCollection AllProdFields = _ActApp.ActFramework.Fields.GetFields(RecordType.Product);
As mentioned, FieldDescriptors do not have Get and Set value methods.
If we know the Opportunity however we should be able to gather the OpportunityProducts and get an assign values that way:
OpportunityList ol = _ActApp.ActFramework.Opportunities.GetOpportunities(null);
CustomEntityList<OpportunityProduct> p = ol.GetProducts(null);
p.Fields["MyCustomProduct"] = "Data";