Wednesday, 17 October 2018

Get new GUIDs using Aras AML Studio

Requirement: Get  3 new GUIDs, which are not used in Aras Innovator.
Solution:
Open NASH
Ex: http://localhost/innovator/Client/scripts/nash.aspx
Login using admin or root
Under Action select: GenerateNewGUIDEx (Instead of ApplyAML())
Under XML: type below. quantity="3" mean it will return, 3 new GUIDs
<Item quantity="3" />

Thursday, 11 October 2018

Aras Innovator disable a control after save

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

For textbox control:

var myTestField = getFieldByName("test1");

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

For DDL (List Data Type):
var varMyddl = getFieldByName("mydll");

if (varMyddl)
{
    If(varMyddl.value){
        setTimeout(function(){      
            varMyddl.getElementsByTagName("input")[0].disabled = true;   
            varMyddl.getElementsByTagName("button")[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

Tuesday, 9 October 2018

SQL NOT LIKE will not applicable for NULL values

Example:
select * from emp WHERE Name NOT LIKE '%ABC%' --will return only where Name not like %ABC%, but will not return where Name is NULL

select * from emp WHERE (Name NOT LIKE '%ABC%' OR Name IS NULL) --will return only where Name not like %ABC% and will return where Name is NULL