Extend System User Entity

Extend System User Entity

  
Hi!

I´ve extended User Entity by creating a new entity that as an one-to-one relationship with System User Entity.

Now I need to save information from users using both entities. How can I do it? EditRecordList allows having only one Record Definition in its properties...but I´ve got two entities.

Thanks in advance.

Ana
Hi Ana.

Yes in fact EditRecord only has one Record definition in its properties but this record definition can be a composition of more then one Entity.

Let's say you have an edit record on a page that allows to create or edit your users. Then you'd probably have a simple query with the two entities User and ExtendedUser binded by the foreign key you defined. When you select the source record in the EditRecord to be the first one in the query's return record list you'll see that the record definition will be grayed-out but it'll say something like (Join). This means that you can have fields in the EditRecord that are binded to distinct parameter of the different entities in the Record Definition thus meaning you can edit your users by manipulating at the same time the User entity and the ExtendedUser entity.

Notice that when you want to save the information you'll have to do it separately, i.e., calling the User_CreateOrUpdate entity action and the ExtendedUser_CreateOrUpdate action.

Hope this was helpful. Cheers,
André
Hi André!

I´m afraid I' ve just done what you told me and the record definition is not grayed-out. Also it doesn't say something like (Join).

By the way, I'm using OutSystems Express Edition version 4.1.1.8.

Thanks for your help.

Ana
Hi Ana!

When you select the record definition don't you have a Record Editor option? If you select this option you'll be able to select what entities take part in the EditRecord.

Please post a screenshot so that I can better understand your problem.

André
Hi!

By the way, I've just tried the same in version 4.0.1.43 connected to your host onlinedev.outsystems.net and it worked just fine, that is, the value (Join) appeared in the Record Definition.

Ana
Hi André,

Here are the screenshots. I don't want to choose one entity, I' need both entities (User and UserExtraInfo).

I'm new to OutSystems so I don't know if I'm doing something wrong...

Thanks for helping me.

Ana
Hi Ana,

In the dialog shown on your last screenshot you can right click the entities folder to add the entities you'd like.

I don't know if you have, but I also suggest you to consult the service studio help.

Hope this helps.

Keep having fun using OutSystems Platform!
André
Hi André!

Ok. I've just added the entities manually. As in the version 4.0.1.23 I' ve done the same kind of thing and it was automatically done by the platform, I forgot that I could do it manually...

Sorry for bothering you.

Thanks again.

Ana
Hi Ana

Service Studio will automatically fill the 'Record Definition' (and it will be grayed out) only when you set the 'Source Record' property. When you don't set this property, it is not possible to know what is the underlying Edit Record's datatype, so you must define it yourself.

This behavior is the same for version 4.0 and for version 4.1.

If you found some problem related to this behavior in version 4.1, we'd appreciate to know about it. Thank you.
Regards,
António Melo