cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Business Adapter - Cost center update

Hello Community,

I am building a Business Adapter, that would update cost center value of Purchase order line, based on provided .xlsx file.
Source of data is a spreadsheet with PO number, Name, Description and said new cost center.

I had some success with using business adapters previously, but I have a weird problem here. When I try to run it, nothing gets updated. There are no errors, but no desired effect either.

What's interesting, if I don't add Cost Center as a separate item and instead just go to Purchase Order Line item. enable Cost Center ID property, from source select "fixed value" and just enter hard coded Cost Center ID (from GroupEx table), then it works fine.


Any ideas what might be happening? I attached .xml file here

(1) Solution
mfranz
By Level 17 Champion
Level 17 Champion
First guess: For the Purchase Order Line you use the Cost Center ID for matching. This would result in the import only identifying data sets where the Cost Center is already set to the value of your dataset. Only set attributes to "use for matching" if they're used to identify an element, not if the specific element should get updated.

View solution in original post

(4) Replies
mfranz
By Level 17 Champion
Level 17 Champion
First guess: For the Purchase Order Line you use the Cost Center ID for matching. This would result in the import only identifying data sets where the Cost Center is already set to the value of your dataset. Only set attributes to "use for matching" if they're used to identify an element, not if the specific element should get updated.
Well that was fast 🙂 and correct!
I changed this one setting and importer worked as I wanted
btw, do you think Purchase Order needs to be marked for Update as well? Nothing should change there, but those Items are connected.

I usually run a minimal approach and allow the import to only update/create the objects I directly plan to update/create. This forces more strict planning and helps to minimize errors. Always keep in mind that data provided by others may contain errors - if now now, maybe later.

You write "nothing should change" - better make sure nothing does change. (If the PO changes, it should probably be another import.)

While you haven't directly observed this as a problem, if you have multiple purchase lines associated with a single purchase order number then you may find your adapter is only updating a single line. That is because if you use purchase order number as the key value to use to identify records to be updated, then the adapter will likely only update a single matching record in the case where multiple records match.

If you do have multiple lines associated with a single purchase order number, try adding a line/sequence number to your spreadsheet that you can used as a second field for matching in the adapter to identify individual purchase lines to be updated.
(Did my reply solve the question? Click "ACCEPT AS SOLUTION" to help others find answers faster. Liked something? Click "KUDO". Anything expressed here is my own view and not necessarily that of my employer, Flexera.)