iLogic not being logical

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
'When case is master model If master = 0 Then iLogicVb.RunExternalRule("Inca X - System - Hinge Support Arm.txt") 'When case is job specific ElseIf master = 1 Then iLogicVb.RunExternalRule(""&(Left(iProperties.Value("Project", "Part Number"),6))&"-Inca X - System - Hinge Support Arm.txt") End If
I have this rule triggered when the file is opened. In this instance the "master" parameter within the part is set to 1. So it should run the last external rule.
The problem I've got is when the rule runs from opening it tries to run the first external rule that should only run when "master" is set to 0. If I right-click the 'Run Rule' manually I get the same result:
The strange thing is, when I right-click 'Edit Rule' & immediately click OK (without changing any of the code) it runs the correct external rule. After this I can close the file, open it up again and it's works perfectly every time.
For additional info, if I right-click 'Edit Rule', click Cancel & then try to run the rule manually I get the error above. So it's like it only wants to read the value of my "master" parameter correctly after I've ran the rule through the edit rule dialog box! WHY??