L
Luke Slotwinski
I am having a problem creating an onsaverequest function.
I am not sure how to define a field for the request to define in the save
function.
My Data Source is organized in a folder called Childrens, and the fields are
last, dhmrn, and cdate I want to pull the data that was entered by the user
and use those three fields to generate a filename. however... i do not know
how to define the XDocument.DOM.selectSingleNode (...) Im do not understand
what the syntax inside the ( ) should be.
Code reads :
function XDocument::OnSaveRequest(eventObj)
{
var last1 = XDocument.DOM.selectSingleNode ("//my:last").text;
var dhmrn1 = XDocument.DOM.selectSingleNode ("/:dhmrn").text;
var cdate1 = XDocument.DOM.selectSingleNode ("/:cdate").text;
if (XDocument.IsNew == true || eventObj.IsSaveAs == false)
{
if (eventObj.IsSaveAs == true)
{
XDocument.UI.SetSaveAsDialogLocation("T:\\Lab Micro-Sero
Proc\micro_sendouts\childrens");
XDocument.UI.SetSaveAsDialogFileName(last1 + "_" + dhmrn1 + "_"
+ cdate1);
}
eventObj.IsCancelled = eventObj.PerformSaveOperation();
eventObj.ReturnStatus = true;
}
else
{
XDocument.UI.Alert("The 'Save As' functionality is disabled for
forms that are not new.");
}
Thanks
I am not sure how to define a field for the request to define in the save
function.
My Data Source is organized in a folder called Childrens, and the fields are
last, dhmrn, and cdate I want to pull the data that was entered by the user
and use those three fields to generate a filename. however... i do not know
how to define the XDocument.DOM.selectSingleNode (...) Im do not understand
what the syntax inside the ( ) should be.
Code reads :
function XDocument::OnSaveRequest(eventObj)
{
var last1 = XDocument.DOM.selectSingleNode ("//my:last").text;
var dhmrn1 = XDocument.DOM.selectSingleNode ("/:dhmrn").text;
var cdate1 = XDocument.DOM.selectSingleNode ("/:cdate").text;
if (XDocument.IsNew == true || eventObj.IsSaveAs == false)
{
if (eventObj.IsSaveAs == true)
{
XDocument.UI.SetSaveAsDialogLocation("T:\\Lab Micro-Sero
Proc\micro_sendouts\childrens");
XDocument.UI.SetSaveAsDialogFileName(last1 + "_" + dhmrn1 + "_"
+ cdate1);
}
eventObj.IsCancelled = eventObj.PerformSaveOperation();
eventObj.ReturnStatus = true;
}
else
{
XDocument.UI.Alert("The 'Save As' functionality is disabled for
forms that are not new.");
}
Thanks