function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Hitesh chaudhariHitesh chaudhari 

how to check error in visual studio

How to check error in VS code as after deployment it is saying "Deploy failed [1,1]"VS code error message
Tad Aalgaard 3Tad Aalgaard 3
Click on the Output tab to the right of the PROBLEMS tab.
Tad Aalgaard 3Tad Aalgaard 3
Also, if you mouse over the section of cod ethat has the red line under it you can see the problem.  There is also a red bar on the very far left of your screen that show where the errors are throughout your code.

 
Ajay K DubediAjay K Dubedi
Hi ImNick,

I hope you are doing well but make sure you have authorized your org with VS code.
You can install tools from the marketplace that will help you to find out the error and bugs:

- Apex Interactive Debugger
- Apex
- SalesforceDX Code Companion

You can follow these links for more help:

https://marketplace.visualstudio.com/items?itemName=salesforce.salesforcedx-vscode-apex
https://marketplace.visualstudio.com/items?itemName=MohithShrivastava.dx-code-companion
https://marketplace.visualstudio.com/items?itemName=salesforce.salesforcedx-vscode-apex-debugger

I hope you find the above solution helpful. If it does, please mark as Best Answer to help others too.

Thanks,
Ajay Dubedi
Hitesh chaudhariHitesh chaudhari
@ Tad Aalgaard 3 : following is the screenshot of output tab :

Also I hover at error source : it is showing deploy failed.

Following is the code i am using : 
public with sharing class AccountRegistrationHelper 
{
	@AuraEnabled
     public static string createNewAccount(String fname,String lname , String contact ,String address ,Date dob)
    {
        Account acc = new Account();
        acc.Name = fname + lname ;
        acc.Phone = contact ;
        acc.BillingCity6 = address ;     
        acc.SLAExpirationDate__c = dob ;           
        insert acc ;   
        system.debug('inserted');
		return 'inserted' ;
    }
}

 

output
Hitesh chaudhariHitesh chaudhari
@Ajay : I tried to install all your referanced plug in but saying showing following error : 
User-added image
Tad Aalgaard 3Tad Aalgaard 3
One of the nice things about using Visual Studio Code with the plugin is that you can just right click on the file from the Explorer on the left side and retrieve or deploy without having to know any commands.  If you want to know the commands it show you in the Output tab what it used.


In case you didn't set up your project correctly here are instructions that walk you through it.

http://​​​​​​​https://forcedotcom.github.io/salesforcedx-vscode/articles/user-guide/org-development-model (http://https://forcedotcom.github.io/salesforcedx-vscode/articles/user-guide/org-development-model)