How to hide a choice option from list edit,where a business rule is not working

Ramakanth Kandr
Giga Contributor

I am able to hide a choice option on the form using a client script,but not on list edit.
A business rule is not working in this scenario.

7 REPLIES 7

msm4
Mega Guru

This can be done by client script...I dont understand why it is not.


Can you post your script as well..



BR,


Smitha.


Thanks for the responses,but its pretty simple if we use a onCellEdit client script using saveAndClose as a callback function



function onCellEdit(sysIDs, table, oldValues, newValue, callback) {


  var saveAndClose = true;


  //alert('testfirst');


  if (newValue == '1')


  {


  alert('Cannot move back to Open state');


  saveAndClose = false;


  }


callback(saveAndClose);


}





Mark the answer as correct if its helpful


Abhinandan Pati
Giga Guru

HI Ramakanth,



You can write list_edit ACL on that field so that user should not be able to edit through list layout or else make it depended field & define your choice list accordingly.If you make it depended field at dictionary level itself, then there is no need of add/remove option statements in your client script. It will take care of both form & list.



Thanks


Abhinandan


Thanks for the responses,but its pretty simple if we use a onCellEdit client script using saveAndClose as a callback function



function onCellEdit(sysIDs, table, oldValues, newValue, callback) {


  var saveAndClose = true;


  //alert('testfirst');


  if (newValue == '1')


  {


  alert('Cannot move back to Open state');


  saveAndClose = false;


  }


callback(saveAndClose);


}





Mark the answer as correct if its helpful