Community
Showing results for 
Search instead for 
Do you mean 
Reply

Read Custom field added to Products

Tuned Listener
Posts: 10
Country: United_Kingdom

Read Custom field added to Products

Hi,

 

Ive added a custom field into the proudcts table via the following code

 

FIELD_FREESTOCK_DESC = "Free Stock";

FIELD_FREESTOCK_ALIAS = "FREE_STOCK";

 

FieldDescriptor stockField = new FieldDescriptor(ProductEntityDefinition.FIELD_FREESTOCK_DESC,
ProductEntityDefinition.FIELD_FREESTOCK_ALIAS,
RecordType.Product, FieldDataType.Number);
Framework.Fields.Save(stockField);

 

When trying to access it using the following it errors saying the real name is invalid, is there another more failsafe way of accessing the field ?

 

CustomEntityFieldDescriptor fldStock =
actFwk.Products.OpportunityProductManager.GetCustomEntityFieldDescriptor(ProductEntityDefinition.FIELD_FREESTOCK_ALIAS, FieldNameType.Alias);