04-11-2014 05:25 AM
Perhaps someone could explain this to me?
I'm obtaining a list of Opportunity Field Descriptors as here: -
ACTFields = ACT.Instance.ActFramework.Opportunities.GetFieldDescriptors
On of the items returned is the record manager which has a display name of "Record Manager". However, if I try to get the value from an Opportunity as here: -
ACT.Instance.ApplicationState.CurrentOpportunity.Fields("Record Manager", MutableEntities.FieldNameType.Display)
It fails with "Invalid Name Format". Am I missing something?
01-16-2015 04:20 AM
I have the same problem with:
"ContactFieldDescriptor CFD1= ActFr.Contacts.GetContactFieldDescriptor("Branche", FieldNameType.Display);"
Tried everything but it does not work.
I have no clue.
01-16-2015 07:11 AM
I was unable to find out why this doesn't work. It appears to be correct as far as I can see.
What I did to go around this was to use the Alias name of the field instead. If you need to find out the alias field name, you could loop through each of the items in the collection as obtained here to find it: -
Dim Fields As FieldDescriptorCollection = _ACT_Instance.ActFramework.Fields.GetFields(Act.Framework.RecordType.Contact)
Hope that helps.
01-16-2015 07:40 AM
These issues are usually a result of the field in question being in a spillover table. The best way to solve the problem is to create your own collection of field dscriptors and use it. I just create a collection where the key is the display name and the object is the real table and column names and then use that.
06-23-2017 03:47 AM - edited 06-23-2017 03:54 AM
If you're using the Display name you'll need the Table Display Name too e.g.
ACT.Instance.ApplicationState.CurrentOpportunity.Fields("Opportunity.Actual Close Date", MutableEntities.FieldNameType.Display)
(Not sure why but this doesn't return anything for the Record Manager field, but does for other fields)
So for benoit22's example you'd likely need:
ContactFieldDescriptor CFD1= ActFr.Contacts.GetContactFieldDescriptor("Contact.Branche", FieldNameType.Display);
I also found that using Opportunities.GetOpportunityFieldDescriptor wouldn't work using the Display names but Opportunities.GetMutableEntityFieldDescriptor does. You just need to set the variable as Act.Framework.MutableEntities.MutableEntityFieldDescriptor instead of Act.Framework.Opportunities.OpportunityFieldDescriptor