So I have:
{OPEN_FORM_COMP(
"Enterprise\ALL\Appointment Request", [tab_name])}
In my listbox, and I get nothing any thoughts on how to get this working?
First you need quotes instead of the [tab_name] like below
{OPEN_FORM_COMP("Enterprise\ALL\Appointment Request", "")}
I dont understand what you mean by you have it in your list box, if you want a change in your listbox to open a form you would need to use this in the code panel with additional code and not in the item itself, it will not do anything inside a form field.
So have a function in the listbox to call to OPEN_FORM_COMP?
Im still not entirely sure what you want this listbox to look like or do, but this my guess. You want options in a list box such as "Request Appointment" "Discharge Patient" etc. and you want each click in the list box to do something like open a form component? If so something like this will work, in the listbox make an ordinary choice list, then in the code panel something like this
{OnListBoxChange(DOCUMENT.LISTBOX)}
{fn OnListBoxChange(var){
if match(var,"Request Appointment")>0 then
if match(GET_FORM_LIST(),"Appointment Request")<1 then
OPEN_FORM_COMP("Enterprise\ALL\Appointment Request", "")
endif
endif
return ""
}}
You read my mind, on how I want the listbox to work. Basically a quick way for users to select the next form or the form they want to go to.
Works like a charm , thanks for the help and reading through my confusion.
Thats probably the route you want to take then. Also, Open is the function you use for navigating an encounter where the forms are already present, sounds like what you really want may be the ADD_FORM_COMPONENT()
Seem tho that when theres multiple choices it only will open the last choice.
For example in my list box theres the choice of HPI,History,ROS
when clicking the ROS it will open my ROS form, but when I click the others nothing happens.
Probably a logical error in your code, can you provide it? Also is the listbox set to single selection or not?
Listbox is set to single selection, choices are HPI,Clinical Lists,History.
Code:
{OnListBoxChange(DOCUMENT.LISTBOX)}
{fn OnListBoxChange(var){
if match(var,"HPI")>0 then
if match(GET_FORM_LIST(),"Endo HPI")<1 then
OPEN_FORM_COMP("EnterprisesampleAllEndoHPI", "")
endif
endif
return ""
}}
{fn OnListBoxChange(var){
if match(var,"Clinical Lists")>0 then
if match(GET_FORM_LIST(),"Endo Clinical Lists")<1 then
OPEN_FORM_COMP("EnterprisesampleEndo OVClinical Lists", "")
endif
endif
return ""
}}
{fn OnListBoxChange(var){
if match(var,"History")>0 then
if match(GET_FORM_LIST(),"Endo History")<1 then
OPEN_FORM_COMP("EnterprisesampleEndo OVHistory", "")
endif
endif
return ""
}}
Noit sure why the \ didn't show up, but they're there
The part with the fn is defining the function, you can only define it one way, so the system is only checking one of those, probably the bottom one or the top one, so you need all the code in one. And... when I wrote that I was thinking ADD_FORM not OPEN_FORM so I added the check to see if the form was in the encounter, so you dont need the GET_FORM_LIST thing (I need more coffee though)
{fn OnListBoxChange(var){
if match(var,"HPI")>0 then
OPEN_FORM_COMP("Enterprise\sample\All\Endo\HPI", "")
endif
if match(var,"Clinical Lists")>0 then
OPEN_FORM_COMP("Enterprise\sample\Endo OV\Clinical Lists", "")
endif
if match(var,"History")>0 then
OPEN_FORM_COMP("Enterprise\sample\Endo OV\History", "")
endif
return ""
}}
The other part means evaluate this function when there is a change in one of the arguments (in this case the document variable).
ahhh forgot to change the function name but seeing it under the same function makes much more sense. Thanks again
One other thing, when clicking though the list box switching from form to form, it looks like it highlights a different selection that the one i'm on.
For example, choices are HPI,Clinical lists,History,ROS. I select History (history form appears) but HPI is highlighted and with it being highlight I can't switch back to that one.
Any thoughts?
First thing that comes to mind is just to clear the field after the form jump, since you are returning nothing you should be able to do this
{DOCUMENT.LISTBOX = OnListBoxChange(DOCUMENT.LISTBOX)}
No idea why it would change itself though, you might want to run a trace and make sure its not doing something you didnt intend.