Announcement

Collapse
No announcement yet.

get value for first id of linked entities

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • get value for first id of linked entities

    Hi,
    I have an entity A that is linked in a Many-To-Many relationship to an entity B.
    When creating a new A, I want to do the following flow:
    - if A has not been linked to any B in the creation form, then A.name is required
    - if A has been linked to at least one B in the creation form, then A.name is not required
    - if A.name is empty and at least one B is linked to the new A, then A.name becomes B[0].name

    I have a problem with the last part.
    here is my formula for A, concatenating 'Bonjour' to the first Id of Bs as a test of validity:

    Code:
    ifThen(name==null && bsIds!=null && array\length(bsIds)>0, name=string\concatenate('Bonjour',bsIds[0]));
    But even with this simple test, bsIds[0] does not return anything.
    Also, I had tried the condition bsNames!=null and array\length(bsNames)>0 but bsNames seems to be empty, compared to bsIds (which means that my next question will be : how to retrieve bsNames[0] instead of bsIds[0] ?)

    Thanks.

  • #2
    Have you solved your problem ? I try to do the same thing

    Comment


    • #3
      In the next version there will be the new function record\findRelatedOne

      Comment

      Working...
      X