This topic is locked
[SOLVED]

Storing different value in field on 2nd Add Page

10/14/2022 2:33:27 AM
PHPRunner General questions
S
Sayed author

There is a default Add Page of PHPRunner.
and
Copy of Add Page as Add1

Edit As Field is same for both pages.

How can I store different values in a same field, for both page. For example...
Add page > Field [Type] should store value "Invoice"
Add1 page > Field [Type] should store value "Payment"

admin 10/14/2022

When you are saying "store", what does it mean? Are you talking about a Default Value?

S
Sayed author 10/16/2022

Yes, want to save default value, but different for both pages.

admin 10/16/2022

Check ProcessRecordValues event. In that event you can check what page you currently on and set the default value accordingly.

To find what page you currently on check Working with additional pages page.

S
Sayed author 10/28/2022

if( $pageObject->pageName == "add1" ) {
$values["Type"]="Payment";
}
else{
$values["Type"]="Invoice";
}

Above is the code for "Before record added" event.