error using g_useDialogAlwaysList
Posted: 24 Apr 2017
I am attempting to open related for in a dialog but keep hitting this error.
Uncaught ReferenceError: g_useDialogAlwaysList is not defined.
If I declare it I then get
Uncaught TypeError: Cannot read property 'push' of undefined
Any thoughts. What am I missing?
If I can figure this out I will be able to populate the fields on the related forms then return to the correct parent form when done.
When I get it I will need to work this in. Probably in an array format.
Uncaught ReferenceError: g_useDialogAlwaysList is not defined.
If I declare it I then get
Uncaught TypeError: Cannot read property 'push' of undefined
Any thoughts. What am I missing?
If I can figure this out I will be able to populate the fields on the related forms then return to the correct parent form when done.
When I get it I will need to work this in. Probably in an array format.
Code: Select all
var newFormUrl1 = '/sites/CRFs/Lists/Observations/NewForm.aspx?TC=1. Rituxan Consumables Collection&AGName=N/A';
var newFormUrl2 = '/sites/CRFs/Lists/Observations/NewForm.aspx?TC=2. Reconstitution of IV Rituxan in Pharmacy/ Sign-off of Prepared Rituxan Bag&AGName=Rituxin';
var newFormUrl3 = '/sites/CRFs/Lists/Observations/NewForm.aspx?TC=3. Peripheral Access Insertion&AGName=N/A';
var newFormUrl4a = '/sites/CRFs/Lists/Observations/NewForm.aspx?TC=4A. Pre-medication Administration & Agent Name (new task per agent)&AGName=';
Code: Select all
for (var i = 0; i < 14; i++) { //Rows
//alert(i);
var g_useDialogAlwaysList;
var newFormUrl = '/sites/HopeStudies/CRFs/Lists/HTMRI1620%20%20Observations/NewForm.aspx?TC=' + i;
var uri = new URI(newFormUrl);
var url = uri.getLastPathSegment();
[b]g_useDialogAlwaysList.push(url.toLowerCase());[/b]
//Here we replace the standard 'New item' link with our custom link:
$('.ms-list-addnew a').eq(i).attr('onclick', 'NewItem2(event, "' + newFormUrl + '");return false;');
}