AnsweredAssumed Answered

Validation problem with GetFieldName()

Question asked by PeterWagemans on May 29, 2009
Latest reply on May 12, 2015 by TSGal

Summary

Validation problem with GetFieldName()

Description of the issue

When GetFieldName(unrelated occurrence::field) is used in a formula, it causes any formula validation to fail when there is other stuff following in the same formula. The error raised is "Parse Error".This is quite a mouthful. So let me explain with a few examples: 1.  GetFieldName(unrelated occurrence::field) -> OK2.  GetFieldName(related occurrence::field) -> OK3.  GetFieldName(related occurrence::field) & abs ( 1 ) -> OK3.  abs ( 1 ) & GetFieldName(related occurrence::field) -> OK 4.  GetFieldName(unrelated occurrence::field) & abs ( 1 ) -> Parse Error5.  abs ( 1 ) & GetFieldName(unrelated occurrence::field) -> OK "abs(1)" is just the the first thing that comes to my mind ( and in the function list ). In fact any expression will do.  Workaround: 1. relate the unrelated occurrence tot the calculation environment with a dummy relation2. validate the formula3. remove the the relation again4. the formula will continue to work, this also proves that this is just a formula validation issue Being able to obtain the field name of an unrelated occurrence is very much needed for example when constructing SQL statements using myFMbutler DoSQL. The function GetFieldName() provides an abstraction, this is better then providing literal fieldnames because the formula would break if the fields are renamed afterwards. FileMaker Development is aware of this functionality and has already fixed another bug when using unrelated occurrences. 

Outcomes