Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics 365 | Integration, Dataverse...
Unanswered

Solution checker - Strict mode error appear even after placing Use Strict command

Posted on by 85

Hi All,


I am stuck with an issue where I am trying to get a clean chit from solution checker and it keeps complaining of the Strict mode requirement and throws up error "Strict mode is a way to introduce better error-checking into your code. Code should run in strict mode wherever possible.".

I have added the Use Strict command both in the start of the file as well as the function start, but no luck. Can any one please advice what else I could be missing.

My code is as below:

"use strict";
if (typeof CM === "undefined")
{
CM = {}
}

if (typeof CM.UI === "undefined")
{
CM.UI = {}
}

if (typeof CM.UI.Adjustment === "undefined")
{
CM.UI.Adjustment = {}
}

CM.UI.Adjustment.Grid = new function ()
{
"use strict";
this.openQuickCreateForm = function (SelectedEntityTypeName, PrimaryEntityTypeName, FirstPrimaryItemId, PrimaryControl, SelectedControl)
{
let selectedControl = SelectedControl;

if (PrimaryEntityTypeName.toLowerCase() !== "nty_contract")
{
// Calling OOB command for opening quick create form TODO
return;
}

let triggeredSubgrid = selectedControl.name.toLowerCase();
let adhocFlag = false;
switch (triggeredSubgrid)
{
case "subgrid_adjustmentsadhoc":
adhocFlag = true;
break;
case "subgrid_adjustments":
break;
default:
// Calling command for opening quick create form
//TODO
break;
}

let formOptions = {
"entityName": SelectedEntityTypeName,
"cmdBar": false,
"createFromEntity": { entityType: PrimaryEntityTypeName, id: FirstPrimaryItemId },
"navbar": "off",
"windowPosition": "side",
"useQuickCreateForm": true
}

let formParameters = {
"avo_adhoc": adhocFlag
}

SA.Xrm.Navigation.openForm(formOptions, formParameters);
}

this.enableButtonOnSubgrid = function (SelectedControl)
{
let applicableSubgrids = [
"subgrid_adjustmentsadhoc",
"subgrid_adjustments",
"subgrid_mrs_scheduleadjustments"
]
let controlName = SelectedControl.name.toLowerCase();
return applicableSubgrids.includes(controlName.toLowerCase());
}
}

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Solution checker - Strict mode error appear even after placing Use Strict command

    Hi MajidMohammed,

    You can refer the following links:

    (+) Powerapps solution checker use strict issue - Dynamics 365 General Forum Community Forum

    What the solution checker does and why you should use it – Hosk's Dynamic Blog (wordpress.com) 

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans