1 Reply Latest reply on Nov 26, 2020 7:44 AM by Andreas Bühler

    getFieldValue with qualifier in Characteristic Validation expression

    Support Arvato Systems Active Member

      Hi,

       

      is there a way go read the characteristic value of a different Characteristic within a validation expression?

       

      Let's say there are two Characteristics

      • validFrom
      • validUntil

       

      I want to validate that validUntil > validFrom.

       

      But how can I access the validFrom value from the other characteristic?

       

      entityItem.getFieldValue("Product2G.SimpleProduct2GCharacteristicValueLang.Value(validFrom,-1)")

       

      doesn't work. Is there something wrong with the field path or is there a bug when using qualified fields?

       

      Thank for your help.

        • 1. Re: getFieldValue with qualifier in Characteristic Validation expression
          Andreas Bühler Guru

          I just checked the RecordValue object which you have available within the script and this object gives you access to children of the current record, and also to it's parent.

          The problem here is, that in case you need to access a sibling record, and the current record is already at the root level, the getParent method will not return you anything (as there is no parent) and there is no getSibling method (yet).

          You can not use the getFieldValue method as the validation is executed within the UI before the characteristic values have been applied to the detail model of the item, thus it's not even in there.

          Please open a bug issue for this, we need to extend the recordValue object a little bit so you can access the sibling records.

          1 of 1 people found this helpful