web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Solution Checker - Str...
Power Apps
Unanswered

Solution Checker - Strict mode error even after placing Use Strict command

(0) ShareShare
ReportReport
Posted on by 56
Hello 

i am having troubles fixing this Javascript code, can u help me guys? I have added "use strict" under those function calls:

JS
 
****
function formatSICField(executionContext) {
    "use strict"; 
    if (executionContext && typeof executionContext.getFormContext === 'function') {
        var formContext = executionContext.getFormContext();
        if (formContext) {
            var sicAttribute = formContext.getAttribute("sic");
            if (sicAttribute) {
                var sicField = sicAttribute.getValue();
                if (sicField && sicField.length === 6) {
                    var formattedSIC = sicField.replace(/(\d{2})(\d{2})(\d{2})/, "$1.$2.$3");
                    sicAttribute.setValue(formattedSIC);
                }
            }
        }
    }
}
function validateSICField(executionContext) {
    "use strict"; 
    if (executionContext && typeof executionContext.getFormContext === 'function') {
        var formContext = executionContext.getFormContext();
        if (formContext) {
            var sicAttribute = formContext.getAttribute("sic");
            if (sicAttribute) {
                var sicField = sicAttribute.getValue();
                var regex = /^\d{2}\.\d{2}\.\d{2}$/;
                var sicControl = formContext.getControl("sic");
                if (sicField && !regex.test(sicField) && sicControl) {
                    sicControl.setNotification("Formato invalido. Si prega di usare il formato 00.00.00.");
                } else if (sicControl) {
                    sicControl.clearNotification();
                }
            }
        }
    }
}

****
 
I have the same question (0)
  • BluFin.S Profile Picture
    56 on at
    No one is willing to help :(

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 545 Most Valuable Professional

#2
Haque Profile Picture

Haque 314

#3
Kalathiya Profile Picture

Kalathiya 234 Super User 2026 Season 1

Last 30 days Overall leaderboard