Typically when you open a form from DBXL and re-submit it, your modified form will be saved on top of the one you opened. This is a very useful feature, and undoubtedly what you want to do most of the time, but sometimes you will want to save a new copy of a form and leave the original one unchanged. This short tutorial will teach you how to do that.
The DBXL PI
When you open a form from DBXL, the form's XML will have an XML Processing Instruction (PI) embedded in it. This PI contains the form's DocId, and some other information, and when you re-submit the form, DBXL reads this and knows which form to overwrite.
Therefore, if you remove this PI, DBXL will treat the form as a new document, and will save it as a new form, instead of overwriting the original. Below are two methods for removing this PI.
Using qRules
qRules includes a command to remove the DBXL PI from an XML form. Just use this simple command:
RemoveDbxlPi
Using Code
If you would prefer to use code, you can use the following short snippet to locate the DBXL PI, and remove it if it is present:
const string piXPath = "/processing-instruction()[name() = 'QdabraDBXL']";
XPathNavigator pi = MainDataSource.CreateNavigator().SelectSingleNode(piXPath);
if (pi != null)
{
pi.DeleteSelf();
}
Once you have used one of the two above methods, your form should be submitted as a new document the next time you submit it.