I'm trying to grab a list of the Field IDs for all fields in a template that have dynamic field rules. The idea is to maintain a C# list of all the IDs so I can reference them quickly later on without having to search through all the form logic rules each time. Based on the SDK documentation, I've been able to get the following code:
List<long> dFieldIDs = new List<long>(); bool hasDynamicFields=false; if(lfTemplate.HasFormLogicRules){ hasDynamicFields=true; ILFCollection dynFields = (ILFCollection)lfTemplate.GetAllFieldFormLogicRules(); foreach(LFFormLogicRule dField in dynFields){ dFieldIDs.Add(dField.TemplateFieldID); } }
I get an error with the portion of the code trying to cast the GetAllFieldFormLogicRules() result to ILFCollection:
I've checked the references for the script, and it seems to be OK (removed RepositoryAccess, added LFSO90Lib). Has anyone seen this before?