This topic is locked
[SOLVED]

 Hide Button with Multiple If statements

10/28/2013 8:55:29 AM
PHPRunner General questions
C
CWDATA author

In essence I want to hide a button if Field "Product" Does Not match any one of 8 preset values.
In effect a series of If tests.
Could some kind person advise how this should be done. Below is extract from PHP Manual in which I have altered the If statement to illustrate what I am trying to achieve.
2. Now in the List page: AfterRecordProcessed event add the

following code:
if (($data['Product']!='Calls Only') Or ($data['Product']!='Line Rental']).....etc.........
$record["MyButton"]=true;

This code will only display button if value of field exported equals 1.

C
cgphp 10/28/2013

Did you add the wrappers around the button's code (http://xlinesoft.com/phprunner/docs/hide_buttons_in_some_rows_of_datagrid.htm)?

C
CWDATA author 10/28/2013



Did you add the wrappers around the button's code (http://xlinesoft.com/phprunner/docs/hide_buttons_in_some_rows_of_datagrid.htm)?


Hi Cristian,
Thanks for your reply,
I should probably have been a bit clearer. I haven't tried the above and got an error. I merely wanted to know if I have the coding format right for what is effectively a Multiple If Statement.
Hope that clarifies.
Thanks again,
Carl.

Sergey Kornilov admin 10/28/2013

It would help if you post exact code and exact error message.