Disabling/Enabling form fields via server side methods

Hi everyone!

I am quite new to Aras Innovator, and getting to know the environment more day by day. Does any of you know how to enable/disable form fields via a serverside method that could be triggered after an item passes a activity on a workflow?

Thanks!

Kind regards,

Balaji

  • Hi Balaji

    You can write a JavaScript method and add to form events to disable / enable field based on state of an item.

    Refer this post : https://community.aras.com/b/english/posts/disable-form-fields/#:~:text=Dropdown%20Fields&text=In%20SP11%2B%2C%20Aras%20introduced%20support,to%20completely%20disable%20the%20dropdown.

    Example Pseudo code (based on state, you can hide fields).

    Event : on Form Populated in form

    Method:

    var itemState = aras.getItemProperty(parent.item, "state");
    alert(itemState);
    if(itemState == "Preliminary")
    {
    // Disabling Fields of type Item. For other data type refer the link
    setTimeout(function(){
    getFieldByName("owned_by_id").getElementsByTagName("input")[0].disabled = true;
    getFieldByName("owned_by_id").getElementsByTagName("button")[0].disabled = true;
    }, 1);
    }
    else
    {
    // Disabling Fields of type Item. For other data type refer the link
    setTimeout(function(){
    getFieldByName("owned_by_id").getElementsByTagName("input")[0].disabled = false;
    getFieldByName("owned_by_id").getElementsByTagName("button")[0].disabled = false;
    }, 1);
    }
    Thank You
  • Thank you so much, Gopikrishnan!

    I happened to notice this blog already and managed to disable/enable the fields listed in there successfully. But it is still seemingly tricky to disable a 'File Item' field for example. The elements I find using the browser console does not seem to match correctly.

    Have you tried disabling File Items?

    Cheers,

    Balaji.