ECM AP Automation PO Invoices

Are you saying you created another field group just to store the cost per code for each row in your LineItemsPO group?

I did, yes. This made it much easier to populate the CostPerCode into the Line field group afterwards with that single value from the Rcv field group instead of constantly having to ensure that all other Line fields in the Line field group needed to be added, too. That way when I do set the Line field group with things I was able to reference the Rcv field group I created. I named the Rcv field group as such simply because I pulled the CostPerCode from the RcvDtl table.

Okay, what task are you using to loop through the CostPerCode group that you made and match up to each corresponding row in the LineItemsPO group?

The process I used was:

  1. Datalink to find the CostPerCode based on the RcvDtl table as that will match the LineItemsPO field group

  2. Advanced Math task as explained above to create the ExtCostCalculated field

  3. Set Field Group task to set the LineItemsPO table with all of the usual values except I replace the ExtCost with the ExtCostCalculated amount calculated in Step2; I also add the CostPerCode into the LineItemsPO table by populating that field with the Rcv_CostPerCode field, but this isn’t exactly necessary

Thanks to Victors input, my Adv. Math Task now works. So my solution is slightly different, I replaced the STD datalink to pull in the uninvoiced receipt details, so I can include the CostPerCode - so I can directly populate it into the Line items field group. Then added the CostPerCode field to the Invoice lines read back datalink and added the Adv Math to the Update Invoice actions.

What do you mean by “that will match the line items PO field group?” Is this important to try and “join” this back up to the LineItemsPO later (see other questions on that as well :sweat_smile:)?

Just getting the primary keys? Or do you mean returning the data in the exact same order as the other group, like you were talking about on another post?

When you do a set field group task, how are you ensuring the right lines are getting the right cost per code?

For example, if I have two field groups, one for LineItemsPO and one for CostPerCode like below… How are you doing a lookup/join to get the corresponding codes associated with eachother?

In the case of the PNP workflow, the LineItemsPO table gets populated with the lines in the order that they are in on the Receipt Entry. As such, the CostPerCode will also be in that order. In your screenshots the lines may be displayed out of order, but the “Line” field is a match as you have displayed with the arrows. To use your example, this would allow you to set the "Line Items PO field group with the “Cost Per Code Group” values, where applicable.

As we know, there is no way to sort the field groups at this time. I am looking into this as per my other post: Sorting Field Groups - #9 by vleveris

Still not getting it Victor… set the Line Items PO field group with what task?

You can use the Set Field Group task to set all of the LineItemsPO fields. For the CostPerCode field you have created in the LineItemsPO field group you would enter the field value from your CostPerCode field group.

Victor, I guess my questions is, how in the world does it know to grab the right RcvDtl_CostPerCode that corresponds with the line it’s on while it’s looping through the LineItemsPO field group?

there are many invoices we have where the lines have mixed cost per codes…

It may be easier to go my route and replace the STD datalink with your own, where you pull in the CostPerCode with the rest of the information that populates the field group.

1 Like

I created a BAQ for my datalink to validate things, although this wasn’t necessary. As a result of how the LineItemsPO table gets populated in the PNP workflow, the records will match up organically because they are all from the same table, as far as I am aware. What isn’t part of this, for whatever reason, is the converted factor.

image

Victor that seems really odd. How can ECM know that field group rows came from RcvDtl table?

You’re telling me that somehow the field groups know what table they came from when a datalink that populated it could query any source?

It’s more directly related to this specific portion of the workflow, rather than a general statement, as this section of the workflow is interacting with the receipts for a PO. In order for the lines to be pulled into ECM, they would logically have to come from the Rcv_Dtl table as that is where this is information is stored in Epicor. This is only an estimate, though, because we unfortunately cannot actually verify how the integrated datalinks have been developed. With that being said, if you test them in the Admin panel you can at least see the results and with the method I developed for this I have never seen an issue in matching records.

2 Likes

I guess that’s great, my curiosity for the inner workings of how in the world it knows to associate the cost per code with the correct line on the foreign field group is what I would love to confidently know so I don’t leave it up to, “never seen it not work.” Which is totally acceptable in this case @vleveris cause it’s all we have to go off of.

I suppose it doesn’t exactly “know” so much as I am telling it what it should be. Since I am pulling the CostPerCode from the same table that the receipt lines are coming from, the order is also the same; that’s why the Set Field Group task works as both the CostPerCode and the LineItemsPO table are in the same order. It’s definitely not a science, it’s more of an art… and I am no artist lol

So you do think that both field groups need to be in the same order for it to work?

Yes. Fortunately, for this application they are in the same order. As per my other post, I am having issues comparing two field groups because they are not in the same order and I cannot determine a method for automating that sorting necessity.

1 Like

This is a feature we should request. Let’s not leave it to sorting… Maybe they can make a task that’s called “join…”

That name is already taken :rofl:. But there are ways around all the datalinks, create loops and datalinks with a From fieldgroup. I believe I used an advanced math to populate the cost per code. Not sure if it is better than anything anyone else posted.