on 04-29-2016 2:50 AM
hi all
i am using sdk for create AR\invoice program working good . but when save invoice return number of new document not correct.
for example my program return number of new doc is 16803 . but when search in the last invoice in SAP number deffrent number 16805 .
this code
if (con() == false)
return;
SAPbobsCOM.Documents oInvoices = (SAPbobsCOM.Documents)Vcmp.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oInvoices);
oInvoices.CardCode = "C99999";
// umenty ugpentry
oInvoices.Lines.ItemCode = ItemCode;
oInvoices.Lines.Quantity = Quantity;
oInvoices.Lines.UnitPrice = UnitPrice;
oInvoices.Lines.UoMEntry = UoMEntry;
oInvoices.Comments = "by mahmuode pos2";
oInvoices.Printed = SAPbobsCOM.PrintStatusEnum.psYes;
oInvoices.Lines.Add();
if (lRetCode != 0)
{
Vcmp.GetLastError(out lErrCode, out sErrMsg);
MessageBox.Show(sErrMsg);
}
else
{
string num = Vcmp.GetNewObjectKey();
MessageBox.Show("Invoice [" + Vcmp.GetNewObjectKey() + "] created!");
add_pyment(Convert.ToInt16(num), Convert.ToDouble(label_price.Text));
print(Convert.ToInt16(num));
}
You can used "GetNewObjectCode" instead of "GetNewObjectKey". Because "GetNewObjectKey" is every time SAP user created a document you'll get the result. Unlike in "GetNewObjectCode".
Dim oJVNumber As String = ""
oCompany.GetNewObjectCode(oJVNumber)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Just to explain the diference between GetNewObjectKey and GetNewObjectCode:
You can use this method GetNewObjectKey, instead of GetNewObjectCode, for development technologies that do not support return value as an Out parameter, such as ASP.
Both methods retrieves the key of the last added record.
Provided by : SDK help file.
Best regards,
Diego Lother
User | Count |
---|---|
108 | |
12 | |
11 | |
6 | |
5 | |
4 | |
3 | |
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.