Skip to main content

#Developer Beginner0 discussing

Trailhead trail click path:

Platform Developer Beginner -- Get Started with Salesforce Development -- Create a Data Model Using Clicks -- Retrieve Metadata from Salesforce to the Local Project:

 

Hey folks.  I have followed the first module in "Get Started with Salesforce Development" and now am stuck on the second.  When I try to retrieve the custom object created earlier in this module, I get the following error in VSCode:

 

ERROR: "Error fetching metadata for org. Run "SFDX: Authorize an Org" to authorize your org again."

 

Steps accomplished so far:

  1. Created brand-new Trailhead Playground
  2. Reset Password
  3. Installed SF CLI and validated install via "sf update" terminal command.  Version is currently...
    • @salesforce/cli/2.29.5 win32-x64 node-v20.11.0
  4. Installed VSCode, version 1.78
  5. Installed Salesforce Expansion Pack (Expanded) version 60.0.0
  6. Installed NodeJS version 20.11.1
  7. Installed Adoptium Temurin 17 (LTS) version 17.0.10+7 and set system environment path variable path to "C:\Program Files\Eclipse Adoptium\jdk-17.0.10.7-hotspot"
  8. Set VSCode setting "salesforcedx-vscode-apex.java.home" as same path as above
  9. Created "Dreamhouse" project in VSCode via "SFDX: Create Project" in command palette
  10. Ran "SFDX: Authorize an Org" from VSCode command palette, and selected "Production" and org alias as "MyDevOrg"; successfully logged in via browser pop-up.
  11. Installed npm; current version is 10.1.0

Despite having done all of that, I continue to receive the "Error fetching metadata for org. Run "SFDX: Authorize an Org" to authorize your org again" no matter how many times I reauthorize the Org.

 

In my troubleshooting, I also confirmed that my System Administrator profile (to which I belong) currently has "API Enabled" set to TRUE in the profile's Administrative Permissions section.  I then tried running "sfdx force:auth:device:login", although now I suspect that this is a deprecated command, even though it successfully worked and had me enter a authentication code into the browser.

 

(I do see one potential solution in https://salesforce.stackexchange.com/a/317889, but have not yet had a chance to attempt it yet... I'll have a go at it tomorrow.)

 

I do not know what else to do... does anybody have any suggestions?

 

Thank you very much for your help!

 

#Trailhead Challenges  #Trailhead  #Developer Beginner  #Salesforce Developer

4 answers
  1. Jeff Weller (PARQA Inc.) Forum Ambassador
    Feb 23, 2024, 6:41 AM

    Hello@Chris Skutnik,

     https://trailhead.salesforce.com/trailblazer-community/feed/0D54V00007TuIMASA3

0/9000

We need your feedback to improve your developer experience! Take our survey so we can understand how to help make you more successful when developing and building with Salesforce. Thank you! 

 

What did you tell us in previous developer surveys? Check out this blog post written by @Jerry Thomas of Salesforce Developer Marketing. 

Have you taken the Salesforce Developer Survey yet?

#Certifications

1 answer
0/9000

I have copy and pasted the sample code from this project https://trailhead.salesforce.com/content/learn/modules/change-data-capture/test-the-change-event-trigger?trailmix_creator_id=strailhead&trailmix_slug=architect-integration-architecture

 

But I'm getting the error 

Method does not exist or incorrect signature: void enableChangeDataCapture() from the type test

 

I have literally not changed anything from the sample code and have successfully completed the preceding steps in the project, so am a bit confused. 

Test.enableChangeDataCapture() method does not exist

#Developer Beginner

8 answers
  1. May 29, 2022, 7:21 PM

    Thank you for clarifying Vinay Singh (Deloitte).  That was indeed my problem. I had an empty test class and once I removed it, the test class compiled on the original org.  Thanks! 

0/9000

Hi,

 

Can somebody help me in bulkifying the below code? I am learning Apex and I tried writing the below code to delete the record after some automation was done.

 

Kindly suggest your inputs to proceed further.

 

Thanks,

 

#Salesforce Developer

public without sharing class MergeDuplicateClientRecord {

public static List<Boolean> hardDeleteDuplicateRecord(List<String> duplicateIds) {

List<Boolean> isSuccess = new List<Boolean>();

Boolean isDeleted = false;

Database.emptyRecycleBinResult result;

Database.deleteResult sr;

if( duplicateIds != NULL && duplicateIds.size() > 0 && String.isNotBlank( duplicateIds[ 0 ] ) ) {

Account acc = new Account(Id = duplicateIds[ 0 ]);

sr = Database.Delete(acc);

result = Database.emptyRecycleBin(acc);

}

if( ( sr != NULL && sr.isSuccess() ) && ( result != NULL && result.isSuccess() ) )

isDeleted = true;

isSuccess.add( isDeleted );

return isSuccess;

}

}

6 answers
  1. Nov 22, 2021, 2:50 PM

    public without sharing class MergeDuplicateClientRecord {

    public static List<Boolean> hardDeleteDuplicateRecord(List<String> duplicateIds) {

    if( duplicateIds != NULL && duplicateIds.size() > 0){

    Database.deleteResult sr;

    List<Account> accLstToDelete = new List<Account>();

    For(String str:duplicateIds){

    accLstToDelete.add(new Account(Id = str));

    }

    Database.DeleteResult[] DR_Dels = Database.delete(accLstToDelete);

    if(sr.isSuccess())

    return true;

    }

    return false;

    }

    }

0/9000

I get to know that records that are fire the after triggers are read only. so is there any possibility of recursive trigger on after event?

 

#Salesforce Development #Salesforce Developers #Salesforce Administrator #Salesforce Developers #Developer Beginner #Developers

1 answer
  1. Nov 19, 2021, 7:02 AM

    Hello @Abdullah Abdullah,

    Trigger recursion can happen if you don't have any specific filters or criteria for updating a related record in After Trigger, but this only happens if you update a related record from an after trigger, and that related record updates the original record in its after trigger.

     

    Eg. Say you have a Trigger on Opportunity object which has an after insert/update logic that updates some field on the quote, and now if the Trigger on the Quote Object has an after insert/update logic that updates some field on the Opportunity then in this case Trigger recursion will occur. To reduce the possibility of recursion take care of the conditions and the logic you use to make the DML.

     

    And as you said that the records are read-only in after trigger, which means you cannot make any changes to the field values of the record which invoked the Trigger from its after insert/update logic, but when said this it doesn't mean that they are read-only for the whole transaction these values can be changed by any other Trigger if it is invoked before the transaction is committed.

     

    Hopes this helps, if you find this or any other answer useful mark it as Best Answer so it will help others looking for the same.

0/9000

why custom validation rule is not applicable while updating a the record using Work flow rule but applicable for PB or flow?

how we define order of execution here?

 

#Salesforce Admin #Salesforce Developer #AwesomeAdmins #Salesforce Developers #Developer Beginner

3 answers
0/9000
2 answers
  1. Nov 6, 2021, 6:20 AM

    Basically, The controller is the JS file that gets requests from the Component now the first thing we do is write most of the logic in the helper file and the Controller just calls the method defined in the helper the reason is it makes code look cleaner but the main reason is now since you have a method in helper file if you want to call it again then you can call it multiple times from controller method so any function that should act as a reusable function you should define it in helper. any function that we define in controller can only accept 3 parameters in the same order component, event, helper. so it can't contain a normal function that expects dynamic values as Parameter that you can only do in helper file 

0/9000

It's observed that there are some records which don't have record type id ,even though we have active record types for the object .

could you please help me what would be the possible reason?

 

#Salesforce Developer  #Salesforce Developers  #Salesforce Development  #Developer Beginner  #Developer Forums  #Developers  #Developer Tools

2 answers
  1. Nov 2, 2021, 1:55 PM

    Hi Abdullah, 

     

    Were these records created before you had record types for the object?  I think permissions could possibly be at play here as well.  Even if the object has (and has always had) record types, maybe the user/profile who created the record did not have access to create records with the existing record types.

0/9000

It's observed that i have a 'Master' record type in my custom object along with other record type which i created.

Could you help me to identify what does this record type signify and how to get the id of 'Master' record type?

1 answer
0/9000

Hello Trailblazers,

 

There is a JavaScript I course certification as well as Salesforce Platform Developer I and II.  

 

1)  What is the need for learning JavaScript with Salesforce since it has its own programming language?  

2)  Is the JavaScript course certification absolutely necessary for becoming a Salesforce developer? 

3)  If JavaScript I and Salesforce Platform Developer I should both be taken, which one is recommended to be studied and taken first?  

 

I just passed my Admin exam and will study App Builder next.  I have no development experience but have always been intrigued by being a developer.

 

Thank You,  

 

Jeff

 

#Certifications

1 answer
  1. Nov 1, 2021, 5:15 PM

    Hi First of all Salesforce Platform Developer I and II are there for a long time. this certification means that you are a salesforce Platform developer and can work with Apex etc(Salesforce Stuff). Now The JavaScript I exam is a very recent one and it came because the New Lightning framework Lightning web component (LWC) is mostly working with client-side Javascript(Web Standards) and we try to write most of the client-side logic in the Javascript language so which means to be a good developer you need to have Salesforce Knowledge as well as Javascript Knowledge to create Good components. your last question which one to be taken first I would suggest go for Platform Developer 1 later you can learn javascript and go for javascript1 exam

0/9000