ECM AP Automation PO Invoices

Hello,

Anyone do anything with pulling in the PO/Receipt Cost Per value to correctly calculate extended costs - when its per 100 or 1000?

I’ve got so far but got stuck. The epicor datalink for Read receipt lines to be invoiced, does not reference the costpercode, so I have replaced this with my own datalink (converting the E, C and M to 1, 100 or 1000). The problem is the Read back lines datalink - was hoping not to have to replace this one as well. It has a reference to the CostPerCode but pulls back E, C or M. As I’ve added this field to the field group, ECM complains if you try and update the values.

Thanks

I have this working in both versions, but based on your Epicor version posted (10.2.200) I am assuming you are using v1 workflows.

For v1, I have this working by doing the CostPerCode calculations in both the Read Receipt Lines Ready to Invoice workflow step and the Update Invoice Lines workflow step. With that in place the Read Back Invoice workflow step didn’t require any modifications.

Hi Victor,

Yes, using V1 Workflows.

Did you have the CostPerCode as part of the lines fields group?
Would you be able to share one of your actions.

Thanks Neil

I also got tripped up by this and have it in my environment, v1, but not working yet because the math task I am using doesn’t seem to see the cost per code in the field group.

I’m also having an issue with the Math task / field group.

Yup, I added the cost per code to the field group in a previous task and then it doesn’t see it when doign the math task right after it.

Funny part is, I see the cost per code end up in my field group at the end of the step :sweat_smile: so I know it’s there. It’s that intricacy that I don’t quite understand about values in steps/actions. Like you can’t use the value until another step or something like that. It’s something similar to row-locking or dirty rows concept I believe.

Yes, the CostPerCode is part of the LineItemsPO field group, but I also have this populating a Rcv field group I created with just this single value from the datalink. I am using the Advanced Math task to create a calculated ExtCost with the following formula:

Input {0} = LINE_VendorQty
Input {1} = LINE_UnitCost
Input {2} = Rcv_CostPerCode (This is just where I stored it, but you will have to reference where you have this stored in the field group you created for it
Output = ExtCostCalculated

IIF(‘{2}’=‘M’,({0}/1000){1},IIF(‘{2}’=‘C’,({0}/100){1},{0}*{1}))

After this task I set the field group for LineItemsPO and where the ExtCost field is I used my new calculated value of ExtCostCalculated.

3 Likes

Thanks for the info.

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