In my gridColum, I am displaying an email link, with an envelope-o icon.
However, if the value of the field is empty or null, it's still displaying the icon.
How do I add the if logic to this code to not display the icon if the value of the field is empty or null? I've edited the code below to shorten the field recordtype! info.
a!richTextDisplayField( value: { a!richTextItem( text: { a!richTextIcon( icon: "envelope-o" ), a!localVariables( local!fullString: fv!row['recordType!technicalPointOfContact'], extract( "--beginning--" & " " & local!fullString, "g--", " <" ) ) }, link: a!safeLink( uri: "mailto://" & extract(fv!row['recordType!technicalPointOfContact'], "<",">") ) ) } )
In addition the following code is throwing "Invalid Syntax errors"
link: a!safeLink( uri: "mailto://" & extract(fv!row['recordType!technicalPointOfContact'], "<",">") ), linkStyle: "STANDALONE" <--- invalid syntax??? )
Discussion posts and replies are publicly visible
You really, really, really ought to consider moving this parser to its own expression rule. Trying to have this code hard-coded into a grid like this just makes stuff un-readable, and then of course when you get little errors like this it's also very hard to test.
Great advice. I will create the rule and call it instead. I agree, I don't like all this business happening at the rendering level.
cool - appreciate any "verify answer"s you are available to dish out too, lol. also make sure you don't miss my last reply in the thread above, i gave you a final implementation to try out in your case (plus or minus adjusting certain names etc).
Thank you for your assistance! I'm still a N00b at writing expressions, but I'm learning the ways of SAIL.
Scott Fleming said:I'm still a N00b at writing expressions, but I'm learning the ways of SAIL.
been there - it's rewarding once you can get your head around the seemingly weird structure required.