Quantcast
Channel: Microsoft Techies
Viewing all articles
Browse latest Browse all 430

Aras Innovator disable a control after save

$
0
0
How to disable a control after save?
Prerequisites: Control property should be required field.
Solution:

Create new Item Type ex: TestItem

Add new properties
Ex: test1, test2 as string data type

Add new JS method: Ex: MyTest

var myTestField = getFieldByName("test1");

var myTestFieldValue = myTestField.querySelector("input[name='test1']").value;
if (myTestFieldValue)
{
    setTimeout(function(){
        myTestField.getElementsByTagName("input")[0].disabled = true;
    }, 1);
}


Open Item Type: TestItem
Under View, open TestItem form
Lock TestItem form
Click on  "Form Event"
Add method by click on +
Search for "MyTest"
Under Event, select "onFormPopulated"

Testing:
Create new item
Enter value for test1
Hit on Save
Now test1 control will be disable


Viewing all articles
Browse latest Browse all 430

Trending Articles