People Picker populates but throws people picker required error

  • 19 October 2020
  • 9 replies
  • 2 views

Badge +5

See the attached screen shot. This was working this morning and all I did was create an a datafield to hold the telephone number and an expression to remove the dashes and replaced the output data for the telephone text box with the new datafield to show the telephone number without any dashes. Now I get this: This was not showing yesterday and this morning before I made the telephone change (which does not work by the way).I undid the telephone rules and it still occurs. Cleared my cache and reopened the designer and it still occurs.

13630i5560A8BCE6F8CF5F.png

 


9 replies

Badge +6

You may try open the view and see if there is code break warning.

or probably smartobject used by picker has a required parameter that not is accepting empty or blank value.

or your formula expression fail to perform because the value is empty (telephone number field)

 

Badge +5

Hi YUDI2,

Thanks for the feedback. No code break warnings on the view. the telephone number is present. I should mention the while the picker populates with the authenticated user it is allowed to change the user as if someone else was filling out the form for the user in EmployeePicker. Therefor there is an On Change rule on the view that has almost identical rules except that instead of the Name Key as the input I put EmployeePicker as the input. It worked like a charm for several days now it throws the error.
 

Badge +6

You may further investigate the issue by checkin’ on debug information.

https://help.k2.com/onlinehelp/k2five/userguide/current/default.htm#Create/Forms/DebuggingForms.htm

 

or it also helpful to output the value using ShowMessageAction.  

https://help.k2.com/onlinehelp/k2five/userguide/Current/default.htm#How-Tos/ShowAMessageAction/HowToUseShowAMessageAction.htm

Badge +5

YUDI2 your second suggestion helped immensely. The Change rule on the view appears to fire “ first” instead of the form initiation rule. This change rule has the circular logic of the input being the value of the EmployeePicker that should have been set in the Initiation Rule. Yet the name value is set correctly in the change rule so it must have got the input from the initiation rule. If doesn’t make sense.I guess the change from the EmplyeePicker being blank to it being the authenticated user is causing the change rule to fire when I don’t want it to fire. Is there a way to prevent the Change rule from firing Until someone deletes what’s in the EmployeePicker and chooses another user.

Badge +6

I think you can use a Flag to control your logic.  You can make use a hidden textbox to store the flag and you use it for your checking in change rule.

Badge +5

YUDI2 Thanks for the feedback. Can you explain a litter more about using a flag to control the change logic? I have included some screen shots,

The Change Rule, though I think the rule below in the initiation block does fire first an populate the employee name picker The change overwrites it and the app is no longer accepting the Input above with the Error Name is a required field.

 

Badge +6

Maybe you can try to control onchange event firing by:

  1. Add Textbox text, Name it as HIDDENFLAG and you hide the control
  2. On Initiation Event ( where initiation block does fire first an populate the employee name picker),  on the first line, Set HIDDENFLAG textbox value as “LOADING”.   then on the last line set HIDDENFLAG textbox as empty.

          example:

          On Initation event :

          line 1.Transfer data “LOADING” to HIDDENFLAG texbox

                   ....

                   ....

                   …,

          line 5.Transfer data “”  to HIDDENFLAG textbox

 

       3. Modify employeenamepicker onchange event. on the first line, check if value HIDDENFLAG is empty before executing the logic.

 

         example:

         on employenamepicker change event.

         Line 1. If HIDDENFLAG is empty  then execute below 

                             ….. 

                             …..

                             …..

 

This logic will prevent rule on employename picker onchange event to be executed when initiation block does fire picker onchange event when populate employename picker.

Badge +5

Thanks for the instructions YUDI2. I implemented them to the letter but it didn’t work. The first line of the On change block has to be the On Change event. I put the Hidden flag is empty next. I prevented the  block from firing but something about the On Change Rule was always clearing the Employee field. I’m just going to simplify the process, auto fill the submitter name and have the submitter pick the Employee and fill the details from the on change rule. Thanks anyway.

Badge +6
jaswerl wrote:

Thanks for the instructions YUDI2. I implemented them to the letter but it didn’t work. The first line of the On change block has to be the On Change event. I put the Hidden flag is empty next. I prevented the  block from firing but something about the On Change Rule was always clearing the Employee field. I’m just going to simplify the process, auto fill the submitter name and have the submitter pick the Employee and fill the details from the on change rule. Thanks anyway.

I think you should check further the logic that always clearing the employee field and simplified the process also good idea as it works for you.

Reply