I have certain rules on some fields that get passed to my external DLL and I would like to know how I can apply default value depending on witch alternative layout was found. So I though of doing it in my Rules with the IRulesContext but I do I know which page I'm on. I know to get the name of the layout Name you can go in p_context.Document.Pages.Item(X).MatchedSection (p_context is my object from FC IRulesContext) X would be the current page the rule is called from.
Unless you know of another method to give default value depending on the alternative layout?
Thanks
Comments
4 comments
Hello
You are using the only way to do this.
Because the rule seems to be called twice once it matches the definition and at the end when it merges all the pages into the document I first check if there is more then one page and then get the first page and check MatchedSection.FlexibleAlternativeName to see if it matches and if not because my package starts with another layout I then loop threw the pages and look for my layout and match it.
Hello
IDocument:: Pages.Item(X).MatchedSection property is available not only in rules, but also in event handlers and other FC11 scripts. If you need information about matched layout alternative for a page in a document that is already assembled, you may design your workflow to trigger this check only once, for example in After Document state changed handle (State: Recognized).
Please sign in to leave a comment.