Setting Warning Message P42101

eriley

Active Member
I have added a new column to the subform P421002, Detail, and what I would like to do is have it issue a warning when they click the Submit and Close button if the field is blank. This will allow then to verify that they want this field left blank. I see in the submit order hidden button on the P42101 there is a system function, Get Warning Count, and think this is where the warning would get found. My question is how do I set the warning so the parent form will recognize the warning about the field being blank?

Hope I explained it correctly.
 
Hello,
This will be quite deep, and perhaps you've already accounted for this, but I can't tell from the post.
In order for the field you've added to the grid to actually make its way to the database, and/or error handlers you'll have to add it to the data structure/mapping link, and into the business functions that write to the database. In the powerform architecture the forms communicate either through the BF cache, or data structures.
If you're using an I/O to move your data to the database your field will not in any way be handled by the natural error handling on the P42101.

Marshall,
JDE E1 9.1
Win/Sql 2008R2
Tools 9.1.0.2
 
The natural error handling works if I understand you. If I set the field to be required and its blank it will turn red and error. What the user would like to happen is only error and turn red once the person clicks the submit and Close or Submit and New buttons. Then have code to manually check to see if the field is blank, then set an error. They want it a required field but to only determine if some is in the field when the user clicks one of the submit buttons.
 
Hi Ed,
In order for this to work you'll need to add your new field to the data structure for the P421002 and then on the P42101, add that field in the mapping link.
Then, from your subform you need to tell the parent the value of that field. From the mapping link you'll have SI variables, you set the SI variable to your GC value. Then use the subform command 'update parent'. You can likely add to an existing notify parent call on line exited changed asynch or somewhere. This tells the parent the value of your field.
Within the parent P42101, on the submit button, you interpret that value and if necessary notify the child and create an error/warning, i.e. if variablexyz = 'null' or 'blank', call system function "notify child"
On the notified by parent event on the subform p421002 you can set an error (set control error system function).
This is kind of glancing over the details, but generally, this will allow you to set errors/warnings on that field from the p42101

Marshall
 
Marshall,

Wanted to thank you for your help. I was able to get the error message to process and work as the user wanted. I appreciate the time you took to help me with understanding how this process worked.

Ed
 
I have another issue pertaining to this. When the user enters multiple lines on the detail grid where the field needing to be required is blank, the error is set for all lines for that column. The issue is if the user fixes one line the current code will clear the error but not determine if the other lines have a blank value. I need the code to read through all grid records and determine if any of the lines have a blank value then set the error. I am having an issue how to do this and where to put the code. Would you be able to help me with this?

I appreciate the help up to this point.
 
Back
Top