To set fields mandatory before the state can change to 'new'.

Banu1
Mega Expert

Hello,

I want all fields in the planning tab mandatory on before the change request is allow to move out of new. In "New" state nothing is required.

All planning fields are mandatory before the state can change to 'new'.

This task is complete as a Change user if all planning fields are mandatory before the state can change to 'new'

Which is the best practice to proceed with ? also how to do it?

Please give your suggestions.

Thank You!

7 REPLIES 7

prashantnagaral
Kilo Guru

Hi Banupriya,



Help me to understand you requirement. The requirement is to set planning fields   as mandatory when the status is 'NEW' right?



if so, I suggest you to use UI Policies. You can add State == New under "When to apply" and set Mandatory on fields in UI Policy actions.



Hit like, Helpful or Correct depending on the impact of the response



Thanks


Prashant


shloke04
Kilo Patron

Hi,



Write an On Change Client Script on the Change Request table on the State field as below:



function onChange(control, oldValue, newValue, isLoading, isTemplate) {


    if (isLoading || newValue === '') {


          return;


    }


if(newValue == 'The Value you want' && oldValue == "Backend Value of new")


  {


  g_form.setMandatory('field name1',true);


g_form.setMandatory('field name2',true);


  }


    //Type appropriate comment here, and begin script below


   


}



Backend Value of New you can get by right click on the State field and then select Show choice List.



Hope this helps. Mark the answer as corretc/helpful based on impact.



Regards,


Shloke


Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Banu1
Mega Expert

When I click on 'create new' from Change request, state will be in 'new' when I submit the request then my CR will be in 'New' state only.


On Load it should not be displayed as 'mandatory fields'. while submitting the request it should display it as 'mandatory fields'. Then User should be able to fill in & submit the request.



On change will not work for this. Also UI policy/Data policy will not work.


Hi Banupriya,



May I know the issue you are facing from UI Policy? It should work from UI Policy.



Thanks


Prashant