Error in FormLoadedEvent Handling / after upgrade from 3.5 to 3.8
berbericz
Hi Coresuite Experts,I have upgraded Coresuite Country Package from Version 3.5 to 3.8 (running SAP B1 8.82 PL9).
Since this upgrade I receive two error-messages when running my complex freight calculation dependent on zipcode/weight... (function button via coresuite customize).
Technically the result is okay (message box pop ups and the result of calculation is correct, freight charges will be added,...).
The error-message is: "Error in FormLoadedEvent Handling: Form with unique id F_30 not found".
The number behind "F_" will increase with every run.
I use several events in my coding - I suppose the error is related to event-handling.
Below you find one example:
First I open Folder "Logistics" (Item 114 of e.g. Form 139 = Sales Order).
Afterwards I click on [...]-Button (Item 10002101) to open the ship-to-Address Components to get the ZipCode (Column 10000013 of Item 10000003 of Form 13000000).
[CODE]
SwissAddonFramework.UI.Components.Folder.GetFromUID(pVal.Form, "114").Click(SwissAddonFramework.UI.Components.Item.ClickType.Regular);
SwissAddonFramework.UI.EventHandling.ItemEvents.FormLoadEventHandler del_4 = null;
del_4 = delegate (SwissAddonFramework.UI.EventHandling.ItemEvents.FormLoad ev_4){
SwissAddonFramework.UI.Components.Form.RemoveHandler("13000000", SwissAddonFramework.UI.Components.ModeComponent.FormModes.ALL, del_4);
gv_zipcode = Matrix.GetFromUID(ev_4.Form, "10000003").GetValue("10000013", 0);
((SwissAddonFramework.UI.Components.Button) ev_4.Form.Items["10000001"]).Click(SwissAddonFramework.UI.Components.Item.ClickType.Regular);
};
SwissAddonFramework.UI.Components.Form.AddHandler_Load("13000000", SwissAddonFramework.UI.Components.ModeComponent.FormModes.ALL, del_4);
SwissAddonFramework.UI.Components.Button.GetFromUID(pVal.Form, "10002101").Click(SwissAddonFramework.UI.Components.Item.ClickType.Regular);
//MessageBox.Show("zipcode = " + gv_zipcode, "OK");
SwissAddonFramework.UI.Components.Folder.GetFromUID(pVal.Form, "112").Click(SwissAddonFramework.UI.Components.Item.ClickType.Regular);
[/CODE]
Can you help me?
Thank you and best regards,
Gerrit
William Burgos
If there any posibility of you sending us the .cocu file?If you want you can open a support ticket sending an email and .cocu file to support@coresystems.ch
One more suggestion, try using the formloaded event instead of the formload event.
Regards,
William Burgos
berbericz
Hello Mr. Burgos,thank you for your reply. Before I will open a support ticket I would like to test your suggestion: "use formloaded event instead".
Can you please give me a short example (maybe same result of my coding above) by using formloaded events?
Unfortunately I could not find/understand this function in coresuite framework.
Thank you for your help,
Gerrit
William Burgos
Dear berbericz are you available for a remote session? I will be available tomorrow at 10:30am EST (Miami, FL, USA) time.I will like to see the error replicated and I may be able to find a workaround for this issue.
Regards,
William Burgos
berbericz
Hello Mr. Burgos,thanks - yes I'm available for a Remote session tomorrow afternoon (german time).
I will contact you in a separated mail.
Regards,
Gerrit
William Burgos
Forum case has been passed to the support site at helpdesk.coresystems.chJacqueline Wutke
Hi,I have the same problem with a customize rule and the same error message like Gerrit.
If available, could you please post the solution for that problem?
Thanks
Inga Babco
Hallo zusammen,das Problem besteht immer noch mit aktueller Coresuite-Version... :-(
Wenn man in einer Regel ein Fenster im Hintergrund öffnet, etwas im Fenster liest oder schreibt und dann das Fenster (bevor es überhaupt erscheint) durch Klick auf den Button OK schließt (alles programmtechnisch, wie hier oben im Beispiel-Quellcode), dann erscheint rote Statusmeldung [color=#282828][font=helvetica, arial, sans-serif]"[/font][/color]Error in FormLoadedEvent Handling: Form with unique id F_30 not found[color=#282828][font=helvetica, arial, sans-serif]".[/font][/color]
[color=#282828][font=helvetica, arial, sans-serif]Das Fenster wird ja vor dem Event FormLoadCompleted [/font][/color][font="helvetica, arial, sans-serif"][color="#282828"]geschlossen ([/color][/font]durch Klick auf den Button OK).[color=#282828][font=helvetica, arial, sans-serif] Deshalb erscheint die Meldung... Kann man irgendwie nach dem Klick auf den Button OK (zum Fensterschließen) verhindern, dass FormLoadCompleted ausgeführt wird? Oder kann man [/font][/color]
SwissAddonFramework.UI.EventHandling.ItemEvents.FormLoad[color=#ff0000]ed[/color]EventHandler [color=#282828][font=helvetica, arial, sans-serif]statt [/font][/color]
SwissAddonFramework.UI.EventHandling.ItemEvents.FormLoadEventHandler benutzen?
FormLoad[color=#FF0000]ed[/color]EventHandler steht aber nicht zur Verfügung... :-(
Wir haben mehrere Regeln bei mehreren Kunden, die nach dem letzten Coresuite-Update diese Fehlermeldung auswerfen. Vor dem Update hat alles wunderbar funktioniert :-(
William Burgos
Able to replicate the rule. Error message: "Error in FormLoadedEvent Handling: Form with unique id F_## not found" appears on status bar, where ## is a number.My conclusion is that since the FormLoad event loads the form but not show the form the SDK errors when the code try to read the matrix.
My suggestion is to use the following work around:
string gv_zipcode = "";
SAPbouiCOM.Form gv_form = null;
Folder.GetFromUID(pVal.Form, "114").Click(SwissAddonFramework.UI.Components.Item.ClickType.Regular);
Button.GetFromUID(pVal.Form, "10002101").Click(SwissAddonFramework.UI.Components.Item.ClickType.Regular);
gv_form = SwissAddonFramework.B1Connector.GetB1Connector().Application.Forms.ActiveForm;
SAPbouiCOM.Matrix mtx = (SAPbouiCOM.Matrix) gv_form.Items.Item("10000003").Specific;
SAPbouiCOM.EditText edttxt = (SAPbouiCOM.EditText) mtx.Columns.Item("10000013").Cells.Item(1).Specific;
gv_zipcode = edttxt.Value.ToString();
gv_form.Items.Item("10000002").Click(SAPbouiCOM.BoCellClickType.ct_Regular);
Folder.GetFromUID(pVal.Form, "112").Click(SwissAddonFramework.UI.Components.Item.ClickType.Regular);
MessageBox.Show("zipcode = " + gv_zipcode, "OK");
Anders Olsson
Hi everyone,Just a quick update:
This error happens when trying to close a form in the FormLoad event. The reason this error suddenly appeared was the inclusion of the new FormLoadCompleted event in customize. That event is processed AFTER FormLoad and expects a valid form.
The workaround for now is to use the FormLoadCompleted event instead of FormLoad if you want to close the form after it has been loaded.
We will fix this in the next customize version so that an exception is not thrown if the form has been closed before FormLoadCompleted is processed.
Kind Regards,
Anders Olsson
0
Please sign in to leave a comment.
Comments
0 comments