It's me again Margaret. 🙂 I'm trying to get a text component to dynamically insert one of two form components into a document template depending on the document's provider. What am I missing? I am not getting anything in my chart note.
{
IF DOCUMENT.PROVIDER == "John Smith" THEN
INSERT_FORM_COMP("Enterprise\Test","Form One") ELSE
INSERT_FORM_COMP("Enterprise\Test","Form Two")
ENDIF
}
Wanna hear me bark like Rin Tin Tin? 😉
I looked in the Help file of Centricity, and the code you were using "INSERT_FORM_COMP", is only to be used in quick text. instead, use the Mel symbol "ADD_FORM_COMP". It should look like the modified example below.
{
IF DOCUMENT.PROVIDER == "John Smith" THEN
ADD_FORM_COMP("Enterprise\Test","Form One") ELSE
ADD_FORM_COMP("Enterprise\Test","Form Two")
ENDIF
}
If you have any other issues, please let me know. this should work fine, but the text components can be very finicky! I was able to use this code in my system, but of course, I had to change the form path to something that actually existed in my environment.
Good luck! and kudos on the Ray Stevens reference. ^_^
Thanks!! It worked... after I added {' at the beginning and '} at the end of the whole statement. Hmm I'll take it though. Even with the possible duplication if the provider is changed. This is just for one provider to beta test a form in production for me anywho. Thanks again!