Kinetic rest-erp where clause syntax question

I have an event for checking if an XPartNum (Customer part number in Order Detail) exists.

The event is using rest-erp component calling CustXPrtSvc.GetRows like this:

image

image

I’ve tried every variation I can think of on the where clause syntax but it’s either return me records because the payload is showing an empty where clause or I get a correlation id error because the where clause syntax is invalid.

With the rest helper api, it executes just fine with:

image

I have not been able to find any syntax examples for the where clause here in the forum or the application studio documentation

Anyone done something similiar ? thanks

Yes.

It doesn’t like replacing between the single quotes.

You’ll need an intermediary of some sort.

In a row-update:
I assigned CallContextBpmData.ShortChar01 to "'DP169X08CLCF'"

and in the erp-rest set it to XPartNum={CallContextBpmData.ShortChar01} and that worked.

Just got to figure out how to build the string with the single quotes and the field correctly :thinking:

Ok, you should be able to build a field with row-update and stick it in transview or call context

Expression for row update on CallContextBpmData.Shortchar01
"'" + "{OrderDtl.XPartNum}" + "'"

erp-rest set it to XPartNum={CallContextBpmData.ShortChar01}

@klincecum
Thanks Kevin…I would have taken a very long time to try that out, gotta love that Application Studio tool :grimacing:

I did end up just using a TransView field and that worked just fine

THANK YOU !!!

Easy follow-up (for someone like you)

This is what my response looks like:

image

How do I check if my response has at least one CustXPrt row in my rest-erp response parameters, this stuff

I don’t have a CustXPart dataview or dataset,
can I use “Parse from Response Path” to look for say “returnObj.CustXPrt.XPartNum” for example ?

thanks again

You’d think :dumpster_fire: :rofl: , but I have no idea. :thinking:

maybe @hmwillett can come to the rescue (again) :pray: :roll_eyes:

Add your own dataview and assign it to that.

You can use MyDv.MyColumn wherever you want.

Why not? Make one.

2 Likes

This is probably better than checking a field:

%cdv_CustXPrt.hasRow%

You had it correct. You must have some other issue going on.

I replicated his problem on my end. Not sure what’s going on.

Is it isolated to that specific scenario? It worked okay by binding a textbox to TransView.PartNum.

I will test when I can.

The where clause thing is very strange

This did not work (where clause showed up empty in payload)

image

but this did (@klincecum 's trick)
(I put the quotes directly in the TransView field in the database)

image

Thanks for the help on the latter part !

Seeeeeems fine to me. ¯\_(ツ)_/¯

OrderRestCall

How do you find things like this syntax: %AA_OFB_CustXPrt.hasRow% ?

Is there a list of these type of things ?
There was no intellisense for after the period…

Or are you using, “Try and see how epicor does it” (like by looking at the predefined events) that you mentioned in you session at Insights ?

btw…

I did get everything working with %AA_OFB_CustXPrt.hasRow% for the condition

but for some reason {AA_OFB_CustXPrt} != undefined gives me an error saying the AA_OFB_CustXPart IS undefined (even though a valid record was returned)

no worries, just testing/learning as I go thru this ‘adventure’

:+1:

1 Like

Angry Season 3 GIF by Party Down

Yup–this. You can also do .count instead of .hasRows. %cdv_CustXPrt.count% > 0

You need to check against a column, not the dataView. So '{AA_OFB_CustXPrt.XPartNum}' !== 'undefined'

Also note that there has been a lot of fixes and improvements to Application Studio between your version and the more current 2023 versions. It’s very likely that this is one of the things fixed to get it working as expected.

I’m in 2023.1.5 and replicated it, will move to 2023.1.6 and test.