• AD1418
  • NEWBIE
  • 5 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 3
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 9
    Replies
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();

    }
}