What BO do I use to update CustBusinessCategory in an updatable BAQ?

I’m trying to make a dashboard were users can manage the business categories for customers. I can’t figure out which BO controls updates to the CustBusinessCategory - neither the customer or BusinessCategory seemed to work.

How can I figure this out?

What does the trace say?

The only update I see is for the customer, but when I tried that it didn’t seem to work. My other changes to the customer took, but the BusinessCatagory either didn’t save or instantly reverted.

Looking at the dataset it looks like it is changing the “BusinessCatList” which isn’t even a column on the customer as far as I know.

I don’t have anything set up in my system, but seeing that it’s a list picker type screen, they usually have some goofy things with them. Most often, I think they are ~ delimited fields, which can be a pain to deal with. You won’t very easily be able to deal with those fields in a UBAQ because of the way they are set up.

It’s under CustBusinessCategory, and it looks like it just has rows for the customers that have one applied.

image

I found that already - it doesn’t seem to update though. There is no BO associated with it as far as I can tell.

Well, you have to either add or remove rows to change that. When a category is added, the system adds a row to that table. When one is removed, it removes a row from that table. So you won’t be able to just change it like most UBAQs do, you will have to add or delete rows, which is going to be trickier.

How do you add or remove rows if you don’t have a BO?

Seems like I might have to use the customer BO and manually call the update method, and somehow add a field to the tttable for BusinessCatList so it can convert the ~ list to actual rows… seems awfully complicated

It’s not a ~ list.

I think its some kind of sick hybrid – looking at the trace:

<tracePacket>
  <businessObject>Erp.Proxy.BO.CustomerImpl</businessObject>
  <methodName>Update</methodName>
  <appServerUri>https://ausmtspilot102.epicorsaas.com/SaaS203Pilot/</appServerUri>
  <returnType>System.Void</returnType>
  <localTime>9/4/2019 14:42:53:6963805 PM</localTime>
  <threadID>1</threadID>
  <executionTime total="325" roundTrip="221" channel="0" bpm="0" other="104" />
  <retries>0</retries>
  <parameters>
    <parameter name="ds" type="Erp.BO.CustomerDataSet">
      <CustomerDataSet xmlns="http://www.epicor.com/Ice/300/BO/Customer/Customer" />
    </parameter>
  </parameters>
  <paramDataSetChanges>
    <paramDataSet name="ds" useDataSetNbr="0">
      <changedValue tableName="Customer" rowState="Modified" rowNum="0" colName="BusinessCatList"><![CDATA[Asphalt~Recycling]]></changedValue>
      <changedValue tableName="Customer" rowState="Modified" rowNum="0" colName="RowMod"><![CDATA[U]]></changedValue>
      <changedValue tableName="Customer" rowState="Modified" rowNum="0" colName="UD_SysRevID"><![CDATA[System.Byte[]]]></changedValue>
    </paramDataSet>
  </paramDataSetChanges>
</tracePacket>

I’ve hit the limit to what I can do. You will use the customer BO, but you can’t do with with the generic UBAQ tools, you will have to custom code it to make it work. The BusinessCatList column exists in the customer object, but I don’t know how to get to it.

OK, I will figure it out eventually. Thanks for giving your time, I will be sure to post if I figure it out. :cowboy_hat_face:

1 Like

The following REST call to CustomerSvc/UpdateExt works, I just need do the same thing in the BAQ update BPM somehow.

{
  "ds": {
    "Customer": [
      {
        "Company": "78863",
        "CustID": "zzzA",
        "CustNum": 2745,
	"BusinessCatList": "Crushed~Asphalt"
      }
    ]
   },
  "continueProcessingOnError": true,
  "rollbackParentOnChildError": true
}

Here’s the code to make it work in a BPM. (thanks @josecgomez) You need the buffer copy in order to make the removing/changing of it to work. I’m not sure how you are going to be able to handle the ~ delimited field validation wise.

foreach (var i in ttResults.Where(x=>x.RowMod == "U"))
{         
using (var custupdate = Ice.Assemblies.ServiceRenderer.GetService<Erp.Contracts.CustomerSvcContract>())
       {
       CustomerTableset cust = custupdate.GetByID(i.Customer_CustNum);
       CustomerRow custOrig = (CustomerRow)cust.Customer.NewRow();
       BufferCopy.Copy(cust.Customer[0], custOrig);
       cust.Customer.Add(custOrig);
       cust.Customer[0].BusinessCatList = i.Calculated_BusinessCat;
       cust.Customer[0].RowMod = IceRow.ROWSTATE_UPDATED;
       custupdate.Update(ref cust);
       }   
}

businesscat.baq (33.9 KB)

1 Like

Not allowed to use c# in my BAQ’s due to Epicor’s hosting restrictions. I wonder if there is some way to use the mapping options on the update tab…

I got it to work without any C# or bpm. I had to use the mapping expressions and a sub query to build the list.
ConcatExample.baq (39.5 KB)