Thursday, November 13, 2014

How to tab directly to a non-neighbour field in a grid

Tabbing through default values can get boring if you have to do it a lot. The good news is, with Sage X3 you don't have to do it at all!

Suppose, for example, that you enter Sales orders in the following screen (GESSOH function)


On each row, you enter the product code and then you tab through to the Ordered qty field, accepting the default values for Description, Ship site and Sales unit. This is three tabs too many. Wouldn't it be great if you could just hit Tab once in the Product field and get directly to the Ordered qty field, with the default values appearing as they normally should in the three fields in-between?

Well, here's how to do just that.

You need to create an After change action on the Product field. For the Sales orders, this is the [M:SOH4]ITMREF field. You must open the SOH4 screen in the GESAMK function and create the appropriate action like this:


In your specific processing file SPESOH, in the After change action handler (AM_ITMREF) you must assign a value to the zonsui variable, which contains the next field to be entered. To go to the Ordered qty field on the current line, this value must be QTY(nolign-1). So the AM_ITMREF handler should look like this:

Subprog AM_ITMREF(VALEUR)
Variable Char VALEUR()
zonsui="QTY(" + num$(nolign-1) + ")"
End

After you validate your screen and your entry transactions, you will have the desired effect of tabbing directly from Product to Ordered qty field when you enter Sales orders. And you can use this technique in any other screen you want.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.