Application Studio Noob: rest-erp Business Layer Exception error - Record not found

Hello!

I’m having a bit of difficulty in a layer that I’ve created for the Erp.UI.SerialNumberMaint application. I’ve added a Data View for JobHead (using JobEntry as the Dataset ID), then created an event to call the data view, using the rest-erp event action. I created this using the GetByID method, which I think is maybe where this issue is occurring. I’m trying to retrieve the Service Call, which is linked to the JobHead.

Sorry if I’m missing any information - I’m a bit new to the whole process. I do not get this error if there is a ‘Service Call’ to call - but not every SN has one, so I’d like to have it just display… nothing, if there’s nothing to call. That makes me think that maybe I should be using a different method (as opposed to GetByID), but I’m just not sure what method that would be, or how it would be set up.

image

image

GetByID should populate JobHead.CallNum - whether there exists a CallNum or not (empty CallNum will come back as 0)

How are you using this data? Let’s see if we can get to the bottom of the error you’re getting

On second thought … can you link the Service Call to your data using a BPM?
That way your business logic stays on the server

1 Like

Indeed that is the GetByID failing. You should trap the JobNum you are passing to the call to ensure it is expected. Also check the site of the Job.

2 Likes

Hi all - sorry for the delay in response. I ended up getting it working, mostly. I ended up swapping out GetByID with GetRows, with the method parameter of ‘whereClauseJobHead’ field set to JobNum=‘{SerialNo.JobNum}’

annnd… it works! Though, now it will load the CallNum for the first Serial Number I select, and to load another one I need to close my layer preview and re-open it. Not sure if that’s just a bug with the Preview Mode, I have the event calling after AfterGetByID (as I’ve previously been instructed to do by a consultant) which hasn’t failed me prior. But the main problem has been solved!

1 Like