Page 1 of 1
Upgrading to JIWA 7.02 for Emaillog collection

Posted:
Tue Nov 27, 2018 10:41 am
by Ernst
Trying to upgrade this statement to 702. But it wont compile.
Is there a different CollectionItemFactory.CreateCollectionItem, I should be using.
Thx.
JIWA 7.0.175 Dim EmailLogCollection As New JiwaFinancials.Jiwa.JiwaSales.SalesOrder.EmailLogCollection
JIWA 7.02.00 Dim EmailLogCollection As JiwaFinancials.Jiwa.JiwaSales.SalesOrder.EmailLogCollection = Plugin.Manager.CollectionItemFactory.CreateCollectionItem(Of JiwaFinancials.Jiwa.JiwaSales.SalesOrder.EmailLogCollection)
Re: Upgrading to JIWA 7.02 for Emaillog collection

Posted:
Tue Nov 27, 2018 10:56 am
by Mike.Sheen
Hi Ernst,
You want to use the CollectionFactory, not the CollectionItemFactory to create a collection.
PS: The error message you were given would have given you a big clue as to what the problem was.
Mike
Re: Upgrading to JIWA 7.02 for Emaillog collection

Posted:
Tue Nov 27, 2018 11:11 am
by Ernst
This one does not compile in 702 either.
Dim EmailLogCollection As JiwaFinancials.Jiwa.JiwaSales.SalesOrder.EmailLogCollection = Plugin.Manager.CollectionFactory.CreateCollection(Of JiwaFinancials.Jiwa.JiwaSales.SalesOrder.EmailLogCollection)
SO close... but so far.
PS the message. says. JiwaFinancials.Jiwa.JiwaSales.SalesOrder.EmailLogCollection does not inherit from JIWA.CollectionItem, even though there is no mention of item in the line??
Thx
Re: Upgrading to JIWA 7.02 for Emaillog collection 

Posted:
Tue Nov 27, 2018 11:18 am
by Mike.Sheen
Ernst wrote:This one does not compile in 702 either.
Dim EmailLogCollection As JiwaFinancials.Jiwa.JiwaSales.SalesOrder.EmailLogCollection = Plugin.Manager.CollectionFactory.CreateCollection(Of JiwaFinancials.Jiwa.JiwaSales.SalesOrder.EmailLogCollection)
SO close... but so far.
PS the message. says. JiwaFinancials.Jiwa.JiwaSales.SalesOrder.EmailLogCollection does not inherit from JIWA.CollectionItem, even though there is no mention of item in the line??
Thx
In your case, I think you want this:
- Code: Select all
Dim EmailLogCollection As JiwaFinancials.Jiwa.JiwaSales.SalesOrder.EmailLogCollection = Plugin.Manager.CollectionFactory.CreateCollection(Of JiwaFinancials.Jiwa.JiwaSales.SalesOrder.EmailLogCollection, JiwaFinancials.Jiwa.JiwaSales.SalesOrder.EmailLog)
Perhaps the function declaration for CreateCollection in the CollectionFactory will make it clearer?

- Code: Select all
Public Overloads Function CreateCollection(Of CollectionType As {IJiwaCollection(Of CollectionItemType), New}, CollectionItemType As {IJiwaCollectionItem(Of CollectionItemType)})() As CollectionType
Re: Upgrading to JIWA 7.02 for Emaillog collection

Posted:
Tue Nov 27, 2018 11:57 am
by Ernst
OK That one does compile.. Baie Dankie
