Hi everyone,
occasionally i get a scripting error when opening a record. the error is shown in the picture below.

The error states, that the getValue()-Function cannot be called because the object is null.
I get the column-control with formContext.getControl('columnname') and check if the returning object exists. Afterwards i call getAttribute().getValue() on the control and the error above appears sometimes. Keyword here is sometimes. Often enough if i reload the record the error doenst show up a second time.
Has anyone experienced a similiar behavior? I appreciate every input i can get on this 🙂
I pasted the code snippet below so you can better understand whats going on.
my.AbgleichStandortMitPreislistenartikelStandort = function (executionContext) {
var formContext = executionContext.getFormContext();
var standortCtrl = formContext.getControl('syn_standort_id');
var preislistenartikelCtrl = formContext.getControl('syn_preislistenartikeln_id');
if (!preislistenartikelCtrl || !standortCtrl) { return; }
var standort = standortCtrl.getAttribute().getValue();
var preislistenArtikel = preislistenartikelCtrl.getAttribute().getValue();
...
}