NullReferenceException while posting GRN  Topic is solved

Discussions relating to the REST API of Jiwa 7.

NullReferenceException while posting GRN

Postby gkov3 » Wed Oct 04, 2017 10:45 am

Hi all,

I am getting a NullReferenceException while trying to post a GRN. When I post a GRN without any lines it works. As soon as I specify one or more lines I get the NullReferenceException.

The following is the server side exception:

Code: Select all
[GoodsReceivedNotePOSTRequest: 3/10/2017 11:31:16 PM]:
[REQUEST: {CreditorID:00000000JY000000000A,CreditorAccountNo:5031,SlipDate:2017-10-04T10:31:15.9890000+11:00,LogicalWarehouseID:ZZZZZZZZZZ0000000000,Reference:Received by ASPluris,Lines:[{QuantityOrdered:41.000000,OrderNo:100509,OrderLineID:063c73bccc1843a48f3b,Quantity:10,InventoryID:000000000K00000000BV,PartNo:1171,Description:Standard Keyboard - Black USB/PS2 104 Keys Linear,SupplierPartNo:1171 - A,GRNLineType:Inventory,QuantityDecimalPlaces:0,PhysicalItem:True,ItemNo:2,LineDetails:[{Quantity:10,BinLocationDescription:"",ExpiryDate:2017-10-04T10:31:15.9930000+11:00}],CustomFieldValues:[]}],PurchaseOrders:[{PurchaseOrderReceivedID:60eb36cf664444d9b362,OrderID:9bad3833b35b416d81f0}],CustomFieldValues:[]}]

System.NullReferenceException: Object reference not set to an instance of an object.

   at JiwaFinancials.Jiwa.JiwaApplication.JiwaCollection`1.FindCore(PropertyDescriptor prop, Object key)
   at JiwaFinancials.Jiwa.JiwaApplication.JiwaCollection`1.GetItem(String PropertyName, Object PropertyValue)
   at JiwaFinancials.Jiwa.JiwaInvReceival.LineCollection.DTO_Deserialise(List`1 Lines)
   at JiwaFinancials.Jiwa.JiwaInvReceival.Receival.DTO_Deserialise(GoodsReceivedNote InventoryReceival)
   at JiwaFinancials.Jiwa.JiwaServiceModel.GoodsReceivedNoteServices.Post(GoodsReceivedNotePOSTRequest request) in c:\ProgramData\Jiwa Financials\Jiwa 7\7.1.0\SYSTEM\_localdb_.MSSQLLocalDB_Shared\JiwaDemo\Plugins\Admin\Compile\REST API\REST API.cs:line 5499
   at lambda_method(Closure , Object , Object )
   at ServiceStack.Host.ServiceRunner`1.Execute(IRequest req, Object instance, TRequest requestDto)



To be more exact the exception is shown when I specify, OrderLineID:063c73bccc1843a48f3b (which has the correct value and point to the PO Line).

Only way I can get it to work is not to specify PO information in the GRN Lines, use only Inventory ID and PartNo.

If you need more details please let me know.

Regards,

Goran

Jiwa 7.1.0.0 REST Interface - Self Hosting - Demo database C#
gkov3
Occasional Contributor
Occasional Contributor
 
Posts: 13
Joined: Tue Nov 11, 2014 4:10 pm
Location: Melbourne, VIC
Topics Solved: 1

Re: NullReferenceException while posting GRN

Postby SBarnes » Thu Oct 05, 2017 7:40 am

Hi Goran,

Without seeing the code it is very hard to comment but given this is pointing to code line 5499 in the actual plugin if you have access to Visual Studio on the same machine if you insert the code System.Diagnostics.Debugger.Launch(); or System.Diagnostics.Debugger.Break(); (which one depends on the OS) it should give you the option of launching Visual Studio and stepping it through the debugger.

Alternatively I would suggest you have read through the code for deserializing the DTO and see if you can work out what might additionally need to be set to make it work.
Regards
Stuart Barnes
SBarnes
Shihan
Shihan
 
Posts: 1620
Joined: Fri Aug 15, 2008 3:27 pm
Topics Solved: 175

Re: NullReferenceException while posting GRN  Topic is solved

Postby gkov3 » Thu Oct 05, 2017 4:12 pm

Thank you for response.
Ended up using alternative method by creating an empty GRN from PO and then patching it.

Regards,

Goran
gkov3
Occasional Contributor
Occasional Contributor
 
Posts: 13
Joined: Tue Nov 11, 2014 4:10 pm
Location: Melbourne, VIC
Topics Solved: 1


Return to REST API

Who is online

Users browsing this forum: No registered users and 5 guests