I'm working on something in IFS Cloud using Developer Studio and could use some advice on linking two custom entities.
I've got entity1 with a field called field1, and I want to create entity2 with a field that lets users pick a value from entity1.field1 when they're making a new entity2 record.(like a dropdown or lookup to select an existing field1 value)
What's the best way to set this up in Developer Studio? Any pointers on using associations or foreign keys for this kind of thing in IFS Cloud?
Thanks for any help!
Best answer by Abdul
Hi @sacha,
Yes, it is possible, and quite simple as well.
Please refer to the screenshots below.
Created Entity1 with two columns, viz. Continent and Description.
Added some sample data after configuring a new page using Entity1.
Created Entity2 with two columns, viz. Market and Responsible. Market field would refer to the Description field from Entity1, and likewise Responsible field would refer to the Name field from the Person entity (standard entity).
After this, when I am creating any new record for Entity2, the system would only allow values entered in Entity1.
Created Entity1 with two columns, viz. Continent and Description.
Added some sample data after configuring a new page using Entity1.
Created Entity2 with two columns, viz. Market and Responsible. Market field would refer to the Description field from Entity1, and likewise Responsible field would refer to the Name field from the Person entity (standard entity).
After this, when I am creating any new record for Entity2, the system would only allow values entered in Entity1.
@asanka1055 @Abdul is there more information on the LOOKUP(<Entity>) datatype? The documentation isn’t very descriptive for this type.
Looking at the CcCase.entity file I see examples of this type. All of the entities that are looked up appear to have manually implemented all the needed Encode and Decode methods that the referencing entity will require.
I like the idea of using LOOKUP instead of ENUMERATION because it is easier to add new values to the LOOKUP entity in the frontend unlike enumerations in the Cust layer.
What are other benefits of the LOOPUP datatype? When would IFS use a lookup over an enumeration? Are there benefits of defining the LOOKUP in the entity instead of just implementing in the projection with a reference and client with `lov <EntityRef> with <EntitySelector> using <EntitySet>`? Are there code gen properties for an entity that will be used as a lookup that will create the needed Encode and Decode methods? Is it possible to use the `/LIST` syntax with LOOKUP?