Epicor Functions and BAQs

Sure. I added some logic to version the query, so I’ve left that off. But this is the basic:

1.) Execute Invoke BO


2.) Fill in the Parameters using Fill Table by Query. (This is a single parameter BAQ in this case but you just have to make sure that you’ve filled out all mandatory parameters).

3.) Execute the query using the Invoke BO again

4.) Convert result to json and return using Custom Code. Remember to add your reference for Newtonsoft if you use it!

try {
oResult = Newtonsoft.Json.JsonConvert.SerializeObject(dsQueryResult);
oError = “OK”;
oErrorMsg ="";
}
catch (Exception e) {
oResult = “”;
oError = “ERROR”;
oErrorMsg = e.Message;
}

iEmail is my input parameter that I pass to the query and oResult, oError, and oErrorMsg are return variables.

11 Likes