That's what I thought you meant from your original post and how I originally tested it but later thought you meant otherwise. In the end I don't think you can pass any ""c"" variables from a script.
But using .Process and setting cInquiryProgram seems to work for me if I change my button to run a PERFORM instead.
Try this:
1. Create a brand new button - point it to MS Script
2. Your script code will have this one line.
MAS_SCR_PFM = ""../SO/SO_RunSOEntryFromHistory.m4p"" ' call it what u want
3. Create a text file in SO folder, save it as SO_RunSOEntryFromHistory.m4p
4. Put something like this in there
coBusiness'GetValue(""SalesOrderNo$"", SO$)
coBusiness'GetValue(""OrderStatus$"", sOrderStatus$)
IF sOrderStatus$ = ""A"" {
cInquiryProgram = isFALSE
oSO = NEW(""SO_SalesOrder_UI"", %SYS_SS)
oSO'Process(SO$)
DROP OBJECT oSO, ERR=*NEXT
oSO = 0
} ELSE {
tmpMessageText$ = ""Not an Active Order "" + SEP + ""Unable to Edit.""
%SYS_SS'UI'MessageBox$("""", tmpMessageText$, tmpMessageOptions$)
}
EXIT