The CreatorCon Call for Content is officially open! Get started here.

true/false ui action

nestoracevedo
Mega Contributor

Hello Everyone,

I am creating a UI Action that is dependent on the choice of a checkbox.

When I submit the request, I leave the checkbox unchecked, I want it to go to Schedule status, instead it keeps going to Estimate Approval.

What am I doing wrong?

find_real_file.png

1 ACCEPTED SOLUTION

Can you just try to remove the quotes from false keyword and try, let's see if this helps.


View solution in original post

12 REPLIES 12

Can you post you code here in text? And also post the whole UI action form.



Also check the system log after clicking on that UI action. Looks like u_estimate_approval_needed is not a valid field.



Please mark this response as correct or helpful if it assisted you with your question.

Below I have the code in text, image of the UI Action and image of the field I am referencing.



How do I check the system log?




gs.addInfomessage('My current.u_estimate_approval_needed is -- '+current.u_estimate_approval_needed);
if(current.u_estimate_approval_needed == 'false'){
current.u_sow_status= 'Schedule';
current.update();
action.setRedirectURL(current);
}


else{
action.setRedirectURL(current);
current.u_sow_status= 'Estimate Approval';
current.update();
}



find_real_file.png




find_real_file.png


Ok. Use the below script. And to check the system log, navigate to System Log->All



gs.addInfoMessage('Entering the UI Action')


gs.addInfoMessage('My current.u_estimate_approval_needed is -- '+current.u_estimate_approval_needed);


gs.log('My current.u_estimate_approval_needed is -- '+current.u_estimate_approval_needed);
if(current.u_estimate_approval_needed == 'false'){
current.u_sow_status= 'Schedule';
current.update();
action.setRedirectURL(current);
}


else{


current.u_sow_status= 'Estimate Approval';
current.update();


action.setRedirectURL(current);
}




If you still dont see any message on top, remove the condition and try again



Please mark this response as correct or helpful if it assisted you with your question.

The solution has been found. I had to remove the quotes for false.



However, using your code I got this:



find_real_file.png


Ok.... It was just those quotes.


But the gs functions were few debugging skills for you.



Please mark this response as correct or helpful if it assisted you with your question.