09-28-2017 4:13 PM - edited 02-04-2024 2:10 AM
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"
Perfect, thanks so much, where did you find the answer? do you have a manual?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
107 | |
12 | |
11 | |
6 | |
5 | |
4 | |
4 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.