Skip to Content
author's profile photo
Former Member

Saving a marketing document as a draft using DIAPI

Hi,

Does DIAPI support saving a marketing document (SO, PO) as a draft?

Thanks,

Satish.

Add comment
10|10000 characters needed characters exceeded

  • Follow
  • Get RSS Feed

1 Answer

  • Best Answer
    Oct 03, 2005 at 04:47 AM

    Hi Satish!

    Yes, DI include a special BusinessObject for that purpose.

    SAPbobsCOM.Documents oDraft, oDocFrom;
    oDraft = (SAPbobsCOM.Documents)pCmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oDrafts);
    oDocFrom	= (SAPbobsCOM.Documents)pCmpFrom.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices);
    ....
    ....
    // doc type
    oDraft.DocObjectCode = SAPbobsCOM.BoObjectTypes.oPurchaseInvoices;
    oDraft.CardCode = tbVendorCode.Text.Trim();    
    oDraft.HandWritten = SAPbobsCOM.BoYesNoEnum.tNO;
    oDraft.DocDate = oDocFrom.DocDate;
    
    for (int i=0; i<oDocFrom.Lines.Count; i++)
    {
    	oDocFrom.Lines.SetCurrentLine(i);
    	oDraft.Lines.ItemCode	= oDocFrom.Lines.ItemCode;
    	oDraft.Lines.ItemDescription	= oDocFrom.Lines.ItemDescription;
    	oDraft.Lines.Quantity		= oDocFrom.Lines.Quantity;
    	oDraft.Lines.Price 		= oDocFrom.Lines.Price;
    	oDraft.Lines.WarehouseCode	= tbWHCode.Text.Trim();
    	oDraft.Lines.Add();
    }

    HTH

    Add comment
    10|10000 characters needed characters exceeded