Editing read only fields (ACL)

kyren_cooper
Kilo Expert

Hello,

I'm struggling to come up with the best way to accomplish the following.

I have a field on the project table called "Go live date" and I would like to be read only if the field has a date set. If there is no set date then anyone can enter a date but doing this will lock the field out so the date can't be changed.

What I would then like is to allow a designated user with a specific role to be able to change that field whenever needed.

I'm not very good at scripting (still learning) and don't seem to be able to accomplish this using conditions in an ACL.

Does anyone have any suggestions?

Thanks

11 REPLIES 11

NRHinton
Tera Contributor

UI Policies/Scripts sound like what you're looking for! You should be able to right click on the banner of whatever page you're working on and it will be on the drop down menu.



I would take a look at UI Policies first.



Create a UI policy



Create a UI script



find_real_file.png



Edit: Screenshot Added. Spelling/Grammar.


Thank you,



I'm aware of UI policies but I'm not very adverse at the scripting side of things. I did try to accomplish this using the condition builder with no success.


Sadasiva Reddy
Giga Guru

Hi,


(for manual entry)


write onsubmit client script, so that till you save the form you can edit that field.



function onSubmit() {


    //Type appropriate comment here, and begin script below


    if(Go_live_date !='')


{


g_form.setReadOnly('Go_live_date', true);


}



}


Hello,



thank you for this. This is currently what I'm working with



function onLoad() {


  var golive = g_form.getValue('u_go_live_date');


  if ( golive   != '') {


        g_form.setReadonly('u_go_live_date',true);


    }


{


var admin = g_user.hasRole('bc_it_project_admin');


  }


}



I'm attempting to do a role check and if user has the role, the field can be edited if the user doesn't have the role, then it's read only.