Sending an @VGR Command by Itself from a VGR iForm

As you may or may not know, in VGR, you can trigger another VGR iForm by placing an "@VGR=myNextForm" command in your order string. This works great when it's being placed with one or more orders before it, but it seems to have trouble when placing it by itself. For example, if you have an iForm with a number of orders and a trigger for a follow-up iForm, it works great but only if the user chooses one or more order and the iForm. If they choose the iForm and none of the other orders, it throws an error.

The error is along the lines of "unable to open VGR file mynextform^^^.vgr" Up to this point, many sites have gotten around this issue since each of the iForms use a "tracking order" on it so there would always be at least one order. However, since the best practice is to use outlines to do the order tracking, we needed to find a fix for this problem that doesn't involve the newly unecessary tracking order.

There have been some solutions floating around about building an outline for each of the iForms that you'd want to trigger, putting the trigger order as the first (and only) order on the outline, and setting it to "order with previous," but that seemed like a lot of overhead and extra work for me. (For more ideas of how this problem could be addressed, see the forum thread that inspired this blog post on the HEO iForms Google Group)

So I came up with the way to do this without having to build an outline for every one of my iForms. In HEO, there are two orders with the order_type = 's': the "RETURN (29998)" and "EMPTY (29999)" orders. There should be one empty and one return for each facility. I'm not 100% sure what their main purpose is (and I'm still playing around with them), but I know that one of the uses of the empty order is to be placeholders on outlines for remarks and [spacer]s.

I found that if you can find your empty order's OIS, you can order it via VGR and it will ignore it. It won't show up on the ADC pane, it won't show up in the order confirmation screen, and it doesn't go into the orders table of the database. Effectively, it does nothing.

However, you can use it to make sure that there's always an @LOAD_ORDER command in front of your @VGR command. So, for instance, where @VGR=ivfadult would give you the "can't find ivfadult^^^.vgr" error message, if you place the order as @LOAD_ORDER=OIS=290283@VGR=ivfadult (assuming that your EMPTY order's OIS is 290283), then it works just fine.

Scott Morris is available for training, mentoring, troubleshooting, and iForms consulting. Find out more at www.thinkiforms.com

0 comments: