This topic is locked

phpcode snippet on list page

2/8/2016 3:11:35 PM
PHPRunner General questions
S
sawanr author

I need to do some match calculation on list page based on list values. so i created a phpcode snippet on list page with value
$record = $pageObject->getCurrentRecord();

$conversion = ($record['no_of_bookings_value']/$record['availability_check_value'])*100;

echo $conversion;
But it gives me error on getCurrentRecord(). I guess, this event can't be used on list page. I wonder what else can I use on list page to get value.

Sergey Kornilov admin 2/9/2016

You cannot access data from code snippet. Code snippet runs once while you have multiple records on the page.
Use 'View as' type Custom for this purpose:

http://xlinesoft.com/phprunner/docs/_view_as__settings_custom.htm
See example #3 for instance.