Skip to Content
0

HOW I CAN CHANGE THE WHEREHOUSE IN SALES ORDER

Sep 28, 2017 at 03:13 PM

34

avatar image
Former Member

Hi everyone somebody tell me how i can change the Warehouse Code with the SDK and Visual Studio .net i know how insert a saler order but i need change the Warehouse Code for some product lines i try do that with this code but dont work

 Dim oOrder As SAPbobsCOM.Documents
 oOrder = oCompany.GetBusinessObject(BoObjectTypes.oOrders)

oOrder.Lines.WhsCode = "07"
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

DIEGO LOTHER Sep 28, 2017 at 04:05 PM
0

Hi Luis,

Your code is incomplete.

A sample:

//Initialize your object
Documents oDoc = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oOrders);
//the number of your sales order(DocEntry)
int docEntry = 190;
//Load your sales order
if (oDoc.GetByKey(docEntry))
{
    //Walk through your itens
    for (int i = 0; i < oDoc.Lines.Count; i++)
    {
        //Set the positon for the line
        oDoc.Lines.SetCurrentLine(i);
        //The new warehouse code
        oDoc.Lines.WarehouseCode = "09";
    }
    //Update your sales order in database
    if (oDoc.Update() != 0)
        MessageBox.Show(oCompany.GetLastErrorDescription());
}

Hope it helps.

Kind Regards,

Diego Lother

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Oct 11, 2017 at 09:35 PM
0

Perfect, thanks so much, where did you find the answer? do you have a manual?


Show 2 Share
10 |10000 characters needed characters left characters exceeded

Great,

Don't forget to click on accept button below my answer if your doubt was solved.

Kind Regards,

Diego Lother

0

Hi Luis,

You can install SAP Business One SDK, it is a part of SAP Business One package.

In SDK you are able to find helps and samples.

Hope it helps.

Kind Regards,

Diego Lother

0