Debtor parent debtor name  Topic is solved

Discussions relating to plugin development, and the Jiwa API.

Debtor parent debtor name

Postby DannyC » Thu Jul 07, 2022 5:07 pm

I have some code that just pops up a message to display who the parent debtor is.
Code: Select all
   private void SalesOrderDebtorPopup(object sender, System.EventArgs e)
   {
      JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrder salesOrder  = (JiwaFinancials.Jiwa.JiwaSales.SalesOrder.SalesOrder)sender;
      JiwaFinancials.Jiwa.JiwaDebtors.Debtor debtor = salesOrder.Manager.BusinessLogicFactory.CreateBusinessLogic<JiwaFinancials.Jiwa.JiwaDebtors.Debtor>(null);
      debtor.Read(salesOrder.Debtor.DebtorID);
      
      if (salesOrder.Debtor.DebtorID != debtor.ParentDebtor.DebtorID)
      {
         MessageBox.Show("Parent debtor is " + debtor.ParentDebtor.AccountNo + " - " + debtor.ParentDebtor.Name + ".");
      }
   }


Thing is, this is what is displayed- note that the debtor.ParentDebtor.AccountNo is not displayed and the name has a " - False" at the end of it. Is this a bug?
v 7.2.1 latest SR.
Parent msg.png
Parent msg.png (2.22 KiB) Viewed 280 times


EDIT:
So I tried just displaying each field independently, i.e.
Code: Select all
MessageBox.Show(debtor.ParentDebtor.AccountNo);
MessageBox.Show(debtor.ParentDebtor.Name);


Turns out that AccountNo is displaying name. And Name is displaying the string "False".
User avatar
DannyC
Senpai
Senpai
 
Posts: 636
Joined: Fri Mar 22, 2013 12:23 pm
Topics Solved: 30

Re: Debtor parent debtor name  Topic is solved

Postby Mike.Sheen » Thu Jul 07, 2022 5:38 pm

'tis a bug.

Logged as DEV-9396.

You could likely work around this by doing this after the debtor.Read:

Code: Select all
debtor.ParentDebtor.ReadRecord(ParentDebtor.DebtorID)
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: 2444
Joined: Tue Feb 12, 2008 11:12 am
Location: Perth, Republic of Western Australia
Topics Solved: 756


Return to Technical and or Programming

Who is online

Users browsing this forum: No registered users and 38 guests