AnsweredAssumed Answered

Custom Function { Optional Parameter } HELP

Question asked by JonathonKlassen on Dec 24, 2014
Latest reply on Dec 29, 2014 by JonathonKlassen

Title

Custom Function { Optional Parameter } HELP

Post

Merry Christmas Eve!

I need help! 

Im building a Custom Function that will make executing SQL a breeze and Maintenance Free. The only problem is I need to grab field names using the getFieldName(_) function to make this is all come together. But this function will not work when multiple fields are put into a return separated list.

Example of My Dream;

SQLComplex( targetField ;{ additional targetFields...}; matchField; {additional matchFields...}; comparisons; {additional comparisons..}; values; {additional values...})

but since no optional Parameters are allowed into Custom Functions......

Work Arounds

- Put the list of fields in quotations; Problem; Tedious, makes the whole Custom Function redundant

(This is where i get stupid..)

- Make another Custom Function that takes the fields and returns them into a list of "Field Names",  the voila, put that in any corresponding parameter when needed!  Shouldnt be an issue right?

Nope, wrong..

the only way for me to use getFieldName(_) is by each field having its own separate parameter. DERP.. Its the same problem. I could never succumb to building a CF that looks like this;

SQLFields( field1; field2; field3; field4; field5; field6; field7; field8; field9; field10)

half the time your only using a couple fields..

 

Outcomes