GetFormFromType: Asset Form ID missing?
martinsalo
Hello Forum,
I want to use this function:
SwissAddonFramework.UI.Components.Form.GetFormFromType(FormType , Count);
I want to call the Asset Base Data dialog. What FormType ID does it have?
In this forum is said that on page 279 in the country package pdf would be a table with the IDs, but I dont see the IDs for the Asset Dialogs!?
Thanks
Martin
Edit: I have wrote a script to cycle through the forms. It seems that the asset dialogs are not there? If I remember correctly, this is new in SAP B1 v9. Its not imported into Coresuite?
// This script can be placed in a coresuite rule behind a form like Business Partners.
// It could be startet for example by a click event.
// The Form Ids from 0 to 600 are called with the OpenFormByKey() function.
try {
for (int i = 0; i < 600; i++) {
try {
SwissAddonFramework.UI.Components.Form.OpenFormByKey(i.ToString(), null);
} catch {}
SwissAddonFramework.UI.Components.Form myForm=null;
try {
myForm = SwissAddonFramework.UI.Components.Form.GetFormFromUID(
SwissAddonFramework.B1Connector.GetB1Connector().Application.Forms.ActiveForm.UniqueID);
} catch {}
SwissAddonFramework.UI.Dialogs.MessageBox.Buttons b =
MessageBox.Show("Item: " + i, "Ok", "Stop", SwissAddonFramework.UI.Dialogs.MessageBox.Buttons.Button1);
if (b == SwissAddonFramework.UI.Dialogs.MessageBox.Buttons.Button2)
break;
if (pVal.Form.Value != myForm.Value)
myForm.Close();
}
} catch (Exception ex) {
MessageBox.Show(ex.ToString(), "Ok");
}
Andreas Achleitner
try this
in sap b1
view-> system information or crtl+shift+i
open the form
move the mousepointer over an item in the form
bottom left showes the system information of the item
form=? should be your formtype
as count use -1
martinsalo
As far as I know, this is another kind of IDs.
The Asset Base Data Dialog is ID=1473000075, I have tried, but it doesnt work:
SwissAddonFramework.UI.Components.Form.OpenFormByKey("1473000075", null);
The problem has currently a low prio, because I'm using:
SwissAddonFramework.UI.Components.MenuItem.GetFromUID("16150").Activate();
To open a Asset Base Data Dialog. But the big advantage of the OpenFormByKey() function is that I can start the dialog with an Asset-ID to show at startup.
Please sign in to leave a comment.
Comments
0 comments