0

Script to set reference field to empty

I have a script that attempts to set link a child record to a parent table based on an expression.  If the child record doesn't meet the crieteria, it sets the link to "empty".  Similar to:

if childRecordName = "Test" then
    refParentRecord := 1
else
    refParentRecord := null
end

But the script gives an error stating, "Expression must return a number or record id: null at line ... etc."

How can I set a reference field to Null within a script's If / Else statement?

3 replies

null
    • Ninox partner
    • RoSoft_Steven.1
    • 4 yrs ago
    • Reported - view

    With 0 (zero) i guess?

    • Post Hoc Limited
    • Peter_Amies
    • 4 yrs ago
    • Reported - view

    Oh!  I didnt' even think of that.  Will try.

    • Daryl
    • 4 yrs ago
    • Reported - view

    That worked, btw, thanks! I had the same question.

Content aside

  • 4 yrs agoLast active
  • 3Replies
  • 1171Views