JIWA 7 API creating Debtors/Creditors  Topic is solved

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

JIWA 7 API creating Debtors/Creditors

Postby Drew » Mon Nov 02, 2015 3:23 pm

Hi all
I am working on a system integration tool to link the details of Debtors and Creditors in JIWA with a SugarCRM.
changes in one need to be reflected in the other.

So far the SugarCRM side is fairly straight forward with their REST API.

on the JIWA side of things I can:
- Pull From JIWA Data through SQL queries straight to the JIWA database.
- Push to JIWA changes through SQL queries straight to the JIWA database.

I am stuck on the being able to create a new Debtor / Creditor record.

Environment:
- C# .net
- JIWA 7
- Microsoft SQL

Any help will be appreciated.

Cheers
Drew
Last edited by Drew on Wed Nov 04, 2015 4:08 pm, edited 1 time in total.
Drew
Occasional Contributor
Occasional Contributor
 
Posts: 10
Joined: Mon Oct 12, 2015 5:21 pm

Re: JIWA 7 API creating Debtors/Creditors

Postby Drew » Mon Nov 02, 2015 3:34 pm

Also noted that as of sometime last week that the following https://help.jiwa.com.au/Jiwa7/7.00.126 ... index.aspx
which might have been helpful now nolonger works..
Drew
Occasional Contributor
Occasional Contributor
 
Posts: 10
Joined: Mon Oct 12, 2015 5:21 pm

Re: JIWA 7 API creating Debtors/Creditors  Topic is solved

Postby Mike.Sheen » Mon Nov 02, 2015 3:35 pm

Hi Drew,

Reference JiwaApplication.dll, JiwaDebtors.dll and JiwaODBC.dll in your project and then you can create a debtor using something such as this:

Code: Select all
private void CreateDebtor()
{
   JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Logon("SQLServerName", "DatabaseName", JiwaFinancials.Jiwa.JiwaODBC.database.AuthenticationModes.JiwaAuthentication, "Admin", "password");

   var debtor = JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.BusinessLogicFactory.CreateBusinessLogic<JiwaFinancials.Jiwa.JiwaDebtors.Debtor>(null);
   debtor.CreateNew();
   debtor.AccountNo = "1234";
   debtor.Name = "Test";
   //debtor.Classification.ReadRecordFromDescription("My Classification"); //<-- Example of setting the debtor classification
   debtor.Save();
}


Creditors is very similar - just change "debtor" with "creditor" in the above.

Mike
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: JIWA 7 API creating Debtors/Creditors

Postby Mike.Sheen » Mon Nov 02, 2015 3:35 pm

Drew wrote:Also noted that as of sometime last week that the following https://help.jiwa.com.au/Jiwa7/7.00.126 ... index.aspx
which might have been helpful now nolonger works..


That post which referred to that link was corrected last week with the right link :)
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: JIWA 7 API creating Debtors/Creditors

Postby Drew » Tue Nov 03, 2015 4:34 pm

Thanks Mike that is the start I needed.
Drew
Occasional Contributor
Occasional Contributor
 
Posts: 10
Joined: Mon Oct 12, 2015 5:21 pm

Re: JIWA 7 API creating Debtors/Creditors

Postby Drew » Wed Nov 04, 2015 4:04 pm

Technical Hitch..

How would I Create/set the DeliveryAddress details when creating a debtor?

Cheer
Drew
Drew
Occasional Contributor
Occasional Contributor
 
Posts: 10
Joined: Mon Oct 12, 2015 5:21 pm

Re: JIWA 7 API creating Debtors/Creditors

Postby Scott.Pearce » Wed Nov 04, 2015 4:24 pm

This is off the top of my head:

Code: Select all
   JiwaFinancials.Jiwa.JiwaDebtors.DeliveryAddress myNewDeliveryAddress = new JiwaFinancials.Jiwa.JiwaDebtors.DeliveryAddress();

   myNewDeliveryAddress.DeliveryAddressName = "Head Office";
   myNewDeliveryAddress.Address1 = "1 Smith St";
   myNewDeliveryAddress.Address3 = "Sydney";
   myNewDeliveryAddress.Address4 = "NSW";
   myNewDeliveryAddress.Postcode = "2000";

   debtor.DeliveryAddresses.Add(myNewDeliveryAddress);


So to add this to Mike's example from above:

Code: Select all
private void CreateDebtor()
{
   JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.Logon("SQLServerName", "DatabaseName", JiwaFinancials.Jiwa.JiwaODBC.database.AuthenticationModes.JiwaAuthentication, "Admin", "password");

   var debtor = JiwaFinancials.Jiwa.JiwaApplication.Manager.Instance.BusinessLogicFactory.CreateBusinessLogic<JiwaFinancials.Jiwa.JiwaDebtors.Debtor>(null);
   debtor.CreateNew();
   debtor.AccountNo = "1234";
   debtor.Name = "Test";
   //debtor.Classification.ReadRecordFromDescription("My Classification"); //<-- Example of setting the debtor classification

   //Add a delivery address
   JiwaFinancials.Jiwa.JiwaDebtors.DeliveryAddress myNewDeliveryAddress = new JiwaFinancials.Jiwa.JiwaDebtors.DeliveryAddress();
   myNewDeliveryAddress.DeliveryAddressName = "Head Office";
   myNewDeliveryAddress.Address1 = "1 Smith St";
   myNewDeliveryAddress.Address3 = "Sydney";
   myNewDeliveryAddress.Address4 = "NSW";
   myNewDeliveryAddress.Postcode = "2000";

   debtor.DeliveryAddresses.Add(myNewDeliveryAddress);

   debtor.Save();
}


EDIT: Forget to new.
Scott Pearce
Senior Analyst/Programmer
Jiwa Financials
User avatar
Scott.Pearce
Senpai
Senpai
 
Posts: 765
Joined: Tue Feb 12, 2008 11:27 am
Location: New South Wales, Australia
Topics Solved: 230


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 2 guests