How to set an infopath file name by progamming? How to create unique number for every form? RRS feed

  • Question

  • Hi all,

    I'm a newbie here. Recently I came across some ridiculous problems though you guys may easily solve them. (Office 2003)

    Some days earlier, I was going to set an infopath filen ame according to some rules. After I lookuped some reference, I used the js function "XDocument.SaveAs()", and it really worked. Unfortunately, when I used it later, there was something wrong. Every time I clicked the button which is going to make the code run, there was an alert saying "A run-time error has occured.....Permission denied".  Then I found this in infopath SDK:

    "The SaveAs method will return an error if called from a form that is not fully trusted."

    How to set the form fully trusted ? If i simply change the form security level, I can't even open it therefor.

    Second one, I have already found the way to retrieve the unique ID of the sharepoint library, but i've no idea how to avoid the conflict when two people or more are working with it in the same period.  The expected result is like: the number increases form by form, like "1, 2, 3 ...", no jump. Image that several users intend to submit new forms, when the number is supposed to created? what if one of them give up submitting because of something?


    I really need your help, and many thanks in advance!

    Monday, January 10, 2011 10:10 AM