10-22-2010 11:24 AM - edited 03-14-2019 06:44 AM
Hi,
I'm wondering if anyone knows a way to send a variable as a parameter into a custom function.
I have a CF like the following....
Name = userTestFunction()
Parameters = 1
Function = global.userVariable%1%_Test
In my script I want to pass in a value from a database to complete the variable name in the custom function...
userTestFunction(Database.MyDB.MyField)
Ideally I'd like the value returned from the custom function to be something like this...
global.userVariableA_Test (where 'A' is the value of 'MyField' from the DB lookup)
instead the function treats my input as a string instead of variable and returns...
global.userVariableDatabase.MyDB.MyField_Test
I'm not sure Custom Functions support passing a variable, but if anyone has figured out a way to do it, your insights would be appreciated.
Thanks,
Ryan.
10-22-2010 11:41 AM
10-22-2010 11:47 AM
I'm not sure what you mean. %1% is just the place-holder for the parameter w/in the custom function definition.
10-22-2010 12:26 PM
10-22-2010 01:18 PM
The value of the dblookup field (Database.MyTable.MyField) is 'A', but the value of that variable isn't inserted into the %1% parameter, what's put into the parameter is 'Database.MyTable.Myfield'. So, it treats the database lookup field as a string.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide