Mass Data Load into VendAttr Table - Help Needed

I’m looking for a way to load a lot of data into the VendAttr table.

When looking in DMT for an entry there were none shown. When trying to build an updatable BAQ I noticed there is no business object to select. I went ahead and tried adding the vendor table to it and was able to perform an update on the fields within the VendAttr Table without error. But, when calling the list of items again the data did not stick. The last venture I tried was finding a means of getting the data in using Postman. However, when I try posting/patching through an updatable BAQ I get the following error:

Has anyone had success loading data into the VendAttr table in the past?

If your UBAQ doesn’t work, there is no way that calling with REST is going to make it work. You might have to custom code it. Did you do a trace on the updates in the IU and see what methods are called and what kind of rows are passed in?

1 Like

@Banderson,

From what I can see there are calls for Erp.Proxy.BO.AttributImpl and Erp.Proxy.BO.VendorImpl when an attribute is added to a vendor. The Erp.Proxy.BO.AttributImpl is passing around

 <parameter name="whereClause" type="System.String"><![CDATA[Inactive = false BY AttrDescription]]></parameter>
    <parameter name="pageSize" type="System.Int32"><![CDATA[0]]></parameter>
    <parameter name="absolutePage" type="System.Int32"><![CDATA[0]]></parameter>
    <parameter name="morePages" type="System.Boolean"><![CDATA[False]]></parameter>

. The Erp.Proxy.BO.VendorImpl is passing around

<parameter name="VendorNum" type="System.Int32"><![CDATA[141]]></parameter>
<parameter name="PurPoint" type="System.String"><![CDATA[]]></parameter>
<parameter name="ConNum" type="System.Int32"><![CDATA[1]]></parameter>

I do not see any mention of the VendAttr table listed

It’s the vendor attribute string in the vendor temp table. You’ll have to get that field in the temp table, set it, (probably along with a row mod to U) and call update.

image

This is one that you will probably have to custom code. The Vendor temp table takes in a ~ delimited field, then does the work to split it and put it into the vendor table. So they won’t have an easy to pick BO to do it for you from a UBAQ.

3 Likes

So what would custom coding for this look like? Where would I build it? Thanks for taking the time to look at this! It means a lot!

So you would build this using the Advanced BPM update in the UBAQ, the write your own base update method. You can try doing a single row with the widgets. GetByID, set the vendorAtt list field (you’ll have to format it correctly) and set the Row mod to U, then call Update.

If you’re going to loop through, while it’s possible widgets, it’s a real pain, and much easier to do in code (if you know how to write the code). You should be able to get find some examples of using BPM code to getbyID and Update.

2 Likes

If you don’t know how to code it using business objects you can build a widget function to create the record in the vendor attr table and then loop through the results in your BAQ and call the function for each record.

1 Like

@utaylor,

How do I reference the function with C# code? Also did something change I’m trying to use the following and it keeps saying that the ttResults doesn’t exist:

foreach(var stuff in ttResults)
{
}

@Banderson,

I built a quick and dirty bpm to update the field in question but am getting the following error:

One sec man, let me get the code.

Dylan, we get price increases from vendors and we need to update all our open POs accordingly… we write POs way out into the future.

I built a dashboard that calls an updateable BAQ. For each row in the results that is updated, I call a function to update the line price.

You will see the initial foreach statement that loops through the results where RowMod is “U.”

Dylan I am not sure this is the right thing to do, but I had to put mine on the update method at the base processing method to get this to run. Now I am not updating anything using the BAQ or the BAQ business objects, I am calling custom functions so I think it is fine, but I would rather have someone more experienced chime in @hasokeric @Banderson @jgomez

image

1 Like

@utaylor,

That got mine going! Now I just have to figure out why it didn’t keep the data in the table when it went through the update.

Dylan, I would pause and wait for a response as to what you are doing in the advanced BPM update. Ask Brandon where he is putting his code and what that warning message is and how to get around it.

I don’t know if what I did is right, but I think it’s fine for me because I am not using any base functionality baked into the updatable BAQ, I am wanting to call my own code.

Give me a bit to break it all down. @dgreenEA , that message you are getting comes when you don’t have the BPM in the BAQ set up to do the update. That either means you didn’t put it in the right spot, or you didn’t click the enable checkbox.

@utaylor, the BPM that you are posting is not a UBAQ bpm. That’s a BPM on the actual BO, which is not what we are going for here.

I’ll write up a post, just give me a bit.

Brandon, here is my UBAQ:

1 Like

I have no business object even selected.

1 Like

Ah, I stand corrected. The way you cropped the BPM I thought it was on the main business object. Sorry.

So here’s the BAQ that I used to get the fields in the right format.

image

I filtered down to 2 vendors. I added attributes to one to see what some values would be.

image

The BPM goes here in the advanced BPM update only

The first step is to go to the usings and references and add the Vendor BO.

Here is the code that you need to do this with comments (it’s a screen shot so that you have to type it yourself and hopefully remember some of it :wink: )

So now you can add in a string, and update the record
Vendor Attributes

So the part that you will have to figure out is what you need the string to be to put in the field so that you can make the update. You can put this into a dashboard and do a paste update if you want to do a mass update.

Hopefully this makes sense.

1 Like

Brandon,

This is a ton more than I could have asked for! Thank you so much! I owe you for this one!