Is there a way to add an app variable in a grid title. Ie the user selects a ship date, we want the ship date to appear in the title that prints on the pdf
Announcement
Collapse
No announcement yet.
app variable in grid title
Collapse
X
-
Assuming you have a button that once clicked will filter your grid based on the form values
First link an app variable to your gird widgets title "General/Title" then have your button first call a button program "EXNABBTN" that will determine what the title should be and set the app variable. Then do your normal processing...
Comment
-
Okay i got this to work by using the execute script and setting my title in my grid to
[apptitleheader]
however i have another question, not sure if i should create a new post,
but my date shows up as 2021-02-22 and i want it in month day year format.
I am not seeing anything in the execute script to convert it?
var vfrmShipDate = getAppVar('frmShipDate'),
vtoShipDate = getAppVar('toShipDate'),
vfrmSupplyDate = getAppVar('frmSupplyDate'),
vtoSupplyDate = getAppVar('toSupplyDate');
if (vfrmShipDate!=='0001-01-01'){
setAppVar('apptitleheader', 'Work Order For EJ Loose' + '<br>' +
'Ship Date Range: ' + vfrmShipDate + ' ' + vtoShipDate);
}
if (vfrmSupplyDate!=='0001-01-01'){
setAppVar('apptitleheader', 'Work Order For EJ Loose' + '<br>' +
'Supply Date Range: ' + vfrmSupplyDate + ' ' + vtoSupplyDate);
}
Comment
-
You can use an embedded helper to convert the date to month day year. Just need to pass in the date;
Example:
Code:var vfrmShipDate = getAppVar('frmShipDate'), vtoShipDate = getAppVar('toShipDate'), vfrmSupplyDate = getAppVar('frmSupplyDate'), vtoSupplyDate = getAppVar('toSupplyDate'), convertDate = function(d) { return Valence.query.util.Helper.grid.renderDateToMDY(d); }; if (vfrmShipDate!=='0001-01-01'){ setAppVar('apptitleheader', 'Work Order For EJ Loose' + '<br>' + 'Ship Date Range: ' + convertDate(vfrmShipDate) + ' ' + convertDate(vtoShipDate)); } if (vfrmSupplyDate!=='0001-01-01'){ setAppVar('apptitleheader', 'Work Order For EJ Loose' + '<br>' + 'Supply Date Range: ' + convertDate(vfrmSupplyDate) + ' ' + convertDate(vtoSupplyDate)); }
Comment
Comment