Hi everyone,
I’m following a Step by Step #10 tutorial to create a related action for my record type. I configured the Create New Related Action dialog as shown in the attached screenshot, but when I test it, I get this error:
Expression evaluation error: Syntax error. Details: Cannot create an identifier with zero length key
I’ve already added a Key value, but the error still appears. I suspect it may be related to the Context expression, but I’m not sure what exactly is wrong.
Has anyone faced this issue before or can point out what I might be missing? Any guidance would be greatly appreciated!
Thanks in advance
Discussion posts and replies are publicly visible
In Context expression, the issue is with the syntax. You're using recordType! and you already referred fields using record, Recommend remove recordType! from line number 4,5 & 6.You're already inside the record type constructor recordType!NA2AMA.Maintenance(), so you just need the field names directly, not the full record type reference again.
Hi amerayanaa709622 , You are trying to construct the record while writing a code like recordName(), so while doing that, you need to include only the fields of the record. You can easily identify the issue yourself because it clearly shows 'recordType!' in the code. Just remove that and mention only the fields of that particular record.
Hi amerayanaa709622,
This error usually happens when you use recordType! in your field names inside the record constructor. Just use the field names by themselves—no recordType! needed. So in your Context expression, remove recordType! from those lines and make sure all required fields have values (not blank).
recordType!
You’re following the right steps! If you’re still getting stuck, share your latest code and we’ll help you fix it. Good luck.