Getting the Plugin Name  Topic is solved

Discussions relating to Jiwa 7 plugin development, and the Jiwa 7 API.

Getting the Plugin Name

Postby SBarnes » Thu Sep 22, 2016 6:07 pm

Hi All

Is there a simple way to get the name of the plugin that code is operating in?

The only solution I can come up with is to declare a static string variable in ApplicationManagerPlugin and then set it in the setup routine from the plugin object that is handed in to the setup routine and then when needed reference it as ApplicationManagerPlugin.PluginName, is there an easier way?

I am trying to avoid hard coding the name in calls to JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Database.ReadSysData etc.

Thanks.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Getting the Plugin Name  Topic is solved

Postby perry » Mon Sep 26, 2016 4:44 pm

Hi,

Code: Select all
JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Database.ReadSysData(Plugin.Name, "settingname")

You should have Plugin object in the
Code: Select all
Public Sub SetupBeforeHandlers(ByVal JiwaForm As JiwaApplication.IJiwaForm, ByVal Plugin As JiwaApplication.Plugin.Plugin) Implements JiwaApplication.IJiwaFormPlugin.SetupBeforeHandlers
        End Sub

or other similar public functions


What we normally do is create a plugin that holds all custom fields/system settings.

The main reason is you have a single view of all custom fields. Another reason is, if you have your system setting set against each plugin, there is a big chance that your Dev setting value will get imported into production database.

hope this helps
Perry Ma
S. Programmer
Lonicera Pty Ltd
http://www.lonicera.com.au
perry
Frequent Contributor
Frequent Contributor
 
Posts: 173
Joined: Mon Oct 27, 2008 2:26 pm
Topics Solved: 15


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 0 guests