Trying to implement a User extended table
Application Type
Reactive
Service Studio Version
11.10.15 (Build 40206)

Hi. 

I'm trying to extend the User table with some custom fields to complete the profile I need.

I created a UserExtension table with a 1-1 relationship:

        (Organisation is the department/company of the User, which is another regular table.)

I changed the User Detail Screen:

I'm having trouble implementing the Save action of that Screen:


The Revoke/Grant roles in the System User table works well. I'm just having problems writing to the UserExtension table through the UserCreateOrUpdate server action. I added this:

With those parameters:

But I get the following error at runtime:

The INSERT statement conflicted with the FOREIGN KEY constraint "OSFRK_OSUSR_BJ6_USEREXTENSION1_OSSYS_USER_USERID". The conflict occurred in database "LTOHZY023", table "dbo.ossys_User", column 'ID'. The statement has been terminated. 

I know it means I'm trying to send an empty object, but I can't figure which one is badly configured.

Thanks in advance, much appreciated!

Solution

Hi Joël

This happens because the UserExtension Id is probably empty. Try to assign the CreateOrUpdateUser.Id to UserExtensionSource.UserId right after the CreateOrUpdateUser action. This should work.

Kind regards

Thank you so much, Bruno!

I knew it was somewhere like that but I still don't fully integrate the actions parameters and how they are passed.

It will come.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.