J
Jan D'Hondt
HI,
In an Infopath application I have to merge infopath xml files from a
sharepoint server. after the merge I want to modify a status field in the
original xml files, so that I know which files have been merged into the new
xml file.
This works fine for upto 5 files, but as soon as I merge more than 5 files
the merging still works, but in my code after I save the merged file, when i
try to modify the status of the original files, I get a jscript error,
stating that a specific xml file is marked as readonly.
The xml file marked as readonly is not always the same file.
This is the code: on the merged form I have a button to submit the new form
and to change the status of the original forms.
function btnPriorMeldingKlachten::OnClick(eventObj)
{
SaveMerged(); // save the new form
Application.ActiveWindow.Close(true);
}
function SaveMerged()
{
var newname = GenerateNewName();
var strUrl = GetFormURI(newname );
if (SubmitFormlib(strUrl))
{
SetOriginalform();
}
}
function SetOriginalform()
{
var objXMLNodes;
var objXMLNode;
var strNumber;
objXMLNodes =
XDocument.DOM.selectNodes("/my:MergeData/my:SingleData/my:FormData/my:IDNumber");
if (objXMLNodes.length > 0)
{
for (var i = 0; i < objXMLNodes.length; i++)
{
if (objXMLNodes(i).text != "")
{
strNumber= GetFormURI(objXMLNodes(i).text);
UpdateForm(strNumber);
}
}
}
}
function UpdateForm(strNumber)
{
var newxdoc = Application.XDocuments.Open(strNumber);
UpdateFlowstateMerged(newxdoc);
newxdoc.Submit();
Application.XDocuments.Close(newxdoc);
}
function UpdateFlowstateMerged(newxdoc)
{
var flowstate =
newxdoc.DOM.selectNodes("/my:MergeData/my:SingleData/my:Flowstate");
var mynode = null;
while ((mynode = acnflowstate.nextNode()) != null)
{
mynode.text = "21";
}
}
After modifying the 1st 4 or 5 original forms, the program halts with the
error message "the form is marked as read-only"
why does it work for the First 4 forms?
cheers
Jan D'Hondt
In an Infopath application I have to merge infopath xml files from a
sharepoint server. after the merge I want to modify a status field in the
original xml files, so that I know which files have been merged into the new
xml file.
This works fine for upto 5 files, but as soon as I merge more than 5 files
the merging still works, but in my code after I save the merged file, when i
try to modify the status of the original files, I get a jscript error,
stating that a specific xml file is marked as readonly.
The xml file marked as readonly is not always the same file.
This is the code: on the merged form I have a button to submit the new form
and to change the status of the original forms.
function btnPriorMeldingKlachten::OnClick(eventObj)
{
SaveMerged(); // save the new form
Application.ActiveWindow.Close(true);
}
function SaveMerged()
{
var newname = GenerateNewName();
var strUrl = GetFormURI(newname );
if (SubmitFormlib(strUrl))
{
SetOriginalform();
}
}
function SetOriginalform()
{
var objXMLNodes;
var objXMLNode;
var strNumber;
objXMLNodes =
XDocument.DOM.selectNodes("/my:MergeData/my:SingleData/my:FormData/my:IDNumber");
if (objXMLNodes.length > 0)
{
for (var i = 0; i < objXMLNodes.length; i++)
{
if (objXMLNodes(i).text != "")
{
strNumber= GetFormURI(objXMLNodes(i).text);
UpdateForm(strNumber);
}
}
}
}
function UpdateForm(strNumber)
{
var newxdoc = Application.XDocuments.Open(strNumber);
UpdateFlowstateMerged(newxdoc);
newxdoc.Submit();
Application.XDocuments.Close(newxdoc);
}
function UpdateFlowstateMerged(newxdoc)
{
var flowstate =
newxdoc.DOM.selectNodes("/my:MergeData/my:SingleData/my:Flowstate");
var mynode = null;
while ((mynode = acnflowstate.nextNode()) != null)
{
mynode.text = "21";
}
}
After modifying the 1st 4 or 5 original forms, the program halts with the
error message "the form is marked as read-only"
why does it work for the First 4 forms?
cheers
Jan D'Hondt