Refuses to save user

I’m experiencing a weird problem that might be a bug (or I may have lost my marbles).

I’m saving employee records in my app, and to any employee, you can add a list of bonus schemes. The bonus scheme is saved to the database just fine, but no matter what I do, it refuses to connect the scheme to a User.

The user is clearly recognized by the group:

And in the debugger, it again confirms that the user is identified. But it refuses to save it:

What am I overlooking here??

What is the field type of Staff Member?

It is User.

Ok, so what is parent group and where does it get it’s data?

Have you added the Workflow error handlers and output the message and code from those to see if it tells you anything? If not, suggest you try that as well.

First off – thanks for helping me out. My frustration ran away with my manners, it seems. I do appreciate it.

The parent group inherits the User from the previous group. The caption shows that First Name of the user throughout the process, so that should prove that the User is correctly inherited, right?

I’m not sure what you mean in the second paragraph. How do I do this?

No worries petter, Just make sure each group is definitely getting data from somewhere, you may find the chain is broken further up somewhere.

On the workflow there are 2 options for looking at errors that may be generated

or

You can use these events to display an alert message, or set a customstate of a text box to then display the error message. That might help diagnose the problem.

This may well be obvious (apologies in advance) … but Is it saving user, but just not displaying the correct primary field ?

Click primary field in the App Data tab of Data and make sure it is email … or whatever you need. I “think” it gets set to email by default, and if there is no email address on the user it might be blank ?

1 Like

I never considered the primary fields, I thought these were purely for the the benefits of table indexing wrt performace. i.e. if there was a particular field you wanted to search against, you could define it as a primary.

I have never messed around with this in anything I have done yet, and where I have needed to reference a user ‘thing’ to another thing ‘user’ type field, I have just done exactly what @petter has done.

In petters screeneshots and narrative, Staff Member field is of type ‘User’ so would have thought it should have just worked.

The only other thing I can think of is the Privacy settings have been changed on the type.

This is probably too novice but was faced with a similar issue:- So I created an hidden field, “prefilled” with the returned objects value then saved normally, also I had to save the primary field i.e the email address as user but saved First and Last Name as a text field

I can’t believe I’m saying this, out of the obviousness of it – but Nigel, you were right. The user was saved all along, but the primary field was not yet filled (it’s a later stage in the form), so it came out blank.

Three days in frustration for what turned out to be so simple :slight_smile:

Well done to @NigelG and glad you got it fixed @petter!

1 Like

I still have the scars from banging my head on the same wall :slight_smile:

2 Likes