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?

3replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • With 0 (zero) i guess?

    Like
    • Peter Amies
    • Post Hoc Limited
    • Peter_Amies
    • 2 yrs ago
    • Reported - view

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

    Like
    • Daryl
    • Daryl
    • 2 yrs ago
    • Reported - view

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

    Like
Like Follow
  • 2 yrs agoLast active
  • 3Replies
  • 1090Views