• Diane Clayton
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
Hi
I have latest version of salesforce cli and running sfdx plugins --core returns 
@salesforce/plugin-generator 0.0.10 (core)
@salesforce/sfdx-trust 1.0.8 (core)
builtins 1.0.0 (core)
salesforcedx 43.12.0 (core)

But  when I run  sfdx plugins:install salesforcedx@latest I get errors below:
Installing plugin salesforcedx...
Installing plugin salesforcedx... Checking for digital signature.
Successfully validated digital signature for salesforcedx.
Finished digital signature check. Installing... !
 !    yarn --non-interactive --mutex=file:C:\...\AppData\Local\sfdx\yarn
 !    --cache-folder=C:\Users\...\Local\sfdx\yarn exited with code 1
 !    warning salesforcedx > salesforce-alm > replace > minimatch@0.2.14: Please update to minimatch
 !    3.0.2 or higher to avoid a RegExp DoS issue
 !    warning salesforcedx > force-language-services > salesforce-alm > webdriverio > archiver > glob >
 !    minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
 !    warning salesforcedx > salesforce-alm > replace > nomnom@1.6.2: Package no longer supported.
 !    Contact support@npmjs.com for more info.
 !    warning salesforcedx > force-language-services > salesforce-alm > webdriverio > request >
 !    node-uuid@1.4.8: Use uuid module instead
 !    warning salesforcedx > salesforce-alm > jsonwebtoken > joi > hoek@2.16.3: The major version is no
 !    longer supported. Please update to 4.x or newer
 !    warning salesforcedx > force-language-services > salesforce-alm > webdriverio > request > hawk >
 !    hoek@0.9.1: The major version is no longer supported. Please update to 4.x or newer
 !    error An unexpected error occurred: "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz:
 !    Request failed \"503 Service Unavailable\""
Hi
I'm trying to do the Understanding Execution Context module challenge and I really can't see why this won't work. The following code says
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, AccountTrigger: execution of BeforeInsert caused by: System.SObjectException: DML statement cannot operate on trigger.new or trigger.old Class.AccountTriggerHandler.CreateAccounts:

trigger AccountTrigger on Account (before insert) { 
     if ( Trigger.isBefore && Trigger.isInsert)
     {
              AccountTriggerHandler.CreateAccounts(Trigger.new);
     }
    }

public class AccountTriggerHandler {
    public static void CreateAccounts(List<Account> Accnts)
    {
         List<Account> ValidAccounts = new List<Account>();
    
            for (Account a : Accnts) {
               a.ShippingState = a.billingState;
               
                ValidAccounts.add(a);
               
            }
    
            if (ValidAccounts.size() > 0) {
                insert ValidAccounts;
            }
    }
}
Hi
I have latest version of salesforce cli and running sfdx plugins --core returns 
@salesforce/plugin-generator 0.0.10 (core)
@salesforce/sfdx-trust 1.0.8 (core)
builtins 1.0.0 (core)
salesforcedx 43.12.0 (core)

But  when I run  sfdx plugins:install salesforcedx@latest I get errors below:
Installing plugin salesforcedx...
Installing plugin salesforcedx... Checking for digital signature.
Successfully validated digital signature for salesforcedx.
Finished digital signature check. Installing... !
 !    yarn --non-interactive --mutex=file:C:\...\AppData\Local\sfdx\yarn
 !    --cache-folder=C:\Users\...\Local\sfdx\yarn exited with code 1
 !    warning salesforcedx > salesforce-alm > replace > minimatch@0.2.14: Please update to minimatch
 !    3.0.2 or higher to avoid a RegExp DoS issue
 !    warning salesforcedx > force-language-services > salesforce-alm > webdriverio > archiver > glob >
 !    minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
 !    warning salesforcedx > salesforce-alm > replace > nomnom@1.6.2: Package no longer supported.
 !    Contact support@npmjs.com for more info.
 !    warning salesforcedx > force-language-services > salesforce-alm > webdriverio > request >
 !    node-uuid@1.4.8: Use uuid module instead
 !    warning salesforcedx > salesforce-alm > jsonwebtoken > joi > hoek@2.16.3: The major version is no
 !    longer supported. Please update to 4.x or newer
 !    warning salesforcedx > force-language-services > salesforce-alm > webdriverio > request > hawk >
 !    hoek@0.9.1: The major version is no longer supported. Please update to 4.x or newer
 !    error An unexpected error occurred: "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz:
 !    Request failed \"503 Service Unavailable\""
Hi
I'm trying to do the Understanding Execution Context module challenge and I really can't see why this won't work. The following code says
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, AccountTrigger: execution of BeforeInsert caused by: System.SObjectException: DML statement cannot operate on trigger.new or trigger.old Class.AccountTriggerHandler.CreateAccounts:

trigger AccountTrigger on Account (before insert) { 
     if ( Trigger.isBefore && Trigger.isInsert)
     {
              AccountTriggerHandler.CreateAccounts(Trigger.new);
     }
    }

public class AccountTriggerHandler {
    public static void CreateAccounts(List<Account> Accnts)
    {
         List<Account> ValidAccounts = new List<Account>();
    
            for (Account a : Accnts) {
               a.ShippingState = a.billingState;
               
                ValidAccounts.add(a);
               
            }
    
            if (ValidAccounts.size() > 0) {
                insert ValidAccounts;
            }
    }
}