• Frans Flippo 14
  • NEWBIE
  • 15 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 3
    Likes Received
  • 1
    Likes Given
  • 3
    Questions
  • 11
    Replies
Hi all,

I want to write a custom SFDX plugin so I'm following the instructions on https://www.salesforce.com/video/3594291/ and on https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_plugins.meta/sfdx_cli_plugins/cli_plugins_generate.htm .

However, I get the following error when following the steps in the video and executing bin/run hello:org:
›   Error: command hello:org not found

Somehow, on another plugin I generated in a similar way, this was working, but when I renamed the src/commands/hello folder and the src/commands/hello/org.ts files, the changes were not getting picked up.

I'm very new to Node development so maybe there's something that's completely obvious to seasoned Node developers that I'm missing here.

Do I need to manually compile the Typescript files to JS before I can run? If so, how do I do that?

If I run tsc on the project, I get:
node_modules/@sinonjs/fake-timers/types/fake-timers-src.d.ts:11:28 - error TS2304: Cannot find name 'queueMicrotask'.

11     queueMicrotask: typeof queueMicrotask;
                              ~~~~~~~~~~~~~~

node_modules/@types/jsforce/query.d.ts:71:13 - error TS2368: Type parameter name cannot be 'never'.

71     finally<never>(): Promise<T>;
               ~~~~~

Found 2 errors.
Could that be the problem? How do I fix it?

Any help would be appreciated!

Cheers,
Frans
I've got a test class that starts:
 
@IsTest
private class WarehouseCalloutServiceTest {
    
    @TestSetup
    public static void setup() {
        List<Product2> existingProducts = [ SELECT Id, StockKeepingUnit FROM Product2 ];
        System.debug('Existing products:');
        for (Product2 product : existingProducts) {
            System.debug('- ' + product);
        }
        
        // Insert equipment
        List<Product2> equipmentList = new List<Product2>();
        // Maintenance cycle changes
        equipmentList.add(new Product2(
            Name = 'Generator 1000 kW',
            Cost__c = 5000,
            Current_Inventory__c = 6,
            StockKeepingUnit  = '100003',
            Lifespan_Months__c = 0,
            Maintenance_Cycle__c = 730,
            Replacement_Part__c = false
        ));
        // No changes
        equipmentList.add(new Product2(
            Name = 'Cooling Fan',
            Cost__c = 300,
            Current_Inventory__c = 183,
            StockKeepingUnit  = '100004',
            Lifespan_Months__c = 0,
            Maintenance_Cycle__c = 0,
            Replacement_Part__c = true
        ));
        // Quantity changes
        equipmentList.add(new Product2(
            Name = 'Fuse 20A',
            Cost__c = 22,
            Current_Inventory__c = 144,
            StockKeepingUnit  = '100005',
            Lifespan_Months__c = 0,
            Maintenance_Cycle__c = 0,
            Replacement_Part__c = true
        ));
        // SKU 100006 doesn't exist yet
        System.debug('Inserting ' + equipmentList);
        insert equipmentList;        
    }

The loop that prints out existing products prints nothing.
However, the insert fails with an error: 
System.DmlException: Insert failed. First exception on row 0; first error: DUPLICATE_VALUE, A Equipment with this SKU already exists.: [StockKeepingUnit]

It's true that such a record already exists in my org. However, the tests are supposed to not see that data. So why is this insert failing?
Since a week or so I suddenly get `INVALID_SESSION_ID: Session expired or invalid` errors when trying to deploy to a sandbox. Around the same time, I suddenly started seeing the line `*** Deploying with REST ***` when running an `sfdx force:source:deploy`.

I never used to see my token expire before. Now I have to daily go and re-auth my org connection.

This seems like a regression. What's going on?
Hi all,

I want to write a custom SFDX plugin so I'm following the instructions on https://www.salesforce.com/video/3594291/ and on https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_plugins.meta/sfdx_cli_plugins/cli_plugins_generate.htm .

However, I get the following error when following the steps in the video and executing bin/run hello:org:
›   Error: command hello:org not found

Somehow, on another plugin I generated in a similar way, this was working, but when I renamed the src/commands/hello folder and the src/commands/hello/org.ts files, the changes were not getting picked up.

I'm very new to Node development so maybe there's something that's completely obvious to seasoned Node developers that I'm missing here.

Do I need to manually compile the Typescript files to JS before I can run? If so, how do I do that?

If I run tsc on the project, I get:
node_modules/@sinonjs/fake-timers/types/fake-timers-src.d.ts:11:28 - error TS2304: Cannot find name 'queueMicrotask'.

11     queueMicrotask: typeof queueMicrotask;
                              ~~~~~~~~~~~~~~

node_modules/@types/jsforce/query.d.ts:71:13 - error TS2368: Type parameter name cannot be 'never'.

71     finally<never>(): Promise<T>;
               ~~~~~

Found 2 errors.
Could that be the problem? How do I fix it?

Any help would be appreciated!

Cheers,
Frans
Since a week or so I suddenly get `INVALID_SESSION_ID: Session expired or invalid` errors when trying to deploy to a sandbox. Around the same time, I suddenly started seeing the line `*** Deploying with REST ***` when running an `sfdx force:source:deploy`.

I never used to see my token expire before. Now I have to daily go and re-auth my org connection.

This seems like a regression. What's going on?
Hi all,

I want to write a custom SFDX plugin so I'm following the instructions on https://www.salesforce.com/video/3594291/ and on https://developer.salesforce.com/docs/atlas.en-us.sfdx_cli_plugins.meta/sfdx_cli_plugins/cli_plugins_generate.htm .

However, I get the following error when following the steps in the video and executing bin/run hello:org:
›   Error: command hello:org not found

Somehow, on another plugin I generated in a similar way, this was working, but when I renamed the src/commands/hello folder and the src/commands/hello/org.ts files, the changes were not getting picked up.

I'm very new to Node development so maybe there's something that's completely obvious to seasoned Node developers that I'm missing here.

Do I need to manually compile the Typescript files to JS before I can run? If so, how do I do that?

If I run tsc on the project, I get:
node_modules/@sinonjs/fake-timers/types/fake-timers-src.d.ts:11:28 - error TS2304: Cannot find name 'queueMicrotask'.

11     queueMicrotask: typeof queueMicrotask;
                              ~~~~~~~~~~~~~~

node_modules/@types/jsforce/query.d.ts:71:13 - error TS2368: Type parameter name cannot be 'never'.

71     finally<never>(): Promise<T>;
               ~~~~~

Found 2 errors.
Could that be the problem? How do I fix it?

Any help would be appreciated!

Cheers,
Frans
When I attempt to push metadata to my scratch org, I get this error.
 
The formula references fields across 16 relationships while only 15 are allowed. Please contact support at salesforce.com for more assistance.

There are salesforce help documents  (https://help.salesforce.com/articleView?id=000315562&type=1&mode=1) that explain how to increase this limit (up to 20) for a sandbox/production org, but I can't find any documentation on how to increase this for a scratch org.

Having to contact support to increase the limit on a scratch org is not a suitable answer as scratch orgs are meant to be quick and easy to spin up development environments, that would run completely counter to that.

Is there a scratch org configuration value that I can't find that would increase the number of formula references I can have? I've tried including
AddCustomRelationships:<value>
in my scratch org definition file (used 10 for the value), but that didn't work. I don't think that scratch org feature is related to spanning relationships.
 
I've got a test class that starts:
 
@IsTest
private class WarehouseCalloutServiceTest {
    
    @TestSetup
    public static void setup() {
        List<Product2> existingProducts = [ SELECT Id, StockKeepingUnit FROM Product2 ];
        System.debug('Existing products:');
        for (Product2 product : existingProducts) {
            System.debug('- ' + product);
        }
        
        // Insert equipment
        List<Product2> equipmentList = new List<Product2>();
        // Maintenance cycle changes
        equipmentList.add(new Product2(
            Name = 'Generator 1000 kW',
            Cost__c = 5000,
            Current_Inventory__c = 6,
            StockKeepingUnit  = '100003',
            Lifespan_Months__c = 0,
            Maintenance_Cycle__c = 730,
            Replacement_Part__c = false
        ));
        // No changes
        equipmentList.add(new Product2(
            Name = 'Cooling Fan',
            Cost__c = 300,
            Current_Inventory__c = 183,
            StockKeepingUnit  = '100004',
            Lifespan_Months__c = 0,
            Maintenance_Cycle__c = 0,
            Replacement_Part__c = true
        ));
        // Quantity changes
        equipmentList.add(new Product2(
            Name = 'Fuse 20A',
            Cost__c = 22,
            Current_Inventory__c = 144,
            StockKeepingUnit  = '100005',
            Lifespan_Months__c = 0,
            Maintenance_Cycle__c = 0,
            Replacement_Part__c = true
        ));
        // SKU 100006 doesn't exist yet
        System.debug('Inserting ' + equipmentList);
        insert equipmentList;        
    }

The loop that prints out existing products prints nothing.
However, the insert fails with an error: 
System.DmlException: Insert failed. First exception on row 0; first error: DUPLICATE_VALUE, A Equipment with this SKU already exists.: [StockKeepingUnit]

It's true that such a record already exists in my org. However, the tests are supposed to not see that data. So why is this insert failing?
Since a week or so I suddenly get `INVALID_SESSION_ID: Session expired or invalid` errors when trying to deploy to a sandbox. Around the same time, I suddenly started seeing the line `*** Deploying with REST ***` when running an `sfdx force:source:deploy`.

I never used to see my token expire before. Now I have to daily go and re-auth my org connection.

This seems like a regression. What's going on?
Hello everyone,

I'm working on the intranet of our company, which has been set up through Visualforce pages.

Currently the URL reads something similar to : company--c.eu8.visual.force.com/apex

Is it possible to change company--c.eu8(.visual.force) to simply intranet?

It's important to note that this is an internal site, only employees with Salesforce credentials can access this site. 

Thanks a lot for any help
Is it possible to customize the email notifications sent to users for Chatter events?

More specifically, when a user creates a feed item, gets a comment to a feed item or comments following theirs, Salesforce sends an email notification. I couldn't find any email template, nor trigger, nor any other means to change the email content.

I was searching and found in the following links that that was not possible.

http://salesforce.stackexchange.com/questions/7734/how-to-customize-the-email-template-on-chatter-posts
https://success.salesforce.com/ideaView?id=08730000000HA1sAAG#

As the replies and idea were created many years ago, I would like to know if it still is not possible to customize the email notification sent to the users. If that is still the case, what are the alternatives? Should I mass update all the users preferences to not be notified on Chatter events and create a trigger to email users with a custom email template for all these events (feed creation and comments).

In my current development org, I add a custom link on an object which is defined in a managed package. Now I am trying to persist the metadata and then migrate this custom link to another org. According to Force.com Migration Tool Guide, <Type> element with value 'Weblink' should be manually specified in package.xml. It also says, 'this type is retrieved or deployed as part of a custom object file. You must dot-qualify the object name before the component name.'. I put it like the following code in package.xml but it is not grabbing any custom link metadata in the custom object as is expected. Any comments would be highly appreciated.

 

<types>
    <members>[packagePrefix.customObject__c].[customLinkName]</members>
    <name>Weblink</name>
</types>

 

 

  • December 14, 2010
  • Like
  • 0
When I attempt to push metadata to my scratch org, I get this error.
 
The formula references fields across 16 relationships while only 15 are allowed. Please contact support at salesforce.com for more assistance.

There are salesforce help documents  (https://help.salesforce.com/articleView?id=000315562&type=1&mode=1) that explain how to increase this limit (up to 20) for a sandbox/production org, but I can't find any documentation on how to increase this for a scratch org.

Having to contact support to increase the limit on a scratch org is not a suitable answer as scratch orgs are meant to be quick and easy to spin up development environments, that would run completely counter to that.

Is there a scratch org configuration value that I can't find that would increase the number of formula references I can have? I've tried including
AddCustomRelationships:<value>
in my scratch org definition file (used 10 for the value), but that didn't work. I don't think that scratch org feature is related to spanning relationships.