October 16, 201015 yr Hi there, I'm trying to avoid writing multiple scripts to do the same functions for different tables...and I've run into an issue with trying to use a variable table name in my script. I'm setting the table name in a global variable in a script parameter, then in my script I run into problems with this: Set Variable [$mediaID; Value:GetFieldName($$MEDIA_table and "::MEDIA_ID")] the resulting variable $mediaID = '?' Unfortunately the table name that I need is not the current layout table or I could use Get(LayoutTableName). Does anyone have any suggestions for me? I've been banging my head on it for a bit now... Thanks rori
October 16, 201015 yr Set Variable [$mediaID; Value:GetFieldName($$MEDIA_table and "::MEDIA_ID")] Try Set Variable [$mediaID; Value:GetFieldName($$MEDIA_table & "::MEDIA_ID")] instead. That will address the syntax problem. But I think you may need just Set Variable [$mediaID; Value:$$MEDIA_table & "::MEDIA_ID"] since you are constructing the fully qualified field name directly. If I recall correctly the GetFieldName() function will prefix the field with the current layout's table name which you state is not the case for you. Edited October 16, 201015 yr by Guest
October 16, 201015 yr Author Set Variable [$mediaID; Value:$$MEDIA_table & "::MEDIA_ID"] Brilliant, thank you!
October 16, 201015 yr I'm curious how this works. How does FM know which record's ID to grab if you're not on the record?
Create an account or sign in to comment