rsrc Posted October 16, 2010 Posted October 16, 2010 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
TheTominator Posted October 16, 2010 Posted October 16, 2010 (edited) 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, 2010 by Guest
rsrc Posted October 16, 2010 Author Posted October 16, 2010 Set Variable [$mediaID; Value:$$MEDIA_table & "::MEDIA_ID"] Brilliant, thank you!
bcooney Posted October 16, 2010 Posted October 16, 2010 I'm curious how this works. How does FM know which record's ID to grab if you're not on the record?
Recommended Posts
This topic is 5152 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