Skip to Content
0
Oct 07, 2013 at 02:07 PM

Not able to Update User defined field of Batch

178 Views

Hi experts,

I am not able to update the User Defined Field named "U_QCResult" this Field i have added in OBTN table. code runs error free. but in table value not get update. following is my code.

SAPbobsCOM.Documents oGRPO1;

oGRPO1 = clsAddOn.LDNA_Company.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oPurchaseDeliveryNotes);

oGRPO1.GetByKey(int.Parse(GRPONo));

if (IsTest_Pass)

oGRPO1.Lines.BatchNumbers.UserFields.Fields.Item("U_QCResult").Value = "P";

else

oGRPO1.Lines.BatchNumbers.UserFields.Fields.Item("U_QCResult").Value = "F";

int i = oGRPO1.Update();

if (i == 0)

{

clsAddOn.LDNA_Application.StatusBar.SetText("GRPO Update sucessfully.", SAPbouiCOM.BoMessageTime.bmt_Medium, SAPbouiCOM.BoStatusBarMessageType.smt_Success);

}

-Regards

Vikas