I am designing a BPM and using the “Update Table By Query” and trying to use the if then else in the configure table mappings but not sure of the correct syntax. Can someone help please and thank you.
Syntax is
condition ? first_expression : second_expression
Widget would look like
Expression would look like
(number > 5) ? "Greater than 5" : "Less than or equal to 5"
and at some point prior to evaluating the number variable we have set it to some value.
hope that helps.
Oather question a little off topic but related to what I am trying to do.
In a bpm “Update Table By Query” is there a way to select the max date? for example in the vend part table there are many records for a part and all have the same vendor number but each on has a different effective date, I want to select the one with the most recent date.
Yes, just group by the part number, and get rid of the effective date field. instead put in a calculated field of max(effectivedate). Then you should only get one record per part with the biggest (latest) date.
Ohh I missed that important part. In the BPM widget for Update Table by Query, you can’t do any grouping or calc fields. I think you would have to generate this in a calculated field in a BAQ. But you probably aren’t using a BAQ if you are just writing a BPM. Hmmm… Maybe try to create a function. You can call functions from your BPM.
And how do I create a function" I have never done that before.
You would use the Epicor Functions Maintenance module. It’s similar to BPMs, except you don’t add them to a table or method. Instead, they can be called from elsewhere (like a BPM or Kinetic Form), or scheduled.
How do you add a library" It says I need a Library first.
The library is what you save all your function work under. You create the name. In this way you can have many functions under one “library” For example you could create a new library just called MyFuncs. To this you need to add the Reference you will need to reference. This might be Assemblies, tables, services, or other libraries. In your case probably just add the tables you need. Then go to add a new function to your new library. You have three types of functions to choose from. I like to use the Widget with Code functions, personally. They all have their place.
What is the equivalent VBCRLF in BPM expressions?
You are probably looking for Environment.NewLine