back to top

Error with Currency Controls in Infor CRM Web 8.3.08

I recently have run into a really frustrating behavior of the Currency control in the Infor CRM web client. Running in an 8.3.08 system, the following issues exist out of the box:

If you bring up the edit screen for an Opportunity Product, you can see this issue with the Currency control.

By default this screen has the Currency control for the adjusted price set up to 4 decimals. Why? Who knows, but it does. Lets try out some scenarios:

Type in “4” into the Adjusted Price(Base) field.
This works successfully and calculates the Discount and the Extended Price just fine:

Type in “4.0” into the Adjusted Price(Base) field. Tab out of it.
This works successfully and calculates the Discount and the Extended Price just fine:

Type in “4.0” into the Adjusted Price(Base) field. Click out of it.
This throws a server error on the change event of the field:

This is coming from a standard rule in the compiled BusinessRule assembly UpdateDiscountFromCalculatedSales. In this code it calls another supposrting method called GetDiscountPercentFromBaseAndDiscountedPrices with this lovely line of code:

opportunityProduct.Discount = new double?(GetDiscountPercentFromBaseAndDiscountedPrices(opportunityProduct.Price.Value, opportunityProduct.CalculatedPrice.Value));

The problem is the the CalculatedPrice field at this point is null and does not have a value. The reason?

Well if you close the error popup and look at the Currency control, a client side validator has stated 4.1 is not a valid number.

Note that the currency control has added the remaining 3 digits to make the number you entered show “4.0000” instead of “4.0”. Nice coding.

This continues on where clicking out of the field causes an error until you actually type in the correct number of decimals, like “4.0000”. Tabbing out of the field doesn’t throw the error regardless of the number of decimals.

How do we fix this? Well you could override the Currency controls by adding your own module and loading it, just like you do for Activity customizations. Lets do it a bit different and modify the core.master file. This is the main master file that all the other masters inherit from, so adding javascript code here will essentially wire it up everywhere.

Open the core.master file. At the very end before the closing tags for body and html, you can add this code:

<script type="text/javascript">
    require(['dojo/aspect', 'dojo/_base/lang', 'Sage/UI/Controls/CurrencyTextBox'], function (aspect, lang, CurrencyTextBox) {         

        // force control to validate on blur 
        aspect.after(Sage.UI.Controls.CurrencyTextBox.prototype, 'onBlur', function () {  this.validate(); });

        // modify onChanged to only trigger postback if control has passed validation 
        lang.extend(CurrencyTextBox, {
            onChanged: function (e) {
                if (this.shouldPublishMarkDirty) {
                    dojo.publish('Sage/events/markDirty');
                }

                if (this.autoPostBack) {
                    if (Sys) {
                        if (this.isValid()) { // make sure is valid before triggering postback 
                            Sys.WebForms.PageRequestManager.getInstance()._doPostBack(this.id, null);
                        }
                        else {
                            this.reset();
                        }
                    }
                }
            }
        });
            
    });
</script>

This code adds code after the CurrencyControl dojo widget’s onBlur function, to call the validate function. This will make the validation occur both when tabbing out and when clicking out of the control.

The other code is extending the CurrencyControl widget using extend to override the default onChanged function. The reason for this code is because in the standard code, if the user input fails validation it still fires the postback despite there not being a valid value. This will cause problems if you have a postback on the change action of a field expecting a value.

Contact Customer FX for your CRM project
We let our expertise speak for itself - let us know how our all-star team can help on your CRM project
About the Author
Kris Halsrud
Kris Halsrud
Kris Halsrud is a Senior Analyst / Developer for Customer FX Corporation.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Infor CRM Sync for Exchange: Action Required by August 31, 2026

Using Infor CRM Sync for Exchange with Microsoft 365? Your Exchange administrator must update tenant settings by August 31, 2026 to prevent sync disruption.

[Webinar] What’s Coming Next for Infor CRM SLX and Why v10 Matters

See what’s coming next for Infor CRM SLX, including new marketing workflows, automation improvements, and reasons to consider upgrading to v10.

Disable Caching in Infor CRM SLX Web Client

In the rare case caching is causing issues in the Infor CRM SLX web client, it is possible to disable specific types of caching by making edits using Application Architect, and then deploying.

Exploring AI Options for Infor CRM v10

I've started taking a closer look at the AI capabilities built into Infor CRM v10. Over the next several posts, I'll share what I learn. From the built-in features and supported AI providers to implementation considerations, costs, and practical use cases.

Infor CRM SLX 10.0: Delegate Ownership Changes for “Everyone” Records

Learn how the new EveryoneOwnerAssignment secured action in Infor CRM SLX 10.0 allows designated users to change ownership of Everyone-owned records without requiring Administrator access.

Related Articles

Infor CRM Sync for Exchange: Action Required by August 31, 2026

Using Infor CRM Sync for Exchange with Microsoft 365? Your Exchange administrator must update tenant settings by August 31, 2026 to prevent sync disruption.

[Webinar] What’s Coming Next for Infor CRM SLX and Why v10 Matters

See what’s coming next for Infor CRM SLX, including new marketing workflows, automation improvements, and reasons to consider upgrading to v10.

Disable Caching in Infor CRM SLX Web Client

In the rare case caching is causing issues in the Infor CRM SLX web client, it is possible to disable specific types of caching by making edits using Application Architect, and then deploying.

Exploring AI Options for Infor CRM v10

I've started taking a closer look at the AI capabilities built into Infor CRM v10. Over the next several posts, I'll share what I learn. From the built-in features and supported AI providers to implementation considerations, costs, and practical use cases.

Related Videos