cancel
Showing results for 
Search instead for 
Did you mean: 

Update User Defined Fields in ITM1

Former Member
0 Kudos

I don't see how to update the UDF I added to the ITM1 table. I added two Fields: "U_I001" and "U_I002"

I have an Items object to update ITM1/Price which works perfectly,

I can't acces my UDF from that table, which object am I supposed to use?

here is my code:

oItems = (SAPbobsCOM.Items)B1Connections.diCompany.GetBusinessObject(BoObjectTypes.oItems);
				
oItems.GetByKey("A001");
oItems.PriceList.SetCurrentLine(0);	

//This line works ok				
oItems.PriceList.Price = 'MyUpdatedPrice;

//These lines don't seem to refer to the right fields
oItems.PriceList.UserFields.Fields.Item("U_I001").Value = 'MyNEwValue1;
oItems.PriceList.UserFields.Fields.Item("U_I002").Value = 'MyNewValue2;
oItems.Update();

View Entire Topic
Former Member
0 Kudos

Hi Emmanuel,

How did you add UDF to the ITM1 table? If you add UDFs to the price list object it is added to the OPLN table and not the ITM1 table. Add the following error checking to your code to find out what error you receive:

If oItems.Update <> 0 Then
    oApplication.MessageBox(oCompany.GetLastErrorDescription)
End If

Hope it helps,

Adele