Set Grid Cell Error flags all cells in the grid's column

Crazy_About_JDE

Crazy_About_JDE

Well Known Member
Set Grid Cell Error flags all cells in the grid\'s column

Hello, all-- This is my first time using the Set Grid Cell Error system function. It is highlighting all the cells in the grid column rather than just the one in error. When I correct the cell, the Clear Grid Cell Error system function only clears the one I corrected while leaving all the other cells in red. What have I missed? Is there a better approach?

Thank you in advance for your consideration.

-Tim


Details
I am adding a warning message to P4210's Sales Order Detail Revisions form W4210A that will appear if the Quantity Ordered (UORG) is greater than 1,000.


Setup
(1) created an error message data item 554210A with Error Level = 2 (Warning)

(2) Added event rules to the grid column's Col Is Exited event to display the message:

If GC QuantityOrdered is greater than "1000"
Set Grid Cell Error(FC Grid, <Currently Selected Row>, GC QuantityOrdered, "554210A")
End If

(3) Added event rules to the grid column's Col Exited & Changed Inline event to clear the message:

If GC QuantityOrdered is less than or equal to "1000"
Clear Grid Cell Error(FC Grid, <Currently Selected Row>, GC QuantityOrdered, "554210A")
End If


Results
Run P4210, add a new order, then type a few lines with valid quantities. When I type 1001 in the quantity ordered and advance to the next column:

(1) The warning message Quantity Exceeds 1,000 correctly appears in yellow text in the status bar

(2) All the cells in the Quantity Ordered column are highlighted red. (This is not desirable.)

(3) When I go back to the cell and change the value to 10 then press Tab, the red color vanishes for the current cell but leaves all the other cells highlighted red, which is also undesirable.


Notes
<ul type="square">[*]The grid column is linked to the business view column UORG
[*]I am not doing any overrides
[/list]
 
Re: Set Grid Cell Error flags all cells in the grid\'s column

weird. and you're sure you have "<Currently Selected Row>" in the Set Grid Cell Error call?
 
Re: Set Grid Cell Error flags all cells in the grid\'s column

Hi Tim,

The other columns in the grid might have edit rules attached to the data dictionary item. This will give error without even adding any event rules or overriding the data dictionary items.

For example, if the grid colum is Document Type (DCT), the value entered must validate against the edit rule defined for that DDI. The edit rule used for DCT is UDC|DT, so if the value entered is not setup in that UDC, you'll get an error.

You can check the Edit Rules of a DDI by going to:
--> Type "DD" in Fast Path
--> Expand the Data Dictionary Design folder and click on Work with Data Dictionary Items
--> Search for the DDI and click Select
--> This will bring up the Data Item Specifications form, and click on Edit Rule tab. There you'll be able to see what Edit Rule has been applied to the DDI.

Becareful NOT to change Edit Rules here for standard JDE DDI's, this will have an impact on other environments as well.

So you might want to change the values for the other columns to be valid values against the Edit Rules.

Hope this helps.

Lynnol
 
Re: Set Grid Cell Error flags all cells in the grid\'s column

lynnol: yeah, but i think tim means that it is the Set Grid Cell Error call that marks the cells (so without the call, the cells are not marked)...
 
Re: Set Grid Cell Error flags all cells in the grid\'s column

Hi Tim

Have you tried this in both the

Grid column's Col Is Exited and column's Col Exited & Changed Inline events?

If GC QuantityOrdered is greater than "1000"
Set Grid Cell Error(FC Grid, <Currently Selected Row>, GC QuantityOrdered, "554210A")
else
Clear Grid Cell Error(FC Grid, <Currently Selected Row>, GC QuantityOrdered, "554210A")
End If

Thanks
Aidy
 
Re: Set Grid Cell Error flags all cells in the grid\'s column

Hi Tim,

First a question, how many times appears the warning message in the message window - with other words, what value do your Warning counter shows? Just out of curiosity.

I do not know, why does the mentioned scenario occur, but here are some suggestion for you.

#1.
Move your error setting logic to one of the Col Exited and Changed or to the Row Exited and Changed event.

#2.
Clearing the error is not required, because if the event executed again, but does not issue the error again, then the error will be cleared automaticaly by the interactive engine.

Let us know, does it solve your strange issue. Thanks.

Regards,

Zoltán
 
Re: Set Grid Cell Error flags all cells in the grid\'s column

zoltan: yeah, "col is exited" wouldn't be my 1st choice either, but i can't imagine that putting it in that event is the cause of the issue. but we'll see.
 
Re: Set Grid Cell Error flags all cells in the grid\'s column

Tim,
Based on your post its better to check the grid thru buffer, set error and display it. You can stuff it in a button and use it before Saving.

Chan
 
Back
Top