• AD1418
  • NEWBIE
  • 5 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 3
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 9
    Replies
Hi Folks,

Has anyone implemented any scenario to fetch multi select picklist values in lwc dynamically ?

Thanks
 
  • August 28, 2020
  • Like
  • 0
Hi All,

LWC intellisense(autocomplete) is not working in HTML file for lwc in vs code. I have all the salesforce extensions installed. Also, I have tried reinstalling both vs cdoe, CLI and extensions too. Still the same issue.
Have been using this for so long but all of sudden, I was stuck with this yesterday. Can somebody assist here.

Thanks
Hi Folks,

Can we call a vf page inside lwc? Can someone please assist me here. Thanks in advance.
Hi Folks,

I am trying to retrieve document metadata from my org, while retrieving via vs code CLI, I am getting issue like " invalid table size Allocation failed - JavaScript heap out of memory". Has anybody faced this before ???
Hi Folks,

Whenever I am trying to run a command like create project or any other command related to CLI extensions, I am getting error like :- 
'Command 'SFDX: Create Project' resulted in an error (command 'sfdx.force.project.create' not found)'. All of a sudden this happened. I tried uninstalling and re-installing again, but no luck. Can someone assist me here.

Thanks
Hi All,

I need some suggestions on custom file download functionality in salesforce. 
Facing the issue in Einstein data preparation challenge 3 :-

'Challenge Not yet complete... here's what's wrong:
We can't confirm you found the correct values. Please check your work'.

Below is the json for 'Load Seed Bank Agencies' dataflow:-
 
{
  "Filter Agency Records": {
    "action": "filter",
    "parameters": {
      "filter": "IsAgency:EQ:TRUE",
      "source": "ID Agency Records"
    }
  },
  "Load Account": {
    "action": "sfdcDigest",
    "parameters": {
      "fields": [
        {
          "name": "AccountNumber"
        },
        {
          "name": "Name"
        },
        {
          "name": "Phone"
        },
        {
          "name": "ShippingCity"
        },
        {
          "name": "ShippingCountry"
        },
        {
          "name": "ShippingPostalCode"
        },
        {
          "name": "ShippingState"
        },
        {
          "name": "ShippingStreet"
        }
      ],
      "object": "Account"
    }
  },
  "Create Seed Bank Agencies": {
    "action": "sfdcRegister",
    "parameters": {
      "name": "Seed Bank Agencies",
      "alias": "seed_bank_agencies",
      "source": "Filter Agency Records"
    }
  },
  "Add Agency Fields": {
    "action": "augment",
    "parameters": {
      "right_key": [
        "AccountNumber"
      ],
      "left": "Load Account",
      "left_key": [
        "AccountNumber"
      ],
      "right_select": [
        "AccountNumber",
        "Currency",
        "Acres",
        "SubRegion",
        "Region",
        "Latitude",
        "Longitude"
      ],
      "right": "Load Agency Detail",
      "relationship": "AgencyDetail",
      "operation": "LookupSingleValue"
    }
  },
  "Load Agency Detail": {
    "action": "edgemart",
    "parameters": {
      "alias": "Agency_Detail"
    }
  },
  "ID Agency Records": {
    "action": "computeExpression",
    "parameters": {
      "source": "Add Agency Fields",
      "mergeWithSource": true,
      "computedFields": [
        {
          "name": "IsAgency",
          "saqlExpression": "case when Phone is not null then \"TRUE\" else \"FALSE\" end",
          "label": "IsAgency",
          "type": "Text"
        }
      ]
    }
  }
}
Can somebody please help, as I have tried already with two dev orgs.

Thanks in advance.

 
Hi Folks,

I was using vscode and all of sudden I wasnt able to create components and faced npm issue :-

'npm' is not recognized as an internal or external command,
operable program or batch file.

User-added imageUser-added image
Need some assistance on resolving this. Can someone plz help here.

Thanks
Hi Folks,

I am facing issue in lwc datatable search. The search results are not getting displayed. below is the code:-

Apex Controller:
public with sharing class issueLogController {
    
     @AuraEnabled(cacheable=true)
    public static list<Issue_Log__c> searchLoggedIssues(String searchKey, String sortBy, String sortDirection){
        
        string query = 'select Id, Name, Issue_Description__c, Issue_Priority__c, Resolved__c from Issue_Log__c';
        if(searchKey != null && searchKey != ''){
            string key = '%' + searchKey + '%';
            query += 'where Name LIKE :key';

        }
        if(sortBy != null && sortDirection != null){
            query += 'ORDER BY ' + sortBy + ' ' + sortDirection;
        }
        return Database.query(query);
    }
}

html :-
 
<template>
    <lightning-card title="Logged Issues Search" >
        <div class="slds-m-around_medium">
            <lightning-input type="search" onchange={handleKeyChange} class="slds-m-bottom_small" label="search"
                                value={searchKeyword}>
            <lightning-datatable key-field="id" data={data} columns={cols} sorted-by={sortedBy} 
                                sorted-direction={sortedDirection} onsort={sortColumns} >

            </lightning-datatable>

            </lightning-input>
        </div>
    </lightning-card>
    
</template>

js file :-
 
import { LightningElement, api, track, wire } from 'lwc';
import searchLoggedIssues from '@salesforce/apex/issueLogController.searchLoggedIssues';
import {ShowToastEvent} from 'lightning/platformShowToastEvent';
import {refreshApex} from '@salesforce/apex';

const columns = [
    {label: 'Issue Log Name', fieldName: 'Name', sortable: true},
    {label: 'Issue Description', fieldName: 'Issue_Description__c', sortable: true},
    {label: 'Issue Priority', fieldName: 'Issue_Priority__c', sortable: true},
    {label: 'Issue Type', fieldName: 'Issue_Type__c', sortable: true},
    {label: 'Issue Resolved ?', fieldName: 'Resolved__c', type: 'boolean'}
    
    ];

export default class IssueListSearchChildLwC extends LightningElement {

    @track cols = columns;
    @track error;
    @track data;

    @api sortedBy = 'Name';
    @api sortedDirection = 'asc';
    @api searchKeyword = '';

    @track result;

    @wire(searchLoggedIssues, {
        searchKey: '$searchKeyword',
        sortBy: '$sortedBy',
        sortDirection: '$sortedDirection'
    })
    getIssues(result){
        this.result = result;
        if(result.data){
            this.data = result.data;
        } else if(result.error){
            this.error = result.error;
        }
        console.log('test******');
    }

    sortColumns(event){
        this.sortedBy = event.detail.fieldName;
        this.sortedDirection = event.detail.sortDirection;
        return refreshApex(this.result);
    }

    handleKeyChange(event){
          this.searchKeyword = event.target.value;
          return refreshApex(this.result);
      }
}
Need some assistance on this. Any help will be much appreciated.

Thanks
​​​​​​​
  • April 30, 2020
  • Like
  • 0
How to cover exception code in below class :- Below is apex class - 
public class CRM_ForecastCommentary {
    @AuraEnabled
    public static void saveLFCommentary(String liveForecastId , String comment){
        CRM_Live_Forecast__c[] LFlst = new List<CRM_Live_Forecast__c>();
        CRM_Live_Forecast__c FLtoUpdate;
        Id LFId = Id.valueOf(liveForecastId);
        try {
            insert LFlst;       
            FLtoUpdate =  [SELECT Name , Id , CRM_Comment__c FROM CRM_Live_Forecast__c
           WHERE Id =: LFId ];    
            // Update the comment.
            FLtoUpdate.CRM_Comment__c = comment;
            // Make the update call.
            update FLtoUpdate;
        } catch(DmlException e) {
            System.debug('An unexpected error has occurred: ' + e.getMessage());
            // Verify that the comment s updated.
            CRM_Live_Forecast__c afterUpdate = [SELECT CRM_Comment__c FROM CRM_Live_Forecast__c WHERE Id =: LFId];
            System.assertEquals(comment, afterUpdate.CRM_Comment__c);
            
        }
    }
	
    @AuraEnabled
    public static void saveCFCommentary(String commitForecastId , String comment){
        CRM_Committed_Forecast__c[] CFlst = new List<CRM_Committed_Forecast__c>();
        CRM_Committed_Forecast__c CFtoUpdate;
        Id CFId = Id.valueOf(commitForecastId);
        try {
            insert CFlst;       
            CFtoUpdate =  [SELECT Name , Id , CRM_Comment__c FROM CRM_Committed_Forecast__c
                 WHERE Id =: CFId ];    
            // Update the comment.
            CFtoUpdate.CRM_Comment__c = comment;
            // Make the update call.
            update CFtoUpdate;
        } catch(DmlException e) {
            System.debug('An unexpected error has occurred: ' + e.getMessage());
            // Verify that the comment s updated.
            CRM_Committed_Forecast__c afterUpdate = [SELECT CRM_Comment__c FROM CRM_Committed_Forecast__c WHERE Id =: CFId];
            System.assertEquals(comment, afterUpdate.CRM_Comment__c);
            
        }
    }
}

Below is test class. All is covered except ​​​exceptions.
@isTest
public class CRM_ForecastCommentaryTest {
    
    static testmethod void testSaveLFCommentary(){

        // insert forecast assignment test data
        CRM_Forecast_Assignment__c fassignment = new CRM_Forecast_Assignment__c();
        fassignment.Name = 'test FA';
        insert fassignment;
        system.assert(fassignment.Id != null);

        // insert Forecast period test data
        CRM_Forecast_Period__c fperiod = new CRM_Forecast_Period__c();
        fperiod.Name = 'test forecast period';
        fperiod.CRM_Fiscal_Year__c = '2020';
        fperiod.CRM_Fiscal_Quarter__c = 'FY2020 Q1';
        insert fperiod;
        system.assert(fperiod.Id != null);

        // create live forecast test data
        CRM_Live_Forecast__c liveForecast = new CRM_Live_Forecast__c();
        liveForecast.CRM_Forecast_Assignment__c	 = fassignment.Id;
        liveForecast.CRM_Forecast_Period__c = fperiod.Id;
        liveForecast.CRM_Comment__c = 'test comment';
        insert liveForecast;
        system.assert(liveForecast.Id != null);

        test.startTest();
        CRM_ForecastCommentary.saveLFCommentary(liveForecast.Id, 'testcomment');
        test.stopTest();
    }

    static testmethod void testSaveCFCommentary(){

        // insert forecast assignment test data
        CRM_Forecast_Assignment__c fassignment = new CRM_Forecast_Assignment__c();
        fassignment.Name = 'test FA';
        insert fassignment;
        system.assert(fassignment.Id != null);

        CRM_Committed_Forecast__c commitFA = new CRM_Committed_Forecast__c();
        commitFA.CRM_Comment__c = 'Forecast Committed';
        commitFA.CRM_Forecast_Assignment__c = fassignment.Id;
        try{
            insert commitFA;
            system.assert(commitFA.Id != null);
        } catch(DmlException e){
            system.assertEquals(e.getMessage(), e.getMessage());
        
        }
        test.startTest();
        CRM_ForecastCommentary.saveCFCommentary(commitFA.Id, commitFA.CRM_Comment__c );
        test.stopTest();

    }
}
  • April 13, 2020
  • Like
  • 0
Hi All,

LWC intellisense(autocomplete) is not working in HTML file for lwc in vs code. I have all the salesforce extensions installed. Also, I have tried reinstalling both vs cdoe, CLI and extensions too. Still the same issue.
Have been using this for so long but all of sudden, I was stuck with this yesterday. Can somebody assist here.

Thanks
Hi Folks,

Can we call a vf page inside lwc? Can someone please assist me here. Thanks in advance.
Hi All,

LWC intellisense(autocomplete) is not working in HTML file for lwc in vs code. I have all the salesforce extensions installed. Also, I have tried reinstalling both vs cdoe, CLI and extensions too. Still the same issue.
Have been using this for so long but all of sudden, I was stuck with this yesterday. Can somebody assist here.

Thanks
Hi Folks,

Can we call a vf page inside lwc? Can someone please assist me here. Thanks in advance.
Hi Folks,

I am trying to retrieve document metadata from my org, while retrieving via vs code CLI, I am getting issue like " invalid table size Allocation failed - JavaScript heap out of memory". Has anybody faced this before ???
Hi Folks,

Whenever I am trying to run a command like create project or any other command related to CLI extensions, I am getting error like :- 
'Command 'SFDX: Create Project' resulted in an error (command 'sfdx.force.project.create' not found)'. All of a sudden this happened. I tried uninstalling and re-installing again, but no luck. Can someone assist me here.

Thanks
Hi All,

I need some suggestions on custom file download functionality in salesforce. 
Hi Folks,

I was using vscode and all of sudden I wasnt able to create components and faced npm issue :-

'npm' is not recognized as an internal or external command,
operable program or batch file.

User-added imageUser-added image
Need some assistance on resolving this. Can someone plz help here.

Thanks
How to cover exception code in below class :- Below is apex class - 
public class CRM_ForecastCommentary {
    @AuraEnabled
    public static void saveLFCommentary(String liveForecastId , String comment){
        CRM_Live_Forecast__c[] LFlst = new List<CRM_Live_Forecast__c>();
        CRM_Live_Forecast__c FLtoUpdate;
        Id LFId = Id.valueOf(liveForecastId);
        try {
            insert LFlst;       
            FLtoUpdate =  [SELECT Name , Id , CRM_Comment__c FROM CRM_Live_Forecast__c
           WHERE Id =: LFId ];    
            // Update the comment.
            FLtoUpdate.CRM_Comment__c = comment;
            // Make the update call.
            update FLtoUpdate;
        } catch(DmlException e) {
            System.debug('An unexpected error has occurred: ' + e.getMessage());
            // Verify that the comment s updated.
            CRM_Live_Forecast__c afterUpdate = [SELECT CRM_Comment__c FROM CRM_Live_Forecast__c WHERE Id =: LFId];
            System.assertEquals(comment, afterUpdate.CRM_Comment__c);
            
        }
    }
	
    @AuraEnabled
    public static void saveCFCommentary(String commitForecastId , String comment){
        CRM_Committed_Forecast__c[] CFlst = new List<CRM_Committed_Forecast__c>();
        CRM_Committed_Forecast__c CFtoUpdate;
        Id CFId = Id.valueOf(commitForecastId);
        try {
            insert CFlst;       
            CFtoUpdate =  [SELECT Name , Id , CRM_Comment__c FROM CRM_Committed_Forecast__c
                 WHERE Id =: CFId ];    
            // Update the comment.
            CFtoUpdate.CRM_Comment__c = comment;
            // Make the update call.
            update CFtoUpdate;
        } catch(DmlException e) {
            System.debug('An unexpected error has occurred: ' + e.getMessage());
            // Verify that the comment s updated.
            CRM_Committed_Forecast__c afterUpdate = [SELECT CRM_Comment__c FROM CRM_Committed_Forecast__c WHERE Id =: CFId];
            System.assertEquals(comment, afterUpdate.CRM_Comment__c);
            
        }
    }
}

Below is test class. All is covered except ​​​exceptions.
@isTest
public class CRM_ForecastCommentaryTest {
    
    static testmethod void testSaveLFCommentary(){

        // insert forecast assignment test data
        CRM_Forecast_Assignment__c fassignment = new CRM_Forecast_Assignment__c();
        fassignment.Name = 'test FA';
        insert fassignment;
        system.assert(fassignment.Id != null);

        // insert Forecast period test data
        CRM_Forecast_Period__c fperiod = new CRM_Forecast_Period__c();
        fperiod.Name = 'test forecast period';
        fperiod.CRM_Fiscal_Year__c = '2020';
        fperiod.CRM_Fiscal_Quarter__c = 'FY2020 Q1';
        insert fperiod;
        system.assert(fperiod.Id != null);

        // create live forecast test data
        CRM_Live_Forecast__c liveForecast = new CRM_Live_Forecast__c();
        liveForecast.CRM_Forecast_Assignment__c	 = fassignment.Id;
        liveForecast.CRM_Forecast_Period__c = fperiod.Id;
        liveForecast.CRM_Comment__c = 'test comment';
        insert liveForecast;
        system.assert(liveForecast.Id != null);

        test.startTest();
        CRM_ForecastCommentary.saveLFCommentary(liveForecast.Id, 'testcomment');
        test.stopTest();
    }

    static testmethod void testSaveCFCommentary(){

        // insert forecast assignment test data
        CRM_Forecast_Assignment__c fassignment = new CRM_Forecast_Assignment__c();
        fassignment.Name = 'test FA';
        insert fassignment;
        system.assert(fassignment.Id != null);

        CRM_Committed_Forecast__c commitFA = new CRM_Committed_Forecast__c();
        commitFA.CRM_Comment__c = 'Forecast Committed';
        commitFA.CRM_Forecast_Assignment__c = fassignment.Id;
        try{
            insert commitFA;
            system.assert(commitFA.Id != null);
        } catch(DmlException e){
            system.assertEquals(e.getMessage(), e.getMessage());
        
        }
        test.startTest();
        CRM_ForecastCommentary.saveCFCommentary(commitFA.Id, commitFA.CRM_Comment__c );
        test.stopTest();

    }
}
  • April 13, 2020
  • Like
  • 0