However, this doesn’t appear to work. What I am doing is passing some data using LFO from the MES Menu to a BAQ Report Form (to fill in the fields automatically). It works the first time, but if I close the BAQ Report Form and try again, it opens the form without the fields filled in. I have to close and re-open MES to get it pass data again.
What is strange is that I have some other code that passes a barcode using LFO from the MES Menu to the Start Production Activity Form, and that works every time.
If I add it to the Report form, I get “1” the first time it is run, and nothing pops up on the second time. It just seems like it won’t even run the custom code…
I dont know that it will make a difference, but it may be worthwhile to move the creation of the lfo into your process so you get a new one every time.
I think in the report. I’d also show a msg to see the state of lfo and it’s context value (ensure they arent null)
Change the caption of your customized report form so you can ensure it is in fact loading the customization.
Or add a msgbox on load
Also, when you tested the rows on the report form, did you do it with no conditions - for example. you didnt place it after:
if(view.Row >= 0) {
or the check for lfo
I tried a MessageBox both at InitializeCustomCode and at BAQReportForm_Load, and it won’t show up. I don’t think the code runs after it’s been run once in a session. It’s bizarre.
I’m not sure how to do that. I don’t have Visual Studio installed, all I have is the Visual Studio Remote Debugger, but it says I don’t have access to configure it.
I’ve reached out to our IT department to get the program installed.
While I wait for VS, I tried adding a timer in InitializeCustomCode(), but that hasn’t worked either. Is there something about the Report form where it needs to be reset or something to allow the code to run again?
My inital though was that there might be additional param rows, however, this seems more like the customization isnt being run at all. Trying a trace might be worthwhile. You can see the calls and the params being sent to make sure everything looks legit.
I did a trace for both cases (working and not working), and can’t find where it’s passing the parameters in either. I did notice that the following Methods did not show up on the trace for the “not working” case: GetClassInformation (fired twice), GetAttributes (fired twice), GetList, GetAvailableDocumentTypes, and
GetReportsThatDefaultToEmfRenderFormat.