Try this method for passing your list of field references:
List ( GetFieldName ( table::Field1 ) ; GetFieldName ( Table::field2 ) ; .... list as many field references as you need )
then in your custom function, if this list is passed as a parameter named FieldList, you can use:
GetField ( GetValue ( FieldList ; 1 ) )
To access the contents of Table::field1
Note that by using GetFieldName, this expression will continue to work even if you later enter Manage Database and rename a field or a table occurrence.
Thanks for the reply Phil. If that's the cleanest way available, I still find that messy for a Custom Function. But i appreciate the answer, i wanted to make sure there wasnt any method i was forgetting that could achieve what I wanted. To me the whole point of all this work is for creating the neat/tidy and convenient evaluations that you use heavily. To pass fields like the prebuilt functions would be a dream..
Is the option of additional parameters so difficult to add for Filemaker in Custom Functions?
As a fellow user, I'd say it's quite easy using the method that I have described. As a fellow user, changing how this works in custom functions is impossible as this would require Filemaker to make a design change in how the functions work.
But I don't see that this is really necessary if all you are doing is:
creating the neat/tidy and convenient evaluations that you use heavily.
Say your create a "Perimeter" function for irregular triangles, quadrilaterals and pentagons where you want to enter the lengths of each side and return the sum. You can define a custom function like this:
Perimeter (s1 ; s2 ; s3 ; s4 ; s5 )
and to compute the perimeter of a triangle use:
Perimeter ( 3 ; 2 ; 4 ; "" ; "" )
Your right, it would have to change the way Custom Functions work. The more I realize is the more i realize to not even fathom the idea of Optional Parameters. Especially since it seems this issue has only risen when trying to grab Field Names. Im using the work around with List & GetFieldName inside the parameters of the Custom Function.
My function works great and I appreciate the help. Yet im going to walk away disappointed on this one, I have single scripts that will be using the function over 50 times.
Current Function performing
SQLComplex ( List( getFieldName(xJobs::fl_rateWaiting) ; getFieldName(xJobs::fl_rateAxle); getFieldName(xJobs::fl_direction)) ; List( getFieldName(xJobs::division) ; getFieldName( xJobs::status)); List("=" ; "="); List($division; "Active") )
SQLComplex ( xJobs::fl_rateWaiting ;[ xJobs::fl_rateAxle; xJobs::fl_direction]; xJobs::division; [xJobs::status]; "="; ["="] ; $division; ["Active"] )