Combox in the Pick and Pack manager
Paul Witmond
Hello,I'm trying to create a working Combobox in the pick and pack manager
I have managed to get a working CB but when we press the OK button in the P&P manager we get a fatal error and SAP has crashed.
This is the code :
Dim Combo As SwissAddonFramework.UI.Components.ComboBox = SwissAddonFramework.UI.Components.ComboBox.CreateNew("Combo")
Combo.Top = button.GetFromUID(pval.form, "2").Top
Combo.Width = button.GetFromUID(pval.form, "2").width + 150
Combo.Left = button.GetFromUID(pval.form, "2").left + 150
Combo.Type = SwissAddonFramework.UI.Components.Item.ItemType.ComboBox
pVal.Form.AddItem(Combo)
pVal.Form.Update()
Combo.ValidValues.Add("value 1","1")
pVal.Form.Update()
I think the system is crashing because there is not databinding.
Please help.
Thanks,
Paul
Anders Olsson
Hi Paul,I tried your code but I couldn't reproduce a crash of Business One. I only commented out the three positioning lines as I don't know what 'button' refers to.
I put your code in an Optimizer rule to execute on FormLoad for FormType 80. SAP version 8.8 PL17 (latest).
What's your SAP version? How is the code triggered? Have you added other elements to the form (thinking of the 'button' object)?
Regards,
Anders
Paul Witmond
Hi Anders,The formtype=81 and is loaded on formload
When I select a value from the combobox and then update or OK we have a system crash
Tested on 2007/pl09 and 8.81/pl00
The button refers to the cancel button on the screen
regards,
Paul
Anders Olsson
Hi Paul,I tested your code as is on formtype 81. When I select a value ("1"), the OK button changes from OK to Update. When I click Update, the button changes to OK and when I click it again, the form closes (as expected).
Are you doing something with the combobox value on save that couls cause the crash?
I wonder if this has anything to do with the ComboBox at all. I'm not familiar with the Pick and Pack manager - can you trigger a formmode change to "Update" by changing something in the matrix and test if it would actually crash anyway?
Sorry - I have no good ideas.
Regards,
Anders
0
Please sign in to leave a comment.
Comments
0 comments