Community
Showing results for 
Search instead for 
Do you mean 
Reply

Updating Products

New Member
Posts: 2
Country: United_Kingdom

Updating Products

I'm creating new products in a database using the follwing:

 

using ACTOpps = Act.Framework.Opportunities;

ACTOpps.Product newp = oApp.ActFramework.Products.CreateProduct(Description, StockCode, Convert.ToDecimal(sPrice), Convert.ToDecimal(sCost));

 Which seems to work fine but I then want to update some of the values later.  Can someone help me with this?

 

As an example, I may want to change the price at a later date

 

Thank you :-)

Employee
Posts: 1,163
Country: USA

Re: Updating Products

To do this, get the products from and existing opportunity (OpportunityProducts)

 

oppProdList = existingOpp.GetProducts(null);

 

From there you can set any of the fields for that product. 

 

oppProdList[0].Price = 1;

 

This will altar the values for a product of an existing opportunity. To change the product itself, get the list of products:

 

ProductList myProducts = ActApp.ActFramework.Products.GetProducts(null);

myProducts[0].Cost = 1;

 

HTH

Matthew Wood
Act! SDK Support
Community Moderator