Actions in Views Bulk Operations
Views Bulk Operations come handy when doing bulk operations over a selected list. This is great because it combines the power of views to filter the selection and specific actions to do on each selected entity.
<?php
global $user;
$view = views_get_current_view();
$args = $view->args[0];
if (user_access('create test_report content', $user)) {
$output=l(t('Add new Biochemistry Test '), 'node/add/test-report', array(
'query' => array(
'field_tr_patient_ref' =>$args,vbo-execute Execute a bulk operation based on a Views Bulk Operations (VBO) view.
vbo-list List all Views Bulk Operations (VBO) views, along with the operations associated with each.<?php
$view = views_get_view('view_name');
$view->init();
$view->set_display('default'); // or display id like page_1, block_1
//$view->set_arguments(array('arg_data'));
//$view->set_arguments(array(arg(0),'arg_data2')); // 2nd Argument
$view->pre_execute();
$view->execute();
//print_r($view->result);
drupal_set_message("Field data value: ".$view->result[0]->node_data_field_as_it_appears_in_views_query_sql);
?><?php