1 Reply Latest reply on Apr 2, 2009 6:59 AM by ttumbles

    Edit button



      Edit button


      HI there i posted a request regarding file locking but as im a newbie I am still a little confused. I have created a layout with only 10 fields. Once the fields have been saved I do not want them to be edited again unless a specific button (i.e edit button) is pressed. Can anyone please assist me in doing this as im confusing myself completely. i need advice on creating the edit button and how to lock the record completely...


      thanks in advance



        • 1. Re: Edit button
             <!--  [if gte mso 9]&gt;&lt;xml&gt; &lt;w:WordDocument&gt;   &lt;w:View&gt;Normal&lt;/w:View&gt;   &lt;w:Zoom&gt;0&lt;/w:Zoom&gt;   &lt;w:PunctuationKerning/&gt;   &lt;w:ValidateAgainstSchemas/&gt;   &lt;w:SaveIfXMLInvalid&gt;false&lt;/w:SaveIfXMLInvalid&gt;   &lt;w:IgnoreMixedContent&gt;false&lt;/w:IgnoreMixedContent&gt;   &lt;w:AlwaysShowPlaceholderText&gt;false&lt;/w:AlwaysShowPlaceholderText&gt;   &lt;w:Compatibility&gt;    &lt;w:BreakWrappedTables/&gt;    &lt;w:SnapToGridInCell/&gt;    &lt;w:WrapTextWithPunct/&gt;    &lt;w:UseAsianBreakRules/&gt;    &lt;w:DontGrowAutofit/&gt;   &lt;/w:Compatibility&gt;   &lt;w:BrowserLevel&gt;MicrosoftInternetExplorer4&lt;/w:BrowserLevel&gt; &lt;/w:WordDocument&gt; &lt;/xml&gt;&lt;![endif]  --><!--  [if gte mso 9]&gt;&lt;xml&gt; &lt;w:LatentStyles DefLockedState=&quot;false&quot; LatentStyleCount=&quot;156&quot;&gt; &lt;/w:LatentStyles&gt; &lt;/xml&gt;&lt;![endif]  --><!--  /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal      {mso-style-parent:&quot;&quot;;      margin:0in;      margin-bottom:.0001pt;      mso-pagination:widow-orphan;      font-size:12.0pt;      font-family:&quot;Times New Roman&quot;;      mso-fareast-font-family:&quot;Times New Roman&quot;;} @page Section1      {size:8.5in 11.0in;      margin:1.0in 1.25in 1.0in 1.25in;      mso-header-margin:.5in;      mso-footer-margin:.5in;      mso-paper-source:0;} div.Section1      {page:Section1;}   --><!--  [if gte mso 10]&gt; &lt;style&gt; /* Style Definitions */ table.MsoNormalTable      {mso-style-name:&quot;Table Normal&quot;;      mso-tstyle-rowband-size:0;      mso-tstyle-colband-size:0;      mso-style-noshow:yes;      mso-style-parent:&quot;&quot;;      mso-padding-alt:0in 5.4pt 0in 5.4pt;      mso-para-margin:0in;      mso-para-margin-bottom:.0001pt;      mso-pagination:widow-orphan;      font-size:10.0pt;      font-family:&quot;Times New Roman&quot;;      mso-ansi-language:#0400;      mso-fareast-language:#0400;      mso-bidi-language:#0400;} &lt;/style&gt; &lt;![endif]  -->

          Define two fields:


          Field                Type                            Options

          CTS                 Timestamp                    Creation Timestamp

          Edit                  Text                             Global storage


          In each field definition that you want to lock and unlock, in the Options portion check Validate by Calculation.  Enter the following calculation:


          If ( Edit = "Y";

          Edit = Edit;

          CTs = Get ( CurrentTimeStamp ))


          Place the “EDIT” field on your layouts and make it as “Y” or “N” checkbox field. **

          It can go in the body or the header or wherever you want it.



          How does this work??


          [ If Edit = “Y”]

          The validation calculation asks if you want to unlock the field  (make it editable).

          [Edit = Edit; ]

           Edit is always gong to equal edit no matter what it’s value so if you’ve set the field “Edit” to “Y”, the field is validated and you can change it at will.

          [CTs = Get ( CurrentTimeStamp ))]

          The timestamp at record creation (CTs) is never going to equal the current timestamp even one second after record creation.  The field will not be validated and therefore you cannot edit it…………..the field is locked.


          **There are probably dozens of ways to accomplish this. The idea is that you choose a “Y” if you want the fields editable and choose a “N” if you want them locked and not editable.  You could create a button that ran a script that changed the value of “EDIT” to the opposite of what it currently is set at…………..”Y” or “N”.