Hi InfoPathDev folks,
I have a health and safety form on our SharePoint site which uses qRules' CopyRichText function to copy safety precautions from a health and safety (HSE) knowledgebase which is a standard SharePoint list. We need to use CopyRichText as most of the knowledgebase results contain hyperlinks to further information.
The form and qRules had all been working 100%, until some factors in play at my institution saw my site collection moved to a new location in SharePoint and the name of the HSE knowledgebase changed. After reworking my formulas to reference the new name of the HSE knowledgebase some instances of qRules work, while others do not. There are differences between the ones that work and the ones that don't, but both worked fine before the name change - strangest of all, everything works in preview mode in InfoPath.
The form interacts with the knowledgebase in four places:
1. On form load, using qRules finishedLoading, a set of general safety precautions is copied from the HSE knowledgebase to the form's general safety precautions field. This works, using this code:
CopyRichText /dsnamesrc=HSE knowledge base /xpathsrc=/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Controls[../d:Title ='General Precautions'] /xpathdest=/my:AssessmentDetails/my:GeneralSafety
2. The form has a repeating section for users to add specific risk events. A drop-down box within the repeating section is populated from the titles of the entries in the HSE knowledgebase. The population works.
3. When a user selects a risk type from the drop-down, three things should happen, but only one does:
3a. The title of the risk type should be copied from the HSE knowledgebase to the title field of the repeating section. This does not work. The code looks like (and is underlined in InfoPath):
concat("CopyRichText /dsnamesrc=HSE knowledge base /xpathsrc=/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Title[../d:Title ='", ., "'] /xpathdest=/my:AssessmentDetails/my:RiskAssessment/my:Risk_Assessment[", count(preceding-sibling::Risk_Assessment) + 1, "]/my:RiskItem")
3b. The control measures for that particular risk should be copied from the HSE knowledgebase to the control measures section of the repeating section. This does not work. The code looks like (and is underlined in InfoPath):
concat("CopyRichText /dsnamesrc=HSE knowledge base /xpathsrc=/dfs:myFields/dfs:dataFields/d:SharePointListItem_RW/d:Controls[../d:Title ='", ., "'] /xpathdest=/my:AssessmentDetails/my:RiskAssessment/my:Risk_Assessment[", count(preceding-sibling::Risk_Assessment) + 1, "]/my:RiskControl")
3c. The risk level sets a drop-down box to the risk level associated with that risk type in the HSE knowledgebase. This works.
I created a new form library and made my risk form template the default content type for the library and the issue persists there. I've been banging my head against this problem for a few days now and I can't seem to crack it. Do any of you wizards here have any thoughts?
Thanks!