cancel
Showing results for 
Search instead for 
Did you mean: 

Open UDO form added with B1 Studio

Former Member

Hi,

I've added a UDO form to my AddOn with B1Studio (SAP92) and can't figure out how to open it, within my AddOn.

I know I can use the standard OpenForm to open my UDO but it always opens the standard one, and I want to open the version I added with B1Studio, since it contains small changes I needed (fields change and simple event validations).

Is there any way to open my UDO form, from my AddOn?

I always get the strange error message "System form should create by framework" I get, when try to open the form in my AddOn with:

UDOForm1 pForm = new UDOForm1();

Please help!

JC

Accepted Solutions (1)

Accepted Solutions (1)

former_member233854
Active Contributor
0 Kudos

Export to a XML file and use Application.LoadBatchActions(xmlString) to open your form

Former Member
0 Kudos

I don't think that is a valid solution for the problem, neither to take advantage of B1Studio capabilities.

Additionally, there is another solution I prefer: add a User form in B1Studio, and map it to automatically manage my UDO, and we always have done in the past.

I'm sure SAP team have a solution for this problem, otherwise it doesn't make sense to build this functionality with no objective.


Thanks,

JC

former_member183373
Active Participant
0 Kudos

Hello Joao,

I always add UDO form to main menu via Object Registration Wizard. and don't use code. This way I never had a problem opening UDO form and I can suggest you to do the same. But if you want to open a UDO form by code you should use Activate() not Show()

I am not sure how your code looks like but you should make a change similar to one below;

                       

if (pVal.BeforeAction && pVal.MenuUID == "SBOAddonProject34.UDOForm1")

{

                    Form1 activeForm = new Form1();

                    activeForm.Show();

  

                                  

To   

                                    

if (pVal.BeforeAction && pVal.MenuUID == "SBOAddonProject34.UDOForm1")

{

            Application.SBO_Application.Menus.Item("test_udo").Activate();

}     

                                                     

And    

                                                

[FormAttribute("UDO_FT_test_udo")]     class UDOForm2 : UserFormBase                                              


To   

                                                    

[FormAttribute("UDO_FT_test_udo")]

Let me know if you need any help with applying the code.

Thanks,

Atilla

former_member183373
Active Participant
0 Kudos

Hello Joao,

You should also note that you need to use SAP Business One Studio to modify UI outline of your UDO form and save it to database as seen below. Visual Studio also have Save to Database option but it may require additional configuration.

After doing the UI changes you can add the UDO form to your Visual Studio project and make development.

Kind Regards,

Atilla

Former Member
0 Kudos

Hi Atilla,

That's great! I didn't know that option existed in B1Studio to save the UDO form.

Anyway, it would be great if we could change the UDO behaviour and add events with normal .NET code, like in a normal user forms...

One last question: is there any way to save the UDO changes to a file?

If I have 10 UDOs, each one with custom field design and want to copy the settings to another SAP installation, it would be great to export/import all UDO UI settings...

Thanks

JC

former_member183373
Active Participant
0 Kudos

Hello Joao,

You can open your B1 Studio project in Visual Studio by choosing SAP Business One Project From Existing B1s File template. This way you will be able to modify your UDO form UI in B1 Studio and write your .NET code in Visual Studio.

About your other question; I know that you can copy UDOs from one company to another within SAP B1 Client.


For copying UDO between companies go to;


Administration - System Initilazation - Implementation Center - Implementation Tasks - Data Management - Copy Data Between Companies.


Use Copy to File for exporting data and use Copy from File for importing. I am not sure if there is a tutorial or guide but the menu is pretty self explanatory. Check it out and let me know if you need any help.


Kind Regards,

Atilla

Answers (0)