Hi any expert may advice me on following error I hit, I has try many round on others method but still unable to find the solution.
My Error hit:
Exception > System.NullReferenceException: Object reference not set to an instance of an object. at Epicor.Customization.Bpm.DB44440CA484E04B41A66DAB920CA95B98.InTranDirective_Test_Credit_Limit_88D286313FE7442FBC6D3E75F01A31D4.A001_CustomCodeAction() in InTran.Test_Credit_Limi.cs:line 286
The error hit after the line if (CMHed != null) I just not understand what error means Object reference not set to an instance of an object, which part i didn’t declare?
I has check the tracing options that actually I have to call the GetByCustID first, but when i execute the code it return error which is Records Not Found! but my Cust ID really exist in db.
secondly the GetOrders should be return me a tablesets of CMOrderHed if I successfully call the GetByCustID.
for the CMDataset = hCM.GetOrders(“H0012”); I have no idea might be is not working at all or I miss out something to inject the data to my tablesets.
Thanks Doug.C, will try on this on my code, I did the same try on BL tester on the GetOrders, its returns a blank row with all null value fields, may I know how you test and mind to share with me?
It very funny for just a simple declare the datasets and it return me an error: System.NullReferenceException: Object reference not set to an instance of an object
means system unable to understand what is CMDataSet about even been declare and try to fill it with result.
If you got a blank row, then it’s not getting any orders for that customer. I’m guessing there are some orders for them in your system? I tried it on a customer with no orders and got a null dataset back.
Thanks and appreciate for the tips, will do this check from my end and guess really might be not from my code.
But my last test still no luck and I did check the BL tester the row was there in list, and when come to the line: CMDataSet = hCM.GetOrders(22123);
Its not able to store or pull the row into CMDataSet as following error: System.NullReferenceException: Object reference not set to an instance of an object
The method only needs the Customer ID as string, are you sure the object reference error happens when calling GetOrders?
Can you show the setup used for the bpm? I’m not familiar with bpms so I would like to see the setup to try and replicate from my side if I get the error.
Are you doing this as a data directive? Or as a method directive? If so which table/process? I’ll model it in my sandbox to see if I can figure out what’s going on.
Hi Doug thanks,
I model this in data directive, the purpose of this for un-hold the order credit been hold which can be view at Customer Credit Manager.
I’m actually fire this data directive at task schedule db, and the bpm will open mailbox to read the mail responded from HOD who send the signal to un-hold the order credit.
hm… sorry and sound complicated ya… but anyway the main issue cause at the section code which trying to un-hold the credit order only, the rest function are working fine.
I did try to code it at screen customization which can be work perfectly, but I always hit the issue in BPM custom code on using BO to update the order status.
hmm nop, i did query result test before fire the bpm, of-cause have to ensure the data is there before fire the bpm.
I have the similar code in screen customization which is working, and my problem is I’m not that skillful on BPM object custom coding, so would like to seek for your expert advice.