0

Populate a Related field

I need to populate a related selection field (consignee) based on the value previous selected in other selection field (entity). The consignee selection field will have various values available depending on the entity field, but must have "pre-selected" the same value than entity, but available for change if needed.

How can I do that? I tried code in the entity after update trigger but nothing happens. Can someone help me?

5 replies

null
    • Fred
    • 2 yrs ago
    • Reported - view

    Hi Rodrigo

    Can you post your code so we can see what you are doing?

    • Rodrigo_Cuenca
    • 2 yrs ago
    • Reported - view

    Here is my code:

    Consignee := select ENTIDADES where Entidad = Empresa.Entidad;

    where "Consignee" is a selection field, "Entidades" is the table name where both fields are referenced to, "Entidad" is one field in the table and "Empresa.Entidad" is the name of the selection field control that is already changed and the one who has the code on the trigger after update.

      • Ninox partner
      • RoSoft_Steven.1
      • 2 yrs ago
      • Reported - view

      Rodrigo Cuenca Using select functions always gives an array, no matter how many records there are (yes even 1) Using the first() function will give you the right result.

      Consignee := first(select ENTIDADES [Entidad = Empresa.Entidad]);

      Steven

    • Fred
    • 2 yrs ago
    • Reported - view

    When you say "selection field" do you mean a choice/multi field? or dynamic choice/multi field? Or a reference field?

    • Rodrigo_Cuenca
    • 2 yrs ago
    • Reported - view

    They are choice fields.