<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: jscript unique ID</title><link>https://www.infopathdev.com:443/forums/thread/67004.aspx</link><pubDate>Wed, 01 Jun 2011 10:56:09 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:67004</guid><dc:creator>Skarn</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/67004.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=67004</wfw:commentRss><description>&lt;p&gt;Using a sig tablet (have no experience) but maybe the sigTablet itself has a uniqueId you can retrieve from the attached device which you could use as the &amp;#39;prefix identifier&amp;#39; in my suggestion below.&lt;/p&gt;
&lt;p&gt;I usually end up going for a datetime stamp and prefixed with some other identifier, like the current logged in userId.&lt;/p&gt;
&lt;p&gt;Other ideas I&amp;#39;ve seen on this forum have been using a central&amp;nbsp;SQL server, or web service to send a uniqueId value to the form on open/submit/save.&lt;/p&gt;
&lt;p&gt;When using date-time stamp I remove the extraneous chars (using&amp;nbsp;xpath translate function)&amp;nbsp;e.g. 2011-05-30T13:10:55 becomes 20110530131055. There is risk of someone else generating the exact same time stamp though which is why I prefix with the other identifier.&lt;/p&gt;</description></item><item><title>jscript unique ID</title><link>https://www.infopathdev.com:443/forums/thread/66178.aspx</link><pubDate>Thu, 28 Apr 2011 03:32:47 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:66178</guid><dc:creator>jaekou</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/66178.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=66178</wfw:commentRss><description>&lt;p&gt;Hello!&amp;nbsp; I created an electronic sign-in sheet with InfoPath and an e-sig lcd tablet.&amp;nbsp; Using jscript code provided by the e-sig tablet vendor I was able to create a jpg of the signature and link it to the document.&amp;nbsp; The problem I&amp;#39;m having now, because the file name is hardcoded into the control (C:\SigImage.jpg), is that the most current SigImage.jpg is being referenced to all the signed documents. &amp;nbsp;&lt;/p&gt;&lt;p&gt;Is there a way in jscript to generate an unique ID using something similar to a now() to give each jpg it&amp;#39;s own unique file name to link back to the form?&amp;nbsp; Here is the code behind my button:&lt;/p&gt;&lt;p&gt;function CTRL1_5::OnClick(eventObj)
&lt;/p&gt;&lt;p&gt;{
	&lt;/p&gt;&lt;p&gt;//This button initiates the tablet for signing&amp;nbsp; &lt;br /&gt;&lt;/p&gt;&lt;p&gt;sigObj.InitSigPlus();&lt;/p&gt;&lt;p&gt;sigObj.OpaqueMode=true;
    &lt;/p&gt;&lt;p&gt;sigObj.TabletState=1;
&lt;/p&gt;&lt;p&gt;} &lt;/p&gt;&lt;p&gt;function CTRL2_5::OnClick(eventObj)
&lt;/p&gt;&lt;p&gt;{
	&lt;/p&gt;&lt;p&gt;//This button is pressed after the tablet is signed, it attaches the image of the jpg to the InfoPath document &lt;br /&gt;&lt;/p&gt;&lt;p&gt;sigObj.TabletState=0;
    &lt;/p&gt;&lt;p&gt;sigObj.ImageFileFormat=4;
    &lt;/p&gt;&lt;p&gt;sigObj.ImageXSize=200;
    &lt;/p&gt;&lt;p&gt;sigObj.ImageYSize=30;
    &lt;/p&gt;&lt;p&gt;sigObj.ImagePenWidth=11;
&lt;/p&gt;&lt;p&gt;    sigObj.JustifyMode=5;
    &lt;/p&gt;&lt;p&gt;sigObj.WriteImageFile(&amp;quot;C:\\SigImage.JPG&amp;quot;);
&lt;/p&gt;&lt;p&gt;    var objField1 = XDocument.DOM.selectSingleNode(&amp;quot;//my:myFields/my:field1&amp;quot;);
&lt;/p&gt;&lt;p&gt;    objField1.text = &amp;quot;C:\\sigimage.jpg&amp;quot;;
&lt;/p&gt;&lt;p&gt;} &lt;br /&gt;&lt;/p&gt;&lt;p&gt;If I could somehow generate an unique ID and pass it as a variable to the WriteImageFile() function and associate it back to objField1.text then I think it might work.&amp;nbsp; I would greatly appreciate any insight, suggestions, advice anybody can spare!&lt;/p&gt;&lt;p&gt;Thanks!&lt;/p&gt;&lt;p&gt;Jimmy &lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>