Community
Showing results for 
Search instead for 
Do you mean 
Reply

Can I set custom fields n Products?

Tuned Listener
Posts: 38
Country: Poland

Can I set custom fields n Products?

There are possibilities to add new fields to Products (like  new Act.Framework.Database.FieldDescriptor(Name, Act.Framework.RecordType.Product, …)

 

But it is not possibility to set this new fields in Product. I added new fields to Company and Opportunity. There are special properties named “CompanyFields” or “OpportunityFields”. But there is no this kind of field in Product. So – can I set this new value, or not? I need keep some extra information connected with products.

 

I know that it is possible set this new fields in OpportunityProduct which are connected with Opportunity.

 

best regards

b.

Employee
Posts: 1,163
Country: USA

Re: Can I set custom fields n Products?

[ Edited ]

Just to make sure I'm clear on what the goal is here, you want to set the value for a custom product field?

Matthew Wood
Act! SDK Support
Community Moderator
Tuned Listener
Posts: 38
Country: Poland

Re: Can I set custom fields n Products?

I need extend Products. Eg. you can set "Cost", "Price" for products. I need any other data.I added some extra fields, but I can set them only for products which are in list of product in concrete opportunity. Not in product itself.

best regards

Copper Contributor
Posts: 32
Country: United_Kingdom

Re: Can I set custom fields n Products?

Any news on this? We'd like to add a few custom fields to our product list and be able to see/set them in the add/edit product  dialogue box

Employee
Posts: 1,163
Country: USA

Re: Can I set custom fields n Products?

With the code below I was able to create a new field for products and add it ot the products UI form:

 

private void CreateProductField()
{
try
{
ActApp.ActFramework.Database.LockDatabase(DatabaseLockReason.SchemaChanges);
FieldDescriptor ProductField = new FieldDescriptor("SDK Product", RecordType.Product, FieldDataType.Character);
ProductField.AllowEmpty = true;
ActApp.ActFramework.Fields.Save(ProductField);
}
catch (Exception x) { MessageBox.Show(x.ToString()); }
finally { _ActApp.ActFramework.Database.UnlockDatabase(); }

MessageBox.Show("Complete");
}

Matthew Wood
Act! SDK Support
Community Moderator
Copper Contributor
Posts: 32
Country: United_Kingdom

Re: Can I set custom fields n Products?

thanks mwood,
I'll give that a try next week since due to deadlines i'm going to implement the work-around solution I created for this first and will report back.
Copper Contributor
Posts: 32
Country: United_Kingdom

Re: Can I set custom fields n Products?

so unless i misunderstood, that code did exactly what using "define fields" for products would do - ie creat a field in the productservice table - which means that the value would have to be defined every time a product is added to an opportunity, instead of being stored with the product itself.

Cheers for the code though, it was useful to see how fields can be added programmatically. Your posts on the forum in general have been incredibly useful in getting to understand the workings of the SDK and I'm really grateful.