Problem mit dem CFL-Wizard
Thomas Faust
Hallo Zusammen,
ich habe folgendes Problem:
Auf einer Standardform eines UDO's habe ich mit dem Wizard ein CFL eingefügt. Der Wizard erstellt eine Optimizer-Rule, die auf das FormLoad-Event reagiert.
Beim Laden der Form kommt es nun zu einem Fehler, der besagt, dass der Item nicht vorhanden sei.
Es liegt eindeutig am pVal Objkt welches zum Zeitpunkt der Regel noch nicht initialisiert ist.
Wenn ich die Regel auf ein anderes Event reagieren lasse (z.B FormActivate), funktioniert es einwandfrei, aber leider wird das CFL dann mehrfach hinzugefügt, und demnach auch mehrfach geöffnet.
Was mache ich falsch, bzw. was kann ich vielleicht anders einstellen ?
Ich bin für jeden Hinweis dankbar.
Viele Grüße
Thomas
// Created by coresuite customize wizard
try
{
// Parameters
string itemUID = "0_U_G";
string columnID = "C_0_1";
string query = "Select U_VerProc, U_VerProcLong from [@PRT_COL_QM_VERPROC] ORDER BY [%ordercolumn] [%order] ";
string writeBackColumn = "U_VERPROC";
// Create CFL and add it to the field
SwissAddonFramework.UI.Dialogs.ChooseFromList cfl =
new SwissAddonFramework.UI.Dialogs.ChooseFromList(
new SwissAddonFramework.UI.Dialogs.ChooseFromList.DefaultSQLQuery(query)
, writeBackColumn
, true
, true
, Matrix.GetFromUID(pVal.Form, itemUID),columnID);
}
catch(System.Exception ex) // Error handling
{
MessageBox.Show("Error while adding the cfl to the field (coresuite customize wizard): " + ex.Message, "OK");
}
// Return value: true if all ok, false if you want SAP B1 to stop proceed
return true;
Paolo Manfrin
Hi Thomas, did yout ry using the FormLoadedEvent instead of FormLoadEvent?
hth
paolo
Thomas Faust
Hello Paolo,
thank you for your reply.
i can't find the FormLoadedEvent but if I use the FormLoadCompleted-Event (-8), Coresuite crashes!
Thanks
Thomas
Paolo Manfrin
Hi Thomas,
which framework version and customize version do you have?
Thanks
paolo
Thomas Faust
Hi Paolo,
The newest :rolleyes:
Framework and Customize is Version 3.90
Thomas
Paolo Manfrin
Ok Thomas,
I will forward your request to support and one developer will check with you.
Regards,
paolo
Thomas Faust
Hi Paolo,
Thank you for your support!
Have a nice Weekend!
Thomas
Paolo Manfrin
HI Thomas,
is the issue solved with the latest version (3.95)?
Thank you for your feedback.
Kind Regards,
paolo
Thomas Faust
Hello Paolo,
i will install the new version 3.96 today evening and then i will test again.
Thank you
Thomas
Thomas Faust
Hello Paolo,
after installing and testing the new version 3.96:
The error, described above, ist not fixed!
regards
Thomas
[attachment=366:Coresuite.JPG]
Anders Olsson
// Created by coresuite customize wizard
try
{
// Parameters
string itemUID = "0_U_G";
string columnID = "C_0_1";
string query = "Select U_VerProc, U_VerProcLong from [@PRT_COL_QM_VERPROC] ORDER BY [%ordercolumn] [%order] ";
string writeBackColumn = "U_VERPROC";
bool cflAdded = false;
pVal.Form.AddHandler_Activate(SwissAddonFramework.UI.Components.ModeComponent.FormModes.ALL, null, delegate(SwissAddonFramework.UI.EventHandling.ItemEvents.FormActivate e)
{
if (!cflAdded)
{
cflAdded = true;
// Create CFL and add it to the field
SwissAddonFramework.UI.Dialogs.ChooseFromList cfl =
new SwissAddonFramework.UI.Dialogs.ChooseFromList(
new SwissAddonFramework.UI.Dialogs.ChooseFromList.DefaultSQLQuery(query)
, writeBackColumn
, true
, true
, TextEdit.GetFromUID(pVal.Form, itemUID));
}
});
}
catch(System.Exception ex) // Error handling
{
MessageBox.Show("Error while adding the cfl to the field (coresuite customize wizard): " + ex.Message, "OK");
}
// Return value: true if all ok, false if you want SAP B1 to stop proceed
return true;
Regards,
Anders
Thomas Faust
Hello Anders,
thank you for this workaround,it work great for me
regards
Thomas
Please close this session as "SOLVED". I can't find that button to do this
Anders Olsson
Hi Thomas,
Thanks for the feedback! Topic closed.
Regards,
Anders
Please sign in to leave a comment.
Comments
0 comments