Using Rest Services to query JobOprDtl

I would like to get the ResourceGrpID found in JobOprDtl or any other service that would allow me to get the ResourceGrpID for a JobNum, AssemblySeq, OprSeq

Thanks!

JobEntrySvc.GetRows

Thanks I tried the following…

“whereClauseJobOpDtl”: “JobNum = ‘J047961’ AND AssemblySeq = 0 AND OprSeq = 100”,
“pageSize”: 0,
“absolutePage”: 0

But I get a .net error message back. Did I miss something?

Did it take forever before it got back to you ?

Try:

whereClauseJobHead: JobNum = 'J047961'
whereClauseJobAsmbl: AssemblySeq = 0
whereClauseJobOper: OprSeq = 100

Send the rest as empty strings.

Narrow down from the top, much faster. If that data exist it should come back.

I tried…

{
"whereClauseJobHead": "JobNum = 'J047961'",
"whereClauseJobAsmbl": "AssemblySeq = 0",
"whereClauseJobOper": "OprSeq = 100",
"pageSize": 0,
"absolutePage": 0
}

And I still got the .net error. I can get the data I need from GetById but it seems like overkill and I’m going to have to filter JobOper down to the current assembly and operation I need.

image

You have those fancy quotes in there? ‘’ instead of '' ?

You can always just make a BAQ:

select 
	[JobOpDtl].[ResourceGrpID] as [JobOpDtl_ResourceGrpID]
from Erp.JobOpDtl as JobOpDtl
where (JobOpDtl.JobNum = @JobNum  and JobOpDtl.OprSeq = @OprSeq  and JobOpDtl.AssemblySeq = @AssemblySeq)

I think that’s just from posting in this form. I’m using Postman to test the endpoint.

You’ll be in the same boat with getrows.

Run a baq, or if you have functions you can do some LINQ in there.

I am using Javascript fetch to call the endpoint. I haven’t learned how to call a BAQ using fetch yet :frowning:

https://YourServer/api/v1/BaqSvc/YourBAQID/?AssemblySeq=0&JobNum=261720-1-1&OprSeq=10

AssemblySeq, JobNum, and OprSeq are parameters I made in the BAQ

Nice that seems easy enough, is it the same process for v2?

I’m looking, seems broken in swagger, un momento.

https://YourServer/api/v2/odata/YourCompany/BaqSvc/YourBAQID/Data/?AssemblySeq=0&JobNum=261720-1-1&OprSeq=10

It is broken in swagger, the parameter fields don’t show up, but if you do it like I show above
in Postman or code it will work.

Very simple function too if you can call functions:

Sig:
In:

  • JobNum → String
  • AssemblySeq → Int32
  • OprSeq → Int32

Out:

  • ResourceGrpID → string
  try
  {
      ResourceGrpID = Db.JobOpDtl.Where(x => x.JobNum == JobNum && x.AssemblySeq == AssemblySeq && x.OprSeq == OprSeq).Select(x => x.ResourceGrpID).FirstOrDefault();
  }
  catch (Exception ex)
  {
      //Do Something..?
  }

Json:

{
  "JobNum": "261720-1-1",
  "AssemblySeq": 0,
  "OprSeq": 10
}

You get it working?