Generic Object Collection on Sales order form  Topic is solved

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

Generic Object Collection on Sales order form

Postby SBarnes » Wed May 26, 2021 12:25 pm

I have just tried accessing the sales order form generic object collection in the set up before handler to discover it is null, this is not the case in the set up handler, is this a bug?
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1696
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 191

Re: Generic Object Collection on Sales order form

Postby Mike.Sheen » Wed May 26, 2021 12:40 pm

SBarnes wrote:I have just tried accessing the sales order form generic object collection in the set up before handler to discover it is null, this is not the case in the set up handler, is this a bug?


The BusinessLogic.Maintenance base class sets the GenericObjectCollection inside the Setup method - so Setup before it will be null.

We cannot do it before Setup because we don't have a Manager at that point to create the JiwaCollection with.

Code: Select all
Public Overridable Sub Setup() Implements IJiwaBusinessLogic.Setup
   _PropertiesChanged = New Collection(Of String)
   _SortOrders = New List(Of IJiwaNavigable.SortKey)
   _GenericObjectCollection = Manager.CollectionFactory.CreateCollection(Of GenericObjectCollection, GenericObjectItem)
   _AbstractPermissionCollection = Manager.CollectionFactory.CreateCollection(Of AbstractPermissionCollection, AbstractPermission)
   _BaseFindSQLQuery = String.Format("SELECT TOP 1 {0} FROM {1}", RecIDFieldName, TableName)
End Sub


So no, not a bug as such. But I can see it being a problem if you want to use the GenericObjectCollection in a plugin in the SetupBefore method.
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: Generic Object Collection on Sales order form  Topic is solved

Postby SBarnes » Wed May 26, 2021 12:44 pm

I got around the problem by just moving the adding something to the collection to the set up handler and just used the before setup handler to attach the necessary handlers to get in front of the standard code.
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 4 guests