cancel
Showing results for 
Search instead for 
Did you mean: 

How do I create new user table in program and then access it?

Former Member
0 Kudos

I am writing an application where I check for the existence of user objects when the add on starts and run the setup if the objects do not exist. I can create the user tables and fields but after the setup completes these objects still are not visible.

If the user objects exist when the add on is first run everything is detected correctly.

When a user object is added in SAP the user is eventually prompted to restart so I suspect something needs to happen prior to the add on being able to use the new fields.

Does the add on need to wait for the DI Server to perform some action? Do I need to just quit the add on's class and rerun it, disconnect and reconnect to the company, or get a new Application and/or company object?

What I want to do is figure out a way for the add on to automatically run the configuration if the user tables and fields do not exist yet and then kick off the regular add on code. I haven't seen anyone else's code so I don't know what is recommended or required here.

Thanks for any assistance!

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Any ideas on "best practice" for creating an add-on installation?

Has anyone here created add ons where you didn't just manually create the objects you needed before installing the addon?

Eneveux
Product and Topic Expert
Product and Topic Expert
0 Kudos

Bill,

This article should assist you with creating your tables programmatically. If you do a search for another post called "Create Tables". This should answer your question. Also with respect to creating and installation, there is sample code with the SAP Business One 2004A SDK (.Net) that should help you with creating and installation package. You should find it at; \Program Files\SAP Manage\SAP Business One SDK\Samples\COM UI\VB.NET\14.AddOnInstaller.

Hope this helps,

Eddy

Former Member
0 Kudos

I've seen all of the examples and can create tables with the result being what I described in my earlier posts. I converted the example you mention to C# but I'm thinking that might not be the ideal way to package a real addon. If extracting resources as the example does is how SAP developers deploy their apps I'd like to know.

My question isn't how it can be done programatically as much as how the installs <b>SHOULD</b> be done.

Bill

Former Member
0 Kudos

I found that the add on can validate the existance of the user fields if I disconnect from the company object, set the SAPbouiCOM.Application and SAPbobsCOM.Company objects to null, set the new application, context, and company objects, and reconnect once more.

HOWEVER...

I still have to wait for the client to be restarted manually before I can run any of the form I added to the menu.

So, I'd still like to know what the best practice is here. Should I just exit after setting up the tables and tell the user to restart SAP?