Matrix Updating

Hello,

I have the following code I am using with a matrix object. It is popping up a menu, allowing the user to enter a qty and the subtracts the user entered amount from the database. It is working wonderfully except the matrix updating. It takes a manual refresh to have the values show up. Maybe I am not using the timer code correctly?

local vMenuChoice,vCellClicked,vRecord
vCellClicked=info(“matrixcell”)
vRecord=Array(vSelectedShippingRecord,3,“;”)
popupatmouse “Ship Available?”+cr()+“Enter Qty”,“Ship Available?”,vMenuChoice

If vMenuChoice contains “Enter”
local vShipQty
gettext "Qty To Ship? : ",vShipQty
find JobNumber=vRecord
ShipQty=val(vShipQty)
QtyOnHand=QtyOnHand-val(vShipQty)
TotalDelivered=TotalDelivered+val(vShipQty)
starttimer “pause”,
“code”,{ObjectAction “ShipApprovalMatrix”, “redraw”, “all”, vCellClicked},
“repeat”,1,
“scope”,“window”
rtn
endif

If vMenuChoice notcontains “Enter”
find JobNumber=vRecord
ShipQty=QtyOnHand
TotalDelivered=TotalDelivered+QtyOnHand
QtyOnHand=0
closeactiveobject
starttimer “pause”,
“code”,{ObjectAction “ShipApprovalMatrix”, “redraw”, “cell”, vCellClicked},
“repeat”,1,
“scope”,“window”
rtn
endif

This is a little above my pay grade, but I noticed that “redraw” isn’t listed as a possible object action in the Help files. matrixredrawclickedcell is, though. Also, although as far as I can see you’re using the timer correctly, I’m puzzled about why you need one in there at all. Does your code work as you expect without the timer?

Bill Conable

Steve Middleton

15 July2017 at 3:32 PM

goMiddleton
July 15
Hello,

I have the following code I am using with a matrix object. It is popping up a menu, allowing the user to enter a qty and the subtracts the user entered amount from the database. It is working wonderfully except the matrix updating. It takes a manual refresh to have the values show up. Maybe I am not using the timer code correctly?


Visit Topic or reply to this email to respond.

You are receiving this because you enabled mailing list mode.

To unsubscribe from these emails, click here.

logo

William Conable*, Alexander Workshops, LLC*
| Mobile: 509-270-7492
815 Villard St.
Cheney, WA 99004

www.alexanderworkshops.com

Designed with WiseStamp - Get yours

Hi Bill

Yes, everything works as expected and I did try the matrixredrawclickedcell.

“redraw”,“cell” is definitely a valid command for the matrix object.

Like Bill, I am puzzled as to why you are using a timer. I don’t see any reason why it should be necessary.

Since you are using a timer, I think the problem is the local variable, vCellClicked. That variable only exists in the original procedure – you can’t use it in the timer code. The timer code is a separate procedure, so it doesn’t share local variables with any other procedure, including the procedure where it is defined. So your timer code has an error. However, timer code doesn’t report errors with an alert, because that could easily cause a situation where Panorama locked up because it was generating errors once per second (or whatever the timer frequency is). It should have displayed a notification of the error, but maybe you have notifications disabled, either globally or for just Panorama.

My first choice would be to get rid of the time, and just use objectaction directly. That should be the simplest solution.

If you want to use the timer, you could make vCellClicked into a windowglobal variable. Or, you could embed it into the timer code like this:

"code",{ObjectAction "ShipApprovalMatrix","redraw","cell",}+quoted(vCellClicked),

That would be my second choice.

Hi Jim,

I put the timer in the code when the objectaction did not work. But, as I am taking another look I realize I might have left out a small detail. The matrix is definitely redrawing, what is not updating is a TDO with this formula in it… pattern(val(Array(info(“matrixcelldata”),12,";")),"#,"). The procedure allows a click on a matrix cell, pops up a dialog that allows entry of a value, takes the entered value and adds it to a field. This field is used in the matrix data variable which is the 12th item of the Array(info(“matrixcelldata”)…

Simply put, I am updating a field, rebuilding the Array used as the data for the matrix which ends up being displayed with the formula above. If I manually refresh the matrix it works.

I don’t see any code to rebuild an array. There wouldn’t have to be if the matrix data was an arraybuild( function, or some other array building formula, but you seem to be saying it’s a variable.

Dave,
I am a little embarrassed, you are 100% correct, I was not updating the variable for the matrix.
Thank you for pointing that out.