Headerless Detail with update grid: How do I check for error on update (PressButton(OK))?

Jeremy Biros

Well Known Member
Headerless Detail with update grid: How do I check for error on update (PressButton(OK))?

I have a headerless detail form that I am using for a pricing import. It has a grid that is based on a work table I created. I have a button called "Accept Import", which calls the OK button and updates the grid data into the work table. Sometimes I get a primary key error, but it continues to process and the error disappears. I would like to stop the update when I encounter this error, but I don't know how to do it. Is there an event that gets called when an update error is encountered?
 
Re: Headerless Detail with update grid: How do I check for error on update (PressButton(OK))?

Jeremy,

I don't know of an event that gets called on an error (in Xe), but you could use ER to check for errors in one of the following Grid Events:

Add Grid Rec to DB - Before
Add Grid Rec to DB - After
Update Grid Rec to DB-Before
Update Grid Rec to DB-After

That's mu AUD0.02. I hope it helps.
 
Re: Headerless Detail with update grid: How do I check for error on update (PressButton(OK))?

Hi Jeremy,

Peter is right, you can use the mentioned event. The After - DB to dtect the error, the Before - DB to suppress subsequent Add/Update.

On the other hand, very strange, that OK executed, while error exist on the form
blush.gif



Now some questions:

Q1.) What kind of application is yours?
A.) Brand New
B.) Modified vanilla
C.) Copied and modified vanilla
D.) Other
tongue.gif


Q2.) Is the Transaction feature turned ON on the Form Properties sheet?

Q3.) Is the Repeat For Grid option turned ON for any event of OK button?

Q4.) Is any Evenet Rule logic attached to the OK button?

Q5.) Do the form issuse any Clear Grid/Control Error system function?

Maybe you can check the errors:
A.) checking SV Error_Status in an IF statement
B.) calling B9800250 Get Error Count BSFN (it returns with integer values for the number of errors and warnings - so create variables based on e.g. on INT01 dd item, instead of a Math Numeric dd item)

Read you later,

Zoltán
 
Back
Top