So I have a weird thing I want to do. I have a UBAQ that I will be passing in parameters for. If the query returns something, great. Get the info move on with my life. If the query doesn’t return something, I need to go and make the data that should be there. That part works fine.
What I want to do after that though, is add a row the to ttResults, so that the record that should have been there, that wasn’t, but I just created, shows up in the results. I going to be doing this using rest, so I don’t want to have to call the BAQ again to make sure that it worked, I’d rather send it once, then get back my “results”
Has anyone managed to do this? Add a row the a UBAQ’s ttResults? This is the code that I have. And it passes the context checker, but when I save the BPM it gives me an error, see below.
//this is an attempt to add the row to the results where there wasn't any. This doesn't want to
var myNewRow = new Epicor.Customization.Bpm.ResultsUbaqRow();
myNewRow.PartXRefVend_PartNum = VendPartNum;
myNewRow.PartXRefVend_VendorNum = VendorNum;
myNewRow.PartXRefVend_PartNum = partnum;
myNewRow.Part_PartDescription = Description;
myNewRow.Part_PartNum = partnum;
myNewRow.Vendor_VendorID = (from v in Db.Vendor where v.VendorNum == VendorNum && v.Company == callContextClient.CurrentCompany select v.VendorID).FirstOrDefault();
ttResults.Add(myNewRow);
@Chris_Conn . this seems like the kind of thing you would do
Save the BAQ or BPM? Even on BPM save no exception for me. Edit… nm i didnt have it enabled. i presume that that is some kind of dynamic class (since it’s based on the BAQ fields) and out side of the designer, the ref fails.
You just want a row count? You can do that in SQL. Just make the partition by something that is the same for all the row. Company and a common one I use.
Thanks for the reply, mate. I was looking for a calculation to be done and split that amount to each row by checking condition. My issue is resolved I just followed as Chris_Conn explained. Thanks Guys