Press Button (HC &OK and HC &Cancel) are not working

kiran4hari

kiran4hari

Well Known Member
Hi,

i have a scenario where if i click on a check box (Fix/Inspect with a view) i have to update the table and close the form.
so i have written the code on the Selection Changed event the press button (HC &OK) is not working. its not taking me back to the previous screen, but when i run it in debug mode it is displaying an error (Unable to Override or Read Error).

FYI: i have given the code below, i was able to do this in some other fix/inspect form. let me know if any one of you can help me to come out of this weird problem.

Get User Address Book Number
VA frm_szApprovedUserId_USER -> szUserIdentifier
FC Final Approval By 1 <- mnAddressBookNumber
UNDEFINED X szErrorMessageID
"1" -> cSuppressErrorMessages
Disable Control(FC Final Approval 1)
Enable Control(FC Final Approval 2)
FC Final Approval 1 = "1"
Get Audit Information
UNDEFINED X szUserName
FC Final Approval Date 1 <- jdDate
FC Final Approval Time 1 [HIDDEN] <- mnTime
UNDEFINED X szWorkstation_UserId
Press Button(HC &OK)

if there is no solution i endup recreating the entire form (oh its toooooooo big).................


Regards,
hari
 
Hi Hari,

First some question:

Q#0: What is your release, SP levele and your platform?
Q#1: Is your data updated, just HC OK does not return OR the data also isn't update?
Q#2: What is your "End Form on Add" settings on the Form > Properties > Options panel?
Q#3: Does HC Cancel also not return, am I right?
Q#4: Is there any error on the Form, when you Press HC OK?
Q#5: Do you issue any "Suppress Add or Update" system function in ERs?
Q#6: In which Form Mode does it happen: Add, Update or Copy?

Regards,

Zoltán
 
Here are the answers for your questions.

a#0: Release B7333, SP 22
a#1: If i manually click on HC OK, updates are happening, but through code it is displaying the error.
a#2: "End Form on Add" is not selected, i call this form only for updates.
a#3: Yes even HC Cancel through code is not working.
a#4: no error is coming if i click on HC OK manually.
a#5: "Suppress Add or Update" funcions are not being used.
a#6: the form is being called in update mode.

let me know if i could do anything to solve this problem.

Thanks
hari
 
Hi Hari,

Do you have any logic in any Async event?
Currently I am hurry. Once upon a time I had similar issue, but not exactly the same. That time WhippingBoy helped me with a BSFN prototype code, which press OK after some delay and this delay happens on a separate execution thread. Please, check the archives for this solution and let us know your progress.

Other questions:
Q1.) Is transaction processing is ON on your Form?
Q2.) Is your Form called with Include Transaction option?

Regards,

Zoltán
 
No evenrules in async event,

A1) Transaction processing is not ON
A2) No for the second one
 
Hi Zoltan,

I moved all the code before the Push Button (HC &OK) to OK Button "Button Clicked" event and it is working fine. Is there any specific reason for this.
<font color="red">
Get User Address Book Number
VA frm_szApprovedUserId_USER -> szUserIdentifier
FC Final Approval By 1 <- mnAddressBookNumber
UNDEFINED X szErrorMessageID
"1" -> cSuppressErrorMessages
Disable Control(FC Final Approval 1)
Enable Control(FC Final Approval 2)
FC Final Approval 1 = "1"
Get Audit Information
UNDEFINED X szUserName
FC Final Approval Date 1 <- jdDate
FC Final Approval Time 1 [HIDDEN] <- mnTime
UNDEFINED X szWorkstation_UserId
</font> the above code has been moved to ok button
Press Button(HC &OK)

Can this be the reason "Press Button (HC &OK) is executed parallelly with the code prior to that".. please share your ideas to find the exact reason. it will be really helpful if we get simillar problems.

Thanks,
Hari
 
Zoltan et al,

I have a very similar problem to the one you encountered with this thread.

On the W4210A form, in certain circumstances I am pressing the OK button automatically at the end of the 'Last Grid Record Has Been Read' event. This was working perfectly until we tried a Transfer Order, for which neither the OK nor any other button would work using the 'Press Button' ER System Function, except when the application was debugged.

So then I found the BSFN solution posted by WhippingBoy a few years ago. I have since built a custom BSFN as outlined in the solution, but unfortunately it isn't yet working.

I know the BSFN is running because the OK button is pressed for non-Transfer Orders. But for Transfer Orders it is still ignoring the OK button press other than during debug.

Could it be that the BSFN is not creating a separate thread as instructed?

Any ideas would be MUCH appreciated!

Thanks,

Tim.
 
Back
Top