Skip to Content
author's profile photo Former Member
Former Member

deleting warehouses from items

how can i delete the warehouse from a item by SDK, i'm using B1tch app to do that by python but some way i cannot find which is the method to iterate over the warehouse from that item and delete that warehouse that i don't want that item have, i'm using this

for almacen in browse(SAPbobsCOM.BoObjectTypes.oItems, query("select TOP 1 ItemCode from OITM ")):          almacen.GetByKey(almacen.ItemCode);          almacen.WhsInfo.WarehouseCode

but that just give me the first warehouse and anyway i can't delete it

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Jan 07, 2013 at 11:02 AM

    I would try with:

    //retrieve item object as you want and then... ItemWarehouseInfo iwi = oItem.WhsInfo; //loop on warehouses for this item for(i=0; i<iwi.Count; i++) {    iwi.SetCurrentLine(i);    if(iwi.WarehouseCode == "codeOfWarehouseIHate") {        iwi.Delete();        break;    }}

    Tell us if it works!

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.