Page 1 of 1

Instantiating debtors in 7.1

PostPosted: Mon Nov 13, 2017 11:47 am
by DannyC
Hi,

I have the following code which needs to create a debtor from the factory so that delivery address can be used in the plugin
Code: Select all
Dim Debtor As JiwaApplication.Entities.Debtor.Debtor = salesOrder.Manager.EntityFactory.CreateEntity(Of JiwaApplication.Entities.Debtor.Debtor)()
Debtor.ReadRecord(salesOrder.CustomFieldValues.ItemFromSettingName("ADifferentDebtor").Contents)
For Each DelAddr As JiwaDebtors.DeliveryAddress In Debtor.DeliveryAddresses
and so on

The problem is that the DeliveryAddresses is not a member of JiwApplication.Entities.Debtor.Debtor

What is the correct syntax for the Dim debtor line?

I've tried
Code: Select all
Dim Debtor As JiwaDebtors.Debtor = salesOrder.Manager.EntityFactory.CreateEntity(Of JiwaDebtors.Debtor)()

but that doesn't work either

Re: Instantiating debtors in 7.1  Topic is solved

PostPosted: Mon Nov 13, 2017 12:03 pm
by Scott.Pearce
Code: Select all
Dim Debtor As JiwaDebtors.Debtor = JiwaApplication.Manager.Instance.BusinessLogicFactory.CreateBusinessLogic(Of JiwaDebtors.Debtor)(nothing)

Re: Instantiating debtors in 7.1

PostPosted: Mon Nov 13, 2017 1:39 pm
by DannyC
Thanks for the quick answer.
Been struggling with that for a few hours!