on 09-18-2014 1:12 AM
I am writing a method in which users input data into a PHP form and the data gets sent into SAP. The one hangup I have is working with SetCurrentLine, specifically when a user attempts to update a BP Address and also add a new BP Address. First I have to check to see if the Address already exists, so I do a For loop as such:
for ($i=0; $i<$oBP->Addresses->Count; $i++) {
$oBP->Addresses->SetCurrentLine($i);
if ($oBP->Addresses->AddressName == $billname && $oBP->Addresses->AddressType == 1) {
//code here
}
}
However, if I then wish to add a new address as such:
$oBP->Addresses->AddressType = 0;
$oBP->Addresses->AddressName = 'test';
$oBP->Addresses->add();
it still has SetCurrentLine set from the for loop and thus just overwrites the address at the last LineNum. Is there a way to UnsetCurrentLine i.e. tell the DI API that I want to input a new address as opposed to working on the current LineNum? I'm not sure how to work around this issue.
Hi Ian,
As with most of the DI API object :
Example.
When you initialize a new BP object, :
In such view, for your answer,
$oBP->Addresses->add();
$oBP->Addresses->AddressType = 0;
$oBP->Addresses->AddressName = 'test';
Regards
Edy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
7 | |
6 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 | |
2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.