Would anyone know what is the proper c# code to delete an order in a customization? This doesn’t work:
Int SONum = 1234567;
SalesOrderAdapter SO = new SalesOrderAdapter(this.oTrans);
SO.BOConnect();
SO.DeleteByID(SONum);
And this doesn’t work:
Int SONum = 1234567;
SalesOrderAdapter SO = new SalesOrderAdapter(this.oTrans);
SO.BOConnect();
SO.GetByID(SONum);
SO.SalesOrderData.Tables["OrderHed"].Rows[0]["RowMod"] = "[Delete]";
SO.Update();
And this doesn’t work:
Int SONum = 1234567;
SalesOrderAdapter SO = new SalesOrderAdapter(this.oTrans);
SO.BOConnect();
SO.GetByID(SONum);
SO.SalesOrderData.Tables["OrderHed"].Rows[0]["RowMod"] = "D";
SO.Update();
If anyone can advise, I would be appreciative. Thanks.
Dan,
As an aside, I am piqued as to whether Jose’s solution will work on a fully-populated order. I will try when I have some free time, just for grins and giggles.
@BBussey Good question. It goes through the BO so I assume if you can delete a fully populated order in the GUI that this would work as well but defintely share your results please!
It will that just calls the same business logic as hitting delete in the UI.
It will work as long as there are no referential integrity issues related (Jobs, POs etc)