<?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>Button disable</title><link>https://www.aras.com/community/f/development/3827/button-disable</link><description>hi

how to disable Button , if the item is locked ?

thank you</description><dc:language>ja-JP</dc:language><generator>Telligent Community 12</generator><item><title>RE: Button disable</title><link>https://www.aras.com/community/thread/1821?ContentTypeID=1</link><pubDate>Tue, 17 Jul 2018 07:25:12 GMT</pubDate><guid isPermaLink="false">916d3f7e-8ddc-42f8-8d45-380822f51406:24a9c148-b666-4835-9b11-6b17c07c65d8</guid><dc:creator>AngelaIp</dc:creator><description>Use something like this as &lt;code&gt;onFormPopulated&lt;/code&gt; Event in your Form:

&lt;pre&gt;&lt;code&gt;var isItemNew = aras.isNew(parent.item);
var isItemLocked = aras.isLocked(parent.item);

var myButton = &amp;#039;bDoSomething&amp;#039;;
setFieldVisibilityByName(myButton,(isItemNew || isItemLocked) );

function setFieldVisibilityByName(fieldName, isVisible)
{
	var field = getFieldByName(fieldName);
	if (!isNullOrUndefined(field)) {
		field.style.visibility = (isVisible) ? &amp;#039;visible&amp;#039; : &amp;#039;hidden&amp;#039;;
	}
}

function isNullOrUndefined(obj)
{
	return ((typeof (obj) === &amp;#039;undefined&amp;#039;) || (obj === null));
}&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>