Entity Reference on two columns Edit Screen

Entity Reference on two columns Edit Screen

  
Hello everyone out there,

I have a question. On a Specific entity I have another entity reference based on two fields. I have managed the entity reference on show screens. What I want is to make it work on an edit screen. Is this possible, and if yes, how?

Thanks in advance,


Marios
Hi Marios,

If I understand correctly, you "synthesize" an (apparent) reference attribute from two actual attributes - is that the case?

If that is the case, in the case of the edit screen, you would need to feed the edit record a variable that is a JOIN of your actual ENTITY and a structure containing a single attribute (possibly of type Text) that will receive this "meta" reference attribute on submit.

You will need to start by filling in the dropdown with all the possible values that may go into this "meta" attribute on submit. This will depend wildly on how what sort of values these are, but assuming that the combinations of the two real attributes is finite, simply build up a recordlist of possible value+key combinations that you will then break apart in two again on submit.

Then on the Screen Action that handles the submit you would need to "break down" what came in this "meta" attribute into the two components that you would then assign to the two actual ENTITY attributes before you call the CreateOrUpdateENTITY.

Hope this makes any sense :) and helps set you on your way.

Regards,


Miguel

Hello again,

I have a table/entity which has two fields/attributes as its primary key. Call the Entitiy Products and the Primary Key as ProductCategory and SerialNumber. Also there is a field/attribute called ProductDescription
The COMBINATION of the two fields/attributes IS UNIQUE.This table is referenced from an external database and cannot change.

I want to do two things here:
1. Create a List/Edit Screen for this Entity

2. There is a second entity, Faults, which also has those two fields/attributes. What I want is to show, on the Edit Screen (Not Change), the ProductDescription. I have managed to do this on the List/Show Screens, but I don't know how to do it in the Edit Screen.

Please advise on how to do this. Thanks for your assistance.

Regards,

Marios
 

Let me rephrase the question:
Is it possible to have Multiple Attributes As Entity Identifier?

Regards,

Marios

Hi Marios,
It is not possible to set multiple attributes as entity identifier.
You should instead create a single Id as primary key, and add the two fields (ProductCategory and SerialNumber) to that entity. You can then add a Unique index on those two columns (check property "More..." of the entity which allows you to manage the indexes.
Then, on the edit screen, just create a similar query as you've probably did on the Show screen (joining on the two attributes). You can then use the EditRecord to update your entity and show the description from the external entity.
Gonçalo Borrêga wrote:
Hi Marios,
It is not possible to set multiple attributes as entity identifier.
You should instead create a single Id as primary key, and add the two fields (ProductCategory and SerialNumber) to that entity. You can then add a Unique index on those two columns (check property "More..." of the entity which allows you to manage the indexes.
Then, on the edit screen, just create a similar query as you've probably did on the Show screen (joining on the two attributes). You can then use the EditRecord to update your entity and show the description from the external entity.
 
 Hi... Returning again....
Can you please provide me with an example because I coudln't accomplish what you are suggesting?
I tried to create the Id Field, but since this does not exist on the Database (and I cannot change that), I get an error whenever I try to access the Product List Screen...
Also, I can not create a new Index in Service Studio. The "More..." property is read-only.

Please advise accordingly.

Thanks in advance,


Marios