Duplicate Integration  Topic is solved

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

Duplicate Integration

Postby SBarnes » Thu Sep 04, 2025 6:49 pm

I have customer who we built an integration for to retrieve orders and insert them into Jiwa, to marry to the external ids for debtor and inventory in the other system there are custom fields that hold the the other systems ids that are used for the lookup.

Now the customer wants to run a second copy of the same integration that points to a different end point(system/database) and would have different id's for the customers and products.

If I duplicate the plugin I can solve the system settings with code like the below but is there a way to do a similar thing with custom fields on the debtor, invetory and sales order, i.e. take into account the plulgin name in getting or setting the values so in the end the code can be the same and just fix up the descriptions on the custom fields so the user will know the difference when setting things up.

Code: Select all
      JiwaFinancials.Jiwa.JiwaApplication.Manager JiwaApplicationManager = Plugin.Manager;
      System.Reflection.AssemblyName aName = new System.Reflection.AssemblyName(System.Reflection.Assembly.GetExecutingAssembly().GetName().FullName);

      SettingsVault.ClientID = JiwaApplicationManager.Database.ReadSysData(aName.Name, "IClientID", "").ToString();
      SettingsVault.ClientSecret = JiwaApplicationManager.Database.ReadSysData(aName.Name, "IClientSecret", "").ToString();
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Duplicate Integration

Postby Mike.Sheen » Thu Sep 04, 2025 7:28 pm

Why so complicated?

The following could replace your code above - it should do the same thing.

Code: Select all
SettingsVault.ClientID = Plugin.Manager.Database.ReadSysData(Plugin.Name, "IClientID", "").ToString();
SettingsVault.ClientSecret = Plugin.Manager.Database.ReadSysData(Plugin.Name, "IClientSecret", "").ToString();


As for Custom fields, I thought the JiwaApplication.CustomFields.CustomFieldValueCollection class had helper methods to get custom fields including field name AND plugin name?
Mike Sheen
Chief Software Engineer
Jiwa Financials

If I do answer your question to your satisfaction, please mark it as the post solving the topic so others with the same issue can readily identify the solution
User avatar
Mike.Sheen
Overflow Error
Overflow Error
 
Posts: 2583
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 807

Re: Duplicate Integration

Postby SBarnes » Thu Sep 04, 2025 7:32 pm

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

Re: Duplicate Integration  Topic is solved

Postby SBarnes » Thu Sep 04, 2025 7:46 pm

Yeah two versions


Code: Select all
        public CustomFieldValue ItemFromSettingName(string SettingName)
     
        public CustomFieldValue ItemFromSettingName(string SettingName, string PluginName)
       
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 1 guest