How To Supress Error on GetByID if PartNum does not exist

Hi all,

I’m running into an issue with a columnChanged event on UD07.PartNum_c where I populate UD07 fields using data from the Part table.

What I’m Doing

When the user enters a PartNum in UD07, I use:

  1. Event: DataTable UD07 → columnChanged (PartNum_c)
  2. Condition:
{UD07.PartNum_c} !== "" && {UD07.PartNum_c} !== "undefined"
  1. REST Call: Part.GetByID
  2. Row-Update:
  • UD07.Description_c = {Part_c.PartDescription}

This works correctly when the entered PartNum exists in the Part table.

The Problem

Users sometimes need to enter a custom PartNum that does NOT exist in the Part table.
When they do this, the GetByID fails (as expected) and throws the error:

“Record not found”

I tried working around this by adding a Part.GetRows call first, checking if anything comes back, and then calling GetByID only when a match is found. Something like this:

  1. Event: UD07 columnChanged
  2. Condition: PartNum is not empty
  3. REST: Part.GetRows
  4. Condition: {UD07.PartNum_c.length} > 0
  5. REST: Part.GetByID
  6. Row-Update: Set UD07.Description_c

However, this still doesn’t work. The GetRows doesn’t prevent the GetByID from throwing an error when the part doesn’t exist.

What I Need

I’m looking for a way to:

:check_mark: Only run GetByID when the Part exists
:check_mark: Allow users to enter custom PartNums without errors
:check_mark: Still populate UD07.Description_c automatically when the Part does exist

Has anyone handled this scenario before or found a reliable condition to prevent the “Record not found” error?

Is this App Studio?

So the widgets in the events have a habit of running even if the prior one failed… I feel like even in alternate branches.

You may need to change all of your arrows to “SUCCESS” or whatever it is called, instead of just plain arrows. (Well, don’t change the true/false arrows or others that have a value.)

3 Likes

Epicor: Finding new ways to make no code / low code harder than actual coding every day :dumpster_fire: :dumpster_fire:

2 Likes

I want to say you’re wrong. But…

3 Likes

Application studio blows right past buggy into the satanic realm. Somebody isn’t eating enough of their own dog food, and it isn’t me

2 Likes

Yeah the events are something else. As @hmwillett summarized:

I have had to stick with simple ones, not that I often need complicated ones anyway. But on the weekend before physical inventory I made a nifty and complicated app to enter tags, and that’s when I got fancy with events and went on a rapid learning curve.

I did not emerge confident.

1 Like

Yes this is App Studio.

I set all connectors to “True” and “Success” which didn’t help.

Seems now it doesn’t error, it will put ‘undefined’ in the
Description_c field, if the part is not found.

But also doesn’t fill the Description_c field if the part does exist.

image

Is there a better way to acheive what I’m attempting?

Sorry to be picky, but I don’t see a label on the last arrow.

Maybe that won’t solve it, but I’d want to try…

What is your first condition?

I did something similar, except with a BAQ, and my condition was this:

%PartPMA.count% > 0

Managed to resolve this by enabling ‘Supress Execptions’ in the rest-kinetic Call Options.

Thanks all for your input.

1 Like