Help converting from 6 to PanX.2-4060

Converting from 6 to PanX10.2. These lines work in 6 but don’t in X.2-4060. Can anyone say how to fix?

Case multer contains "M" Call .RunM* Stop
Case multer contains "A" FirstRecord loop Call .RunM* Until «Exec?» Contains "M*" EndCase 

Also tried numerous versions of below lines, but still get error messages, either Case win no Endcase, If with no Endif, or loop with no endloop.

If multer contains "M" Call .RunM* Stop Endif
If multer contains "A" FirstRecord loop Call .RunM*  Until «Exec?» Contains "M*" Endif

The main problem is that the asterisk looks like you want to multiply something. You should be quoting the name of the procedure.

Call ".RunM*"

instead of

Call .RunM*.

I’'m having another problem in conversion from Pan6 to PanX. A message comes up briefly when the file OrdInvPost Template is opened, saying “Initialize Error (OrdInvPost Template). ObjectAction statement can only be used in a form window.”

There are SuperObjects set up in the .CurrentRecord procedure which is called by the .Initialize procedure, so I tried to research PanoramaX Help, but found only one entry for superobjects - info(“activesuperobjects”), which gives no info on how the handle super objects in PanX.

Any idea where to find more info?

The superobject statement has been renamed in Panorama X, it is now called the objectaction statement. That’s where you’ll find the help for this:

The word superobject will still work, however, you can use either superobject or objectaction.

This is a definite no-no. Please read all the caveats about using the .CurrentRecord procedure. You should definitely NOT put an objectaction statement in the .CurrentRecord code, this falls under the “not ever change the current window or display a dialog or alert” restriction.

Also, as you have discovered, .CurrentRecord may be triggered when a data sheet window is current, or even no window at all (if the windows are all secret). So you definitely cannot send commands to form objects in this procedure.

You could theoretically check to make sure that the correct form was active, and only use the objectaction statement in that case. However, I don’t recommend using objectaction at all in this context. Sending a command to a form object each time the current record changes is not a feature that is supported in Panorama.

You could certainly put an objectaction (or superobject) statement in the code that is triggered when a form is opened. See Form Event Procedures on this help page.