I have created virtual field in Grid and I’m displaying some values in that field.
The below code is working but I want to include the value of grid virtual field along with insert statement. Please advise.
OnScriptInit:
[i] = 0;
[selected] = array();
[vDeducted_StartDate]={Deducted_StartDate};
[vDeducted_EndDate]={Deducted_EndDate};
GRID APPLICATION Run Button onRecord:
$arr=[i];
[selected][$arr]={EmployeeNo};
[i]++;
$Deducted_StartDate = [Deducted_StartDate];
$Deducted_EndDate = [Deducted_EndDate];
if(count([selected]) > 0)
{
$to_copy = implode(’,’,[selected]);
$sql = “INSERT INTO Food_BonDeduction (EmployeeNo, Deducted, Deducted_StartDate, Deducted_EndDate, Accommodat_Emp_IDF) SELECT EmployeeNo, ‘نعم’,’$Deducted_StartDate’, ‘$Deducted_EndDate’, Accommodat_Emp_ID FROM view_newaccommodates WHERE EmployeeNo =’$to_copy’”;
sc_exec_sql($sql);
[selected] = array();
}
========
when working in developping mode it show this window and insert data into Food_BonDeduction table very good
but when working in production mode it does not show any window and insert Deducted_StartDate= 0000-00-00, Deducted_EndDateinto=0000-00-00 into Food_BonDeduction table
Please advise how to add insert value to Food_BonDeduction FROM Grid application virtual field.
Thanks,