on 10-31-2018 4:19 PM
Hi all,
I have a problem of base document,
I tried to add document which has base document with 1 line or row in php it works fine,
But if base document has more than 1 row it does not work, if I try to add the second row, I get error message Notice: Trying to get property of non-object in C:\wamp\www\............
Below are my sample codes
$oOrder->Lines->Itemcode="A001";
$oOrder->Lines->Quantity=1;
$oOrder->Lines->UnitPrice=200;
$oOrder->Lines->BaseType="1470000113";
$oOrder->Lines->BaseEntry=7;
$RetCode=$oOrder->Lines->Add;
//THE PROBLEMS ARE HERE
$oOrder->Lines->Itemcode=A002;
$oOrder->Lines->Quantity=2;
$oOrder->Lines->UnitPrice=300;
$oOrder->Lines->BaseType="1470000113"; // IF BASE FIELDS ARE COMMENTED THE SECOND LINE WILL BE ADDED IN DATABASE BUT WITHOUT LINK OF BASE DOCUMENT
$oOrder->Lines->BaseEntry=7;// COMMENTED
$RetCode=$oOrder->Lines->Add;
$RetCode=$oOrder->Add;
This means the base doc will be still open where you can edit the second line because the second base fields stored -1 in baseentry
As it seems the second row does not allow BaseEntry and BaseType fields
How can I add document which has base document with 2 lines in SDK?
Please anyone can help me
Hi,
When drawing a document (linking a source document's lines to a target document's lines), you must set four properties:
The Quantity property should only be set if the quantity is less than that of the line in the source document. Don't set any other properties like ItemCode. By drawing the line as described above, all other fields will automatically be copied by the DI API.
If you need to add lines to the target document, that are not in a source document, you must first add the new document, then open it, and only then add the none-linked lines.
Regards,
Johan
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Johan,
How can I add incoming payment in SAP B1 SDK? I tried to use below fields but I am getting the following error message Notice: Trying to get property of non-object in C:\wamp\www\............
Below is my sample codes (PHP)
$oIncom->CardCode="0000C";
$oIncom->DocDueDate="2018-11-06";
$oIncom->DocDate="2018-11-06";
$oIncom->TaxDate="2018-11-06";
$oIncom->CashSum=100;
$oIncom->CashAcct="569600";
$oIncom->Lines->DocEntry = 82;
$oIncom->Lines->InvType = 13;
$oIncom->Lines->DocLine = 0;
$oIncom->Lines->SumApplied = 100;
$RetCode=$oIncom->Lines->Add;
$RetCode=$oIncom->Add;
I do know if there are missing mandatory fields
Please anyone can help me
Hi Johan,
I did it
Thank you
User | Count |
---|---|
98 | |
11 | |
11 | |
6 | |
6 | |
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.