I have a problem with API code that was working fine and now it appears broken with the new update to Avontus 2016.
These are the 2 API calls:
StockingLocation sl = null;
sl = StockingLocation.GetStockingLocation(Guid.Parse (StockingLocationID), true);
job.HistoryRateProfile = sl.ParentBranchOrLaydown.Number;
I have managed to work around #1 by using the StockingLocationCollection object:
StockingLocationCollection slc = null;
Guid[] sls = new Guid[1];
sls [0] = Guid.Parse (StockingLocationID);
slc = StockingLocationCollection.GetStockingLocationCollection (sls);
StockingLocation sl = null;
sl = slc [0];
But here is the stack track of the error when trying to get the “ParentBranchOrLaydown” property from the StockingLocation object, which was a similar issue when using the “GetStockingLocation” method:
Avontus.Core.DataPortalException: DataPortal.Fetch failed (DataPortal.Fetch failed (Method not found: ‘!!0[] System.Array.Empty()’.)) —> Avontus.Core.Reflection.CallMethodException: DataPortal_Fetch method call failed —> Avontus.Core.DataPortalException: DataPortal.Fetch failed (Method not found: ‘!!0[] System.Array.Empty()’.) —> Avontus.Core.Reflection.CallMethodException: DataPortal_Fetch method call failed —> System.MissingMethodException: Method not found: ‘!!0[] System.Array.Empty()’. at Avontus.Rental.Library.ExistsGeneric.DataPortal_Fetch(Criteria criteria) at dm(Object , Object[] ) at Avontus.Core.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) — End of inner exception stack trace — at Avontus.Core.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) at Avontus.Core.Server.SimpleDataPortal.Fetch(Type objectType, Object criteria, DataPortalContext context) — End of inner exception stack trace — at Avontus.Core.DataPortal.Fetch(Type objectType, Object criteria) at Avontus.Core.DataPortal.Fetch[T](Object criteria) at Avontus.Rental.Library.ExistsGeneric.JobSiteHasInvoices(Guid stockingLocationID) at Avontus.Rental.Library.StockingLocation.LoadHasBilling() at Avontus.Rental.Library.StockingLocation.Fetch(SafeDataReader dr, Boolean prefetchChildren) at Avontus.Rental.Library.StockingLocation.DataPortal_Fetch(RootCriteria criteria) at dm(Object , Object[] ) at Avontus.Core.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) — End of inner exception stack trace — at Avontus.Core.Reflection.MethodCaller.CallMethod(Object obj, DynamicMethodHandle methodHandle, Object[] parameters) at Avontus.Core.Server.SimpleDataPortal.Fetch(Type objectType, Object criteria, DataPortalContext context) — End of inner exception stack trace — at Avontus.Core.DataPortal.Fetch(Type objectType, Object criteria) at Avontus.Core.DataPortal.Fetch[T](Object criteria) at Avontus.Rental.Library.StockingLocation.GetOrganization(Guid StockingLocationID, Boolean prefetchChildren) at Avontus.Rental.Library.StockingLocation.get_ParentBranchOrLaydown() at Avontus.Rental.Wrapper.ShipToService.GetJobSite(String StockingLocationID) — End of inner exception stack trace —
Please advise