Using RecordRef and FieldNo Instead of dependency to get fields from another extension

samantha73
samantha73 Member Posts: 124

Hi All

We can get fields from another extension by using something like below without delcaring dependency in app.json file. Are there pros and cons with just using recordref vs dependecy. Eitherway if the field is not there second ext wil fail

local procedure TryGetFieldValue(RecRef: RecordRef; FieldNo: Integer; var FieldValue: Text)    var       

FldRef: FieldRef;   

begin       

FldRef := RecRef.Field(FieldNo);       

FieldValue := Format(FldRef.Value);   

end;

No need of below

  "dependencies": [    {    "id": "a5727ce6-368c-49e2-84cb-1a6052f0551d",    "publisher": "ABC",    "name": "ABC PTE",    "version": "5.61.260.271"  }],

Answers