<?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: Generate random ID</title><link>https://www.infopathdev.com:443/forums/thread/14711.aspx</link><pubDate>Mon, 10 Jul 2006 19:57:15 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14711</guid><dc:creator>fredarwin</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14711.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14711</wfw:commentRss><description>try this:&lt;br /&gt;&lt;br /&gt;Put a button control, go to properties and edit code, put the next code(jscript):&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;XDocument.DOM.selectSingleNode("/myFields/ID").text = Math.random()*1000;&lt;br /&gt;</description></item><item><title>Re: Generate random ID</title><link>https://www.infopathdev.com:443/forums/thread/14710.aspx</link><pubDate>Mon, 10 Jul 2006 14:51:59 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14710</guid><dc:creator>erick-flores</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14710.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14710</wfw:commentRss><description>Ok, now I can see the programming option. I clicked on On Load Event, then I tried putting different lines of code. The field on my ID is called "ID" (I created a db in Access and add a field for each table name: ID). I then drag and drop all the fields from one of my table to the form, so the ID field is in the form. My question is, how do I write this code, where do I put the "ID" name in the code. Is it like: var ID = &lt;br /&gt;new ActiveXObject("Scriptlet.TypeLib").guid.substring( 0, 38); or var ID = System.Guid.NewGuid(); ? is that all the code I need to write? I am so confused, sorry for been such a novice. Thank youu&lt;br /&gt;</description></item><item><title>Re: Generate random ID</title><link>https://www.infopathdev.com:443/forums/thread/14709.aspx</link><pubDate>Mon, 10 Jul 2006 14:25:45 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14709</guid><dc:creator>erick-flores</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14709.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14709</wfw:commentRss><description>Hello, thank you very much for your help. But where do I put this code? Once I had all my data field in the form I tried to go to Tools&amp;gt;Programming but I cant click in any of those options. Where do I need to write that code, and is just a copy-paste or do I need to write something else?</description></item><item><title>Re: Generate random ID</title><link>https://www.infopathdev.com:443/forums/thread/14708.aspx</link><pubDate>Mon, 10 Jul 2006 12:54:44 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14708</guid><dc:creator>fredarwin</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14708.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14708</wfw:commentRss><description>Maybe, u can use this code:&lt;br /&gt;&lt;br /&gt;var value = Math.random()*1000;&lt;br /&gt;&lt;br /&gt;regards,</description></item><item><title>Re: Generate random ID</title><link>https://www.infopathdev.com:443/forums/thread/14707.aspx</link><pubDate>Sat, 08 Jul 2006 04:00:07 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:14707</guid><dc:creator>Kalyan Gaddam</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/14707.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=14707</wfw:commentRss><description>Hello&lt;br /&gt;Welcome to InfopathDev Forums&lt;br /&gt;&lt;br /&gt;You can do this by generating a GUID which will be a unique number&lt;br /&gt;Try reading the links below&lt;br /&lt;a target="_blank" href=http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=2431&gt;http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=2431&lt;/a&gt;&lt;br /&lt;a target="_blank" href=http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=448&gt;http://www.infopathdev.com/forums/topic.asp?TOPIC_ID=448&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;Also you can search for more in the forums by typing GUID in the search box above</description></item><item><title>Generate random ID</title><link>https://www.infopathdev.com:443/forums/thread/12914.aspx</link><pubDate>Fri, 07 Jul 2006 22:05:41 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12914</guid><dc:creator>erick-flores</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12914.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12914</wfw:commentRss><description>Hello all, I am new to this forum and new to infopath&lt;br /&gt;I am trying to generate a random number, that will be place into the ID field, everytime I load a form. So what I mean is when I load the form the random number will show into the ID field and the user finally I want the user to not be able to modify this ID field.&lt;br /&gt;&lt;br /&gt;ANy help pleaseeee I really aprecciatte&lt;br /&gt;&lt;br /&gt;Thank you</description></item></channel></rss>