There’s 2 things that are crucial when using FileMaker. Following their logic and syntax.

I once spent an afternoon trying to get some conditional logic to work in a script. All I wanted was… ‘If the user is in finance and at this level, then do this’

So I wrote these script steps…

 

And it didn’t work.

• So I tried the first bit; ‘COMPANIES::Level = “Manager” and it worked ok.
• I tried the second bit; ‘COMPANIES::Dept = “Finance” and it worked ok.

Put them back together and it didn’t work.

• Tried ‘OR’, as sometimes I get confused. Especially when using ‘NOT’, ‘IsEmpty’ or ‘NOT IsEmpty’
• It all worked as expected when using OR.
• Hunted through numerous old files for double conditionals used in scripts.
• Found examples that all worked fine based on ‘AND’
• Tried again – it didn’t work. Corrupt script? • Started with new blank script – it didn’t work.
• Rebooted FileMaker and tried everything again.
• Switched off computer. Went and had a drink. Came back and tried everything again. It still didn’t work.
• Gave up and emailed script round to peers.
• Got instant reply asking why I was trying to concatenate fields in an if step?
• Bing! Light bulb went on. (actually it was a dull thud as I hit my head and exclaimed ‘Duh!’).
• Amended syntax by replacing ‘&’ with ‘and’. Ta Dah!