innodat Posted December 4, 2007 Posted December 4, 2007 Hi guys, I'm trying to create the simple "let" function to use it in a web-viewer on my layout - any ideas, why it refuses to work? Let( $$CreationDate = Get(LayoutTableName) & "::Creation Date"; $$CreationName = Get(LayoutTableName) & "::Created By"[color:red]; "" ) It keeps telling me there are too many parameters in the function. I'm sure I will feel very silly...
tgilders Posted December 4, 2007 Posted December 4, 2007 Try this instead: Let( [ $$CreationDate = Get(LayoutTableName) & "::Creation Date"; $$CreationName = Get(LayoutTableName) & "::Created By" ]; "" )
innodat Posted December 4, 2007 Author Posted December 4, 2007 Ha! It swallowed it - I thought those braces are optional, but apparently only the curved ones { } Thank you!!
comment Posted December 4, 2007 Posted December 4, 2007 You don't need to define $variables or $$variables in a Let() function. In fact, you shouldn't - unless you have a good reason. This will work just as well: Let( [ creationDate = Get(LayoutTableName) & "::Creation Date"; creationName = Get(LayoutTableName) & "::Created By" ] ; "" )
tgilders Posted December 4, 2007 Posted December 4, 2007 Square brackets are only required if you're defining more than one variable within the Let () function.
innodat Posted December 4, 2007 Author Posted December 4, 2007 (edited) You don't need to define $variables or $$variables in a Let() function. In fact, you shouldn't - unless you have a good reason. I think I do... I'm putting it into a a web-viewer, at the bottom of my list layout I have a calculation field which contains those variables. Upon clicking on a record, it updates the information. Or in other words, the footer displays record info of the active record. Edited December 4, 2007 by Guest
innodat Posted December 4, 2007 Author Posted December 4, 2007 (edited) In fact - this is pretty cool - you can use that technique to highlight records in list-view WITHOUT ANY SCRIPT. Web Viewer: Let( $$RecordHilite = Get(RecordNumber) "" ) Transparent button over Body part with conditional formatting: Get(RecordNumber) = $$RecordHilite If you have the web-viewer cover the entire layout, it forces a refresh of the formatting. Edited December 4, 2007 by Guest
comment Posted December 4, 2007 Posted December 4, 2007 Yes, for this one you do need a variable - although a local one should do. See also: http://www.fmforums.com/forum/showtopic.php?tid/188674/
innodat Posted December 4, 2007 Author Posted December 4, 2007 (edited) Oh wow... didn't realize there was a lengthy discussion about highlighting records on the site. Great thread! And I see your point, and unstored calculation will do the same. I don't need the webviewer for this (record info). Duh! Edited December 4, 2007 by Guest
Recommended Posts
This topic is 6259 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now