This topic is locked

Button Copy Settings issue.

5/2/2016 5:56:37 AM
PHPRunner General questions
A
Abhijeet author

Hello Team,
I am having a master detail form in phprunner 8.1 on windows and xampp with oracle back end database, and I want to copy one master field value to one of my detail table field. I have given the copy setting to the detail field and selected my master table and field. But nothing happens, it is not copying the value at all from the master field.
Please let me know how are you using "Copy Setting" Button.
Regards,

Sergey Kornilov admin 5/2/2016

I'm not really sure what "Copy setting" button you mean. Can you post a screenshot that explains it?

A
Abhijeet author 5/3/2016



I'm not really sure what "Copy setting" button you mean. Can you post a screenshot that explains it?


Hello,
I cannot upload image though, I will explain, when you right click in editor on a detail field and go in properties, on right hand side top corner you see copy settings button.
I want to know what it is used for ? I cannot copy master field value in detail field by doing it.
Hope this helps.

Sergey Kornilov admin 5/3/2016

This button allows to copy settings like 'View as' settings or 'Edit as' settings from one field to another.

A
Abhijeet author 5/4/2016



This button allows to copy settings like 'View as' settings or 'Edit as' settings from one field to another.


Hi Sergey,
This facility is good and has usability to a certain extent, but I would have appreciated it more if it copies the field value as well. You can take it as a feature request.
Regards,

Sergey Kornilov admin 5/4/2016

Abhijeet,
you are mixing apples and oranges here. This button copies settings in design time like field label (Make), 'Edit as' type (Text area), field size parameters ( width, height etc).
What you need to do is to add a code to one of events like BeforeAdd or BeforeEdit to copy field data from master record to details record. Use getMasterRecord() function to access master record data:

http://xlinesoft.com/phprunner/docs/getmasterrecord.htm

A
Abhijeet author 5/5/2016



Abhijeet,
you are mixing apples and oranges here. This button copies settings in design time like field label (Make), 'Edit as' type (Text area), field size parameters ( width, height etc).
What you need to do is to add a code to one of events like BeforeAdd or BeforeEdit to copy field data from master record to details record. Use getMasterRecord() function to access master record data:

http://xlinesoft.com/phprunner/docs/getmasterrecord.htm


Hello,
I have tried to add below code to almost all events in the details page and also the BeforeAdd and BeforeEdit, but in insert mode the value doesn't get populated in the details, no matter what.
$data = $pageObject->getCurrentRecord();
echo $data["custid"];
What am I doing wrong ? Is there any case restriction to the field name ?
Kind Regards

Sergey Kornilov admin 5/5/2016

All field names are case-sensitive. Besides that you are not using the function I suggested.

A
Abhijeet author 5/7/2016



All field names are case-sensitive. Besides that you are not using the function I suggested.


I am sorry, but now I used your below function:-
$data = $pageObject->getMasterRecord();

echo $data["CUSTID"];
Syntax is ok, and I have given this in before add and before edit event in detail table. but still no luck. Is this the after function ? meaning whether it operates while saving record ? or renders value while record is created ? I tried to inline add detail record and the value in detail cell was not prefilled from master cell.
Technology used : Phprunner 8.1 (32 bit), Oracle 11g (32 bit) on local PC connection, Windows 7 (32 bit), XAMPP
Please guide. Thanks.

A
Abhijeet author 5/10/2016



I am sorry, but now I used your below function:-
$data = $pageObject->getMasterRecord();

echo $data["CUSTID"];
Syntax is ok, and I have given this in before add and before edit event in detail table. but still no luck. Is this the after function ? meaning whether it operates while saving record ? or renders value while record is created ? I tried to inline add detail record and the value in detail cell was not prefilled from master cell.
Secondly, I would like to ask whether we need to assign the value to the detail cell again seperately ? after giving above code ?
Technology used : Phprunner 8.1 (32 bit), Oracle 11g (32 bit) on local PC connection, Windows 7 (32 bit), XAMPP
Please guide. Thanks.