cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot update StandardAveragePrice

Former Member
0 Kudos

Hi, I'm getting a error message when I try to update the StandardAveragePrice field in the ItemWarehouseInfo document. Error msg is: [OITW] , 'Field cannot be updated (ODBC -1029)'. Below is my code.

If ConnectDICompany(oCompany, strErrMsg) <> RTN_SUCCESS Then GoTo Err_

Set oDocItem = oCompany.GetBusinessObject(oItems)

oDocItem.WhsInfo.SetCurrentLine (intIndex2)

oDocItem.WhsInfo.StandardAveragePrice = CDbl("234.00")

lngErr = oDocItem.Update

if lngErr <> 0 Then

oCompany.GetLastError lRet, strErrMsg

GoTo Err_

End If

Accepted Solutions (1)

Accepted Solutions (1)

barend_morkel2
Active Contributor
0 Kudos

This field can not be updated - it uses system calculations from SBO to calculate this field (when the invoice for the item is created). You can thus only read this field - BSO will not allow you to update this...

Former Member
0 Kudos

In the DIAPI it mentioned that this field is a read-write field. Is there a error in the documentation?

If what you said is right, is there any other way to temporary change the value of the Item cost before a DO or a AR Invoice is submitted. Reason is we have some items that required to use the purchased price tagged to the serial number and not the Moving Average, FIFO, etc.

barend_morkel2
Active Contributor
0 Kudos

You can't change the way the system works. (Internal calculation and updating mechanisms). Faced with the same problem in my company - we manage these values with user defined fields. It is unfortunaltely the only way to accomplish a more "real time" item cost calculation!

Answers (0)