by Luke Davenport
Using a Yes/No entry in iLogic.
Greetings! Any iLogic users amongst you will know that the standard user input box snippet provided with iLogic is not much cop. The cancel button is misleading, and it can’t actually be used to cancel out of the rule, so it’s a bit of a red herring!
If you need the user to type in an entry of some kind (like a search term for instance) then the Input box is the only (simple) option for you. But on the other hand, if you just want to ask your user ‘Do you want to continue or not?’ then a message box is your best bet. This lets the user pick ‘Yes’ or ‘No’ and is a much more user-friendly format (as you can see in the picture at the top of the page).
Here’s the code to produce a simple ‘Yes’ or ‘No’ dialogue box in iLogic. In this case the rule simply checks whether a couple of iProperties have been entered, but the code can just as easily be used in a more complex iLogic macro rule to enable the user to quit the rule (it’s a useful debugging tool if you want the option to exit out of your rule without running the while lot!)
If iProperties.Value("Project", "Description") = "" Or iProperties.Value("Project", "Stock Number”) = "" Then
Question = MessageBox.Show("Some required information has not been entered" & vbLf & vbLf & "Do you wish to enter this now?" _
If Question = vbNo Then
‘Do whatever you want to do with a ‘No’ selection (in this case exit the rule completely)
'Do whatever you want to do - like showing a form etc
If you look at the code closely, there’s another tip in there – using the ‘_’ (underscore) character allows you to wrap the text to the next line in an iLogic rule, and continue where you left off – this can be particularly useful if you have long lines and allows for much easier editing.
Hope you find this useful!