Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5152 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted (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 by Guest
Posted

I'm curious how this works. How does FM know which record's ID to grab if you're not on the record?

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.