This topic is locked
[SOLVED]

 hide field on detail page depending of master data

7/9/2016 3:50:19 AM
PHPRunner General questions
H
herveb75 author

Hello

i would like to hide some field, depending of what has been inserted into the master table.

i have tried to store the concerned value of master table into V_SESSION variable so as to use it on detail page without succes :
//on detail add page, onload event: (WEB_SITE is the field in my detail table)

if ( $_SESSION["V_OFFICE"]== 1) {

$("tr[data-fieldname='WEB_SITE']").hide();

}


without success
i have also tried the pageObject.getMasterRecord without success:

(TOURIST_OFFICE is the name of the field into master table, WEB_SITE field in my detail table)
in the onload event of the detailadd page:

var data = pageObject.getMasterRecord();

if ( data("TOURIST_OFFICE") == 1) {

$("tr[data-fieldname='WEB_SITE']").hide();

}


without success
has anyone any idea to to what i want?

romaldus 7/11/2016



Hello

i would like to hide some field, depending of what has been inserted into the master table.

i have tried to store the concerned value of master table into V_SESSION variable so as to use it on detail page without succes :
//on detail add page, onload event: (WEB_SITE is the field in my detail table)

if ( $_SESSION["V_OFFICE"]== 1) {

$("tr[data-fieldname='WEB_SITE']").hide();

}


without success
i have also tried the pageObject.getMasterRecord without success:

(TOURIST_OFFICE is the name of the field into master table, WEB_SITE field in my detail table)
in the onload event of the detailadd page:

var data = pageObject.getMasterRecord();

if ( data("TOURIST_OFFICE") == 1) {

$("tr[data-fieldname='WEB_SITE']").hide();

}


without success
has anyone any idea to to what i want?


Very easy:

In your detail table event (List Page Before Display), use the following

$data = $pageObject->getMasterRecord();

$_SESSION["hide_row"]=$data["V_OFFICE"];

if ($_SESSION["hide_row"]=='1')

$pageObject->hideField("WEB_SITE");


Note: change hide_row with any name you want

H
herveb75 author 7/11/2016



Hello

i would like to hide some field, depending of what has been inserted into the master table.

i have tried to store the concerned value of master table into V_SESSION variable so as to use it on detail page without succes :
//on detail add page, onload event: (WEB_SITE is the field in my detail table)

if ( $_SESSION["V_OFFICE"]== 1) {

$("tr[data-fieldname='WEB_SITE']").hide();

}


without success
i have also tried the pageObject.getMasterRecord without success:

(TOURIST_OFFICE is the name of the field into master table, WEB_SITE field in my detail table)
in the onload event of the detailadd page:

var data = pageObject.getMasterRecord();

if ( data("TOURIST_OFFICE") == 1) {

$("tr[data-fieldname='WEB_SITE']").hide();

}


without success
has anyone any idea to to what i want?


Hello Romaldus

it's perfect! thanks very much for your precious help !