• Dave Craigmile
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 6
    Replies
We are seeing what I consider to be a serious platform bug.  Queries in our package that include fields(standard) are failing in single-currency orgs like this:
 
System.QueryException: No such column 'CurrencyIsoCode' on entity 'rtms__Driver__c'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.
 
The query in question does NOT directly refer to the currency field in the select clause. So it appears that fields(standard) incorrecly includes the currency field in single-currency orgs.
 
Is this a serious platform bug or am I missing something?  Thanks.
forceignore is broken with Winter 2021.  I can neither deploy to nor retrieve from the org I am connected to by right-clicking on the package.xml file in my VSCode project.  That used to work fine.

Here is my forceignore:

**/jsconfig.json
**/__tests__/**
**/.eslintrc.json

Here is the error I get when I try to deploy source to org:
 
tarting Conflict Detection: converting org source

16:08:53.472 sfdx force:mdapi:convert --rootdir C:\Users\Dave2\AppData\Local\Temp\.sfdx\tools\conflicts\TMS Source Org\unpackaged --outputdir C:\Users\Dave2\AppData\Local\Temp\.sfdx\tools\conflicts\TMS Source Org\converted
(node:4856) Warning: The .forceignore file doesn't adhere to .gitignore format which will be the default behavior starting in Spring '21 release. More information on .gitignore format here: https://git-scm.com/docs/gitignore. Fix the following lines in your .forceignore and add '# .forceignore v2' to your .forceignore file to switch to the new behavior.
(node:4856) Warning: 	**\jsconfig.json
ERROR running force:mdapi:convert:  An error was encountered processing path: C:\Users\Dave2\AppData\Local\Temp\.sfdx\tools\conflicts\TMS Source Org\unpackaged\applications\Transportation.app
16:09:04.164 sfdx force:mdapi:convert --rootdir C:\Users\Dave2\AppData\Local\Temp\.sfdx\tools\conflicts\TMS Source Org\unpackaged --outputdir C:\Users\Dave2\AppData\Local\Temp\.sfdx\tools\conflicts\TMS Source Org\converted
 ended with exit code 1

An error was encountered during conflict detection. (node:4856) Warning: The .forceignore file doesn't adhere to .gitignore format which will be the default behavior starting in Spring '21 release. More information on .gitignore format here: https://git-scm.com/docs/gitignore. Fix the following lines in your .forceignore and add '# .forceignore v2' to your .forceignore file to switch to the new behavior.
(node:4856) Warning: 	**\jsconfig.json
ERROR running force:mdapi:convert:  An error was encountered processing path: C:\Users\Dave2\AppData\Local\Temp\.sfdx\tools\conflicts\TMS Source Org\unpackaged\applications\Transportation.app
Any thoughts?  Following the instructions in the error message does nothing.  I am on the latest of everything....

Thanks.


 

I have an LWC component that starts a timer (see timer code below).

This works just fine but the LWC is on a record page.  When I navigate to several records sequentially the timers multiply like rabbits.  One per visited record even though the component is visually "gone" between navigations from the list view to the record page.

How can I stop the timer embedded in the LWC when a record page is refreshed or navigated away from? 

In other words, what component event hook can I use from within the LWC itself to stop the timer?

Thanks!


startTimer() {
        let interval = this._loadLock ? (new Date(this._loadLock.Expiration__c)).getTime() - new Date().getTime() : 60000;
        let elem = this.template.querySelector('span.countdown');
        let refreshMe = this._wiredValue;
        let timer = window.setInterval(
            
            function() {
                
                let minutes = Math.floor((interval % (1000 * 60 * 60)) / (1000 * 60));
                let seconds = Math.floor((interval % (1000 * 60)) / 1000);
                elem.innerHTML = minutes + "m " + seconds + "s "; 
                if(interval <= 0) {
                    interval = 60000;
                    refreshApex(refreshMe);
                }                
                else if(interval != 60000 && seconds == 0) {
                    refreshApex(refreshMe);
                }                
                interval = interval - 1000;}, 
            1000);
        this._timerPointer = timer;
    }
 

Newbie question.  I have a simple LWC component where I am using imperative apex to return a List<Custom Apex Class> that is not wired or cacheable.  I want to immediately display this data in the component.

What "hook" should I use to invoke my imperative apex?.  Here is my current code but I have got to believe there is an easier way to display data on the 'open' of a component when you cannot use @wire or the other pre-cooked approaches.

import { LightningElement, api, wire } from 'lwc';
import getStatusList from '@salesforce/apex/BrokerLoadStatus2Controller2.getStatusList';
export default class BrokerLoadStatus extends LightningElement {
    @api recordId;    
    statusList;
    error;
    constructor() {
        super();
        this.firstTime = true;
    }
    renderedCallback() {
        if(this.firstTime) {
            this.getLoadStatus();
            this.firstTime = false;
        }
    }
    getLoadStatus() {        
        getStatusList({loadId: this.recordId})
            .then(result => {
                this.statusList = result;
                this.error = undefined;
            })
            .catch(error => {
                this.statusList = undefined;
                this.error = error;
            });
    }    
}
// EOF
Can someone provide a task.json example file so my build shortcut pushes just the changed files to a DE org?  NOT a scratch org.

An example file would be great.  Thanks!
I have created an empy remote GIT repository on Cloud Forge and am able to connect it to a VS Code project no problem using the GIT Initialize Repository command.

However the repo connection took place after I provided the URL but WITHOUT ASKING FOR A PASSWORD.  I was able to push all my files from VS Code to the remote repo without entering a password.

So, how do I secure my remote repo so a password is at least required the first time I push from VS Code?

I have the canonical installation of Salesforce DX as defined in the help documents.

Thanks!

 
Help! I have code (shown below) that tries to instantiate a Visualforce page whose name is stored in a table column (known only at runtime, say, "MyCustomPage").

The page to be instantiated is NOT in our managed package, but the code trying to instantiate it IS in our managed package.

The Salesforce runtime appends our namespace to the name and thus the page cannot be found or instantiated. How can I get the runtime to butt out and not try to rename my page URL string?

(1) The managed package code that creates the page reference:

public PageReference getPageReference(Id documentOptionsId) {

TMSDocumentOverride__c over = DB.getTMSDocumentOverride(documentOptionsId, this.getId());
    if(over != null && over.Page_Override__c != null) {
        return new PageReference('/apex/' + over.Page_Override__c);
    } 
etc...

(2) I want "return new PageReference('/apex/' + over.Page_Override__c);" to return a PageReference pointing to /apex/MyCustomPage

(3) Instead, it tries to instantiate "/apex/rtms__MyCustomPage" where "rtms__" is my package namespace. Ugh.

How do I get the runtime to leave my URL alone so it instantiates /apex/MyCustomPage NOT /apex/rtms__MyCustomPage??

Thanks!
forceignore is broken with Winter 2021.  I can neither deploy to nor retrieve from the org I am connected to by right-clicking on the package.xml file in my VSCode project.  That used to work fine.

Here is my forceignore:

**/jsconfig.json
**/__tests__/**
**/.eslintrc.json

Here is the error I get when I try to deploy source to org:
 
tarting Conflict Detection: converting org source

16:08:53.472 sfdx force:mdapi:convert --rootdir C:\Users\Dave2\AppData\Local\Temp\.sfdx\tools\conflicts\TMS Source Org\unpackaged --outputdir C:\Users\Dave2\AppData\Local\Temp\.sfdx\tools\conflicts\TMS Source Org\converted
(node:4856) Warning: The .forceignore file doesn't adhere to .gitignore format which will be the default behavior starting in Spring '21 release. More information on .gitignore format here: https://git-scm.com/docs/gitignore. Fix the following lines in your .forceignore and add '# .forceignore v2' to your .forceignore file to switch to the new behavior.
(node:4856) Warning: 	**\jsconfig.json
ERROR running force:mdapi:convert:  An error was encountered processing path: C:\Users\Dave2\AppData\Local\Temp\.sfdx\tools\conflicts\TMS Source Org\unpackaged\applications\Transportation.app
16:09:04.164 sfdx force:mdapi:convert --rootdir C:\Users\Dave2\AppData\Local\Temp\.sfdx\tools\conflicts\TMS Source Org\unpackaged --outputdir C:\Users\Dave2\AppData\Local\Temp\.sfdx\tools\conflicts\TMS Source Org\converted
 ended with exit code 1

An error was encountered during conflict detection. (node:4856) Warning: The .forceignore file doesn't adhere to .gitignore format which will be the default behavior starting in Spring '21 release. More information on .gitignore format here: https://git-scm.com/docs/gitignore. Fix the following lines in your .forceignore and add '# .forceignore v2' to your .forceignore file to switch to the new behavior.
(node:4856) Warning: 	**\jsconfig.json
ERROR running force:mdapi:convert:  An error was encountered processing path: C:\Users\Dave2\AppData\Local\Temp\.sfdx\tools\conflicts\TMS Source Org\unpackaged\applications\Transportation.app
Any thoughts?  Following the instructions in the error message does nothing.  I am on the latest of everything....

Thanks.


 

I have an LWC component that starts a timer (see timer code below).

This works just fine but the LWC is on a record page.  When I navigate to several records sequentially the timers multiply like rabbits.  One per visited record even though the component is visually "gone" between navigations from the list view to the record page.

How can I stop the timer embedded in the LWC when a record page is refreshed or navigated away from? 

In other words, what component event hook can I use from within the LWC itself to stop the timer?

Thanks!


startTimer() {
        let interval = this._loadLock ? (new Date(this._loadLock.Expiration__c)).getTime() - new Date().getTime() : 60000;
        let elem = this.template.querySelector('span.countdown');
        let refreshMe = this._wiredValue;
        let timer = window.setInterval(
            
            function() {
                
                let minutes = Math.floor((interval % (1000 * 60 * 60)) / (1000 * 60));
                let seconds = Math.floor((interval % (1000 * 60)) / 1000);
                elem.innerHTML = minutes + "m " + seconds + "s "; 
                if(interval <= 0) {
                    interval = 60000;
                    refreshApex(refreshMe);
                }                
                else if(interval != 60000 && seconds == 0) {
                    refreshApex(refreshMe);
                }                
                interval = interval - 1000;}, 
            1000);
        this._timerPointer = timer;
    }
 

Can someone provide a task.json example file so my build shortcut pushes just the changed files to a DE org?  NOT a scratch org.

An example file would be great.  Thanks!
I have created an empy remote GIT repository on Cloud Forge and am able to connect it to a VS Code project no problem using the GIT Initialize Repository command.

However the repo connection took place after I provided the URL but WITHOUT ASKING FOR A PASSWORD.  I was able to push all my files from VS Code to the remote repo without entering a password.

So, how do I secure my remote repo so a password is at least required the first time I push from VS Code?

I have the canonical installation of Salesforce DX as defined in the help documents.

Thanks!