Skip to main content
Answer

Reference a field from one entity in a new one

  • April 29, 2025
  • 3 replies
  • 153 views

Forum|alt.badge.img+1
  • Do Gooder (Customer)

Hello, 

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.

  1. Created Entity1 with two columns, viz. Continent and Description. 
  1.  Added some sample data after configuring a new page using Entity1.  
  1. 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).
  1.  After this, when I am creating any new record for Entity2, the system would only allow values entered in Entity1.

 

Hope this will help.

 

Regards

Abdul Rehman

3 replies

asanka1055
Hero (Partner)
Forum|alt.badge.img+9
  • Hero (Partner)
  • April 29, 2025

Hi ​@sacha 

You can find all the details related to entity modeling including association here. https://docs.ifs.com/techdocs/24r2/060_development/027_base_server_dev/010_model/020_entities/

Note: this is for IFS Cloud 24R2


Abdul
Superhero (Partner)
Forum|alt.badge.img+20
  • Superhero (Partner)
  • Answer
  • April 29, 2025

Hi ​@sacha,

Yes, it is possible, and quite simple as well.

Please refer to the screenshots below.

  1. Created Entity1 with two columns, viz. Continent and Description. 
  1.  Added some sample data after configuring a new page using Entity1.  
  1. 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).
  1.  After this, when I am creating any new record for Entity2, the system would only allow values entered in Entity1.

 

Hope this will help.

 

Regards

Abdul Rehman


PhillBronson
Hero (Customer)
Forum|alt.badge.img+11
  • Hero (Customer)
  • December 4, 2025

@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?

Any clarification would be appreciated, thanks!