<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.aras.com/community/cfs-file/__key/system/syndication/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>Fill a field when the item is locked</title><link>https://www.aras.com/community/f/development/14374/fill-a-field-when-the-item-is-locked</link><description>Hello ALL, Is there any way please to fill a field and save the item when it is locked. I have tried the code below (client method with the event onFormPopulated) without success as the item is saved but keeps the field empty : 
 
 var lock = document</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: Fill a field when the item is locked</title><link>https://www.aras.com/community/thread/4935?ContentTypeID=1</link><pubDate>Fri, 08 May 2020 19:35:28 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:d26b425b-3a81-4eb4-aa89-b427ec56acaa</guid><dc:creator>Gopikrishnan</dc:creator><description>&lt;p&gt;&lt;strong&gt;Hi Mouad&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Below on form populate&amp;nbsp;method might help in this case (This will check whether the document is in edit mode and state = &amp;quot;Preliminary&amp;quot;&lt;/p&gt;
&lt;p&gt;var state = document.thisItem.getProperty(&amp;quot;state&amp;quot;, &amp;quot;&amp;quot;);&lt;br /&gt;if (document.isEditMode &amp;amp;&amp;amp; !aras.isTempEx(document.item)) &lt;br /&gt;{&lt;br /&gt; if (&lt;span&gt;state&amp;nbsp;&lt;/span&gt;=== &amp;quot;Preliminary&amp;quot;)&lt;br /&gt; {&lt;br /&gt; getFieldByName(&amp;quot;&lt;span&gt;_&lt;/span&gt;&lt;span&gt;champ&lt;/span&gt;&amp;quot;).getElementsByTagName(&amp;quot;input&amp;quot;)[0].disabled = false;&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;else&lt;br /&gt;{&lt;br /&gt; getFieldByName(&amp;quot;&lt;span&gt;_&lt;/span&gt;&lt;span&gt;champ&lt;/span&gt;&amp;quot;).getElementsByTagName(&amp;quot;input&amp;quot;)[0].disabled = true;&lt;br /&gt;}&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank You&lt;/p&gt;
&lt;p&gt;Gobikrishnan R&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>