FC Code not executed when data set in Post Dialog Init

danagin

Member
I'm trying to load data from the Post Diag Init, and the validation code from the form text boxes will not fire. If I put the code that loads the info in a button, then click it after the form loads, the validation code on the form controls does fire.

So heres the deal, we have a custom quote application that we use heavily, we now want to be able call P4210 Sales Order Header from Form Exit on the custom app, and load the data on the quote. As I said above, if I populate from the Post Init, the "Control is Existed", "Control is exited changed"... will not fire for the populated boxes.

I put the load for the data into a button on the form, and click it, it all fires.

If I call the button from Post Init, it does NOT run.

Anyone have an idea how it could be done seemless to the end user, and not require copying all validation code for each control to the post init?
 
Ok, part of what I was experiencing above was a fluke.

My true problem is that the control is exited code does not fire when the control value is set in ER. I.E. load data into textbox from a button, and that textboxes control is exited events will not fire.

I was able to get around this by setting focus on the textbox, then setting it's value:
Set Control Focus(FC Long Address Number)
FC Long Address Number = [VA frm_FetchedSoldTo_AN8]

Now the control is exited for FC Long Address Number will dire.

I still can't call the button from Post Diag Init and have it work....

This *hack* will not work when trying to populate the grid on the next form though. There is no set focus on grid cell option. So I'm still up for ideas....

TIA!
 
Just incase anyone else needs this. I got it working for our needs.

Calling the new button that loads the data in Sales Order Header, did not work. However, simply copying the code from the button and running as the last step on Post Init did work. So the key here was to set focus via Set Control Focus system function. This allowed all of the Control is exited code to execute.

Set Control Focus(FC Long Address Number)
FC Long Address Number = [VA frm_FetchedSoldTo_AN8]
Set Control Focus(FC Long Address Number-Shipto)
FC Long Address Number-Shipto = [VA frm_FetchedShipTo_AN8]
Set Control Focus(FC Long Address Number)

To load the grid on the Sales Order Detail screen, I was able to put this into Post Diag. I was able to get the row is exited code to fire, but not the column is exited. I had to copy some code from column is exited and run it in the code with the post diag.

F56XXXX.Select
F56XXXX.Fetch Next
While SV File_IO_Status is equal to CO SUCCESS
**Run copied colunm is exited code(be sure to change any GC values in code to occur on GB).
Insert Grid Buffer Row(FC Grid, <After Last Row>, <Yes>, <No>, <Yes>, <Yes>, <Yes>)
F56XXXX.Fetch Next
End While
Clear Grid Buffer(FC Grid)
Insert Grid Buffer Row(FC Grid, <After Last Row>, <Yes>, <No>, <Yes>, <Yes>, <No>)
 
Back
Top