Page 1 of 1

Getting the Plugin Name

PostPosted: Thu Sep 22, 2016 6:07 pm
by SBarnes
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.

Re: Getting the Plugin Name  Topic is solved

PostPosted: Mon Sep 26, 2016 4:44 pm
by perry
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