BAQ If else statement

Hello Everyone,

I need assistance in converting progress code into a statement I can use within a BAQ.

The progress code is:
/* flag the division of the part */
IF INDEX(Part.PartDescription,“FRV PART#”) <> 0
THEN Division = “VK”.
ELSE
IF Part.ProdCode = “FRMC” THEN Division = “FRMC”.

Thanks in advance.

Miguel

@RC2020 you can model these in SSMS, but case is what you want. Something like this.

CASE WHEN Part.PartDescription like '%FRV PART#%' THEN 'VK' 
WHEN Part.ProdCode = 'FRMC' THEN 'FRMC' END

EDIT I missed the ProdCode condition so this is closer.

1 Like

Hello Greg,

I am putting the code you provided as a calculated field in Epicor 9 and I get the following error.

image

Thanks for your help.

Miguel

LOL That’s not gonna work. I just assumed you were 10 regardless of your version in your profile. Let me look.

so this is a guess based on my old notes. It just takes out the assignment.

IF INDEX(Part.PartDescription,“FRV PART#”) <> 0
THEN  "VK"
ELSE
IF Part.ProdCode = "FRMC" THEN "FRMC"
1 Like