EpiCurrencyConver

Has anyone used the control “EpiCurrencyConver”?
I bound the control to a UD field called “Total_c”.
This is the error I receive when opening the form:

I thought that maybe it needed a spot to put the conversion number, so I added a UD field called “Rpt1Total_c”.
Now when I open the form it says the same error, but it changed to be “Rpt2Total_c”.

My end goal is to have a UD currency field that flips between CAD and USD like the native fields do.

So, turns out I had to add Rpt1Total_c through Rpt5Total_c in order to have the error go away.
Now I’m running into a problem where the field acts like it’s not bound to anything.
Anyone have any idea how to properly use an EpiCurrencyConver control?


There’s gotta be someone out there that’s used the EpiCurrencyConver control. Anybody?

Never missed with this, sorry Aaron. I’ll see if I can dig something up.

There’s surprisingly little information on it, even in the Ice guides.

I’m getting the impression that the following extended properties need to be set in order for it to work, but that’s currently bugged with a planned fix of some patch on 10.2.
I would try and set them via code, but I’m not sure what the values of those drop downs are.

Find a field that already has them set, then you can see what the values are.

None of the default currency fields have it set. (I tried a query too)
If I try and set the Business Type to “Currency”, it forces the other two drop downs which is where it yields the bug.

This BAQ will show you the values :slight_smile: and where they are used
CurrencySourceValues.baq (11.7 KB)

Apparently, I should have used the BAQ instead of Excel Query because I did that a couple weeks ago with no joy. :sweat:

It doesn’t appear to work all the same.
The same behavior occurs after setting those properties in code.

Got it working with the help of Rich Riley over at Epicor.
On initialize, I had to set the EpiBindingDocument to the Doc version of my control.
So, the control is bound to Total_c which holds the base currency.
Then, on initialize, I set epiCurrencyConver.EpiBindingDocument = “InvcHead.DocTotal_c”;
And for anyone else looking into this, you have to set the value of DocTotal_c yourself.

1 Like

If anyone is interested, this is how I got the control working:

EpiCurrencyConver Control.docx (288.5 KB)

3 Likes

@hmwillett,

I appreciated the write up on EpiCurrencyConver. I have a related question but first…

Business Case:
In the Project module, we’ve always wanted to do Revenue Recognition by Phase and not at the Project Level. So we have a little work-around where we choose the revenue amount (associated with the phase) but we do not want Epicor to remove the costs from the WBS Jobs because it does so equally across all open jobs. The user manually zero out the costs in the Recognition screen and I would like to automate that portion because if one forgets, it’s a lot of work to restore the costs to all of the jobs.

My issue is that the associated cost fields are of type EpiCurrencyConver and not an EpiCurrencyEditor and for the life of me, I cannot change the value of these controls. A little decomp shows this implements the IReadOnly interface. Bleh.

I only want to zero these out when the calculation method is set to “Manually Entered.” And this is one of those commands that creates the transaction upon Save and then clears the form. This might make it difficult to use Before or After Adapters since the based on Calculation could change between them.

A Pre-BPM could look at the Based On value and zero the costs without showing the user the costs were zeroed - as disconcerting that may be, although it would be reliable.

So I’m curious how the Customization Masters here would approach this situation…

Mark W.

Ended up doing a Method Directive (Pre) to get the job done - probably a more robust solution in the end but I’d like to know more about the EpiCurrencyConver.

Without playing with it, I would imagine you’d hook into a change event of the drop down, check to see if its current text is “Manually Entered” and, if so, zero out all 5 of the currency fields in the data view per control (Field, DocField, Rpt1Field, Rpt2Field, Rpt3Field), then commit the changes.

This was the rub. I could find no way to assign values to an EpiCurrencyConver directly. When looking at the decomp, all of those fields are private.

    private EpiCurrencyEditor curDocCurrency;
    private EpiCurrencyEditor curBaseCurrency;
    private EpiCurrencyEditor curRpt1;
    private EpiCurrencyEditor curRpt2;
    private EpiCurrencyEditor curRpt3;

Normally in a customization, we would use an EpiCurrencyEditor but these fields are EpiCurrencyConver. And I understand what Epicor is doing here. They created a class to encapsulate the currency functionality, which is a good idea. There must be a way to assign an EpiCurrencyEditor to each of these either through a binding or a method of some kind.

In this particular case, I couldn’t count on the user selecting Manual (for example, it was already set there) in which case, the code wouldn’t run. So the more resilient solution was to use the BPM and after testing with Finance, it’s working as designed as one might say. :wink:

But like you, and as a multi-currency user, I am interested in the architecture of this class and how to use it properly.

Mark W.

#NecroThread

More info on how to get the value from the control (not the binding) for those that are in need of that.
Updating EpiCurrencyConver field - ERP 10 - Epicor User Help Forum (epiusers.help)

1 Like

And, for what it’s worth, Kinetic App Studio makes this so much easier (shockingly!).

You add a Currency Box control and fill out the appropriate bindings.
Not sure if the Rpt1, Rpt2, and Rpt3 still exist, but the Base and Doc are there.

3 Likes