Skip to content

Commit

Permalink
Syncing format of tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
walters954 committed May 9, 2024
1 parent daaefbc commit f159a0a
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,10 @@ String recordId = '0012A00000Bcdef'; // A 15-character Salesforce ID
System.debug(recordId.length()); // Outputs: 15
```

---
### Challenge: Counting 18-Character Salesforce IDs

In many Salesforce applications, it is important to differentiate between 15-character and 18-character IDs, especially when integrating with systems that require the case-insensitive version.

**Your task:**
Write a piece of Apex code that processes a list of Salesforce ID strings and counts how many of them are 18 characters long. You will start with a predefined list of IDs that includes both 15-character and 18-character IDs.
Write code that processes a list of Salesforce ID strings and counts how many of them are 18 characters long. You will start with a predefined list of IDs that includes both 15-character and 18-character IDs.
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,10 @@ String normalizedEmail = email.toLowerCase();
System.debug(normalizedEmail); // Outputs: '[email protected]'
```

---
### Challenge: Using `toLowerCase()` for Email Deduplication

You are tasked with cleaning up a list of email addresses in a Salesforce application. Due to various input methods and user errors, the list might contain duplicate emails with different case formats. Using `toLowerCase()`, you can standardize all email addresses to lowercase to help identify and remove duplicates.

**Your task:**
Write a piece of Apex code that processes a list of email strings, converts each to lowercase, and then deduplicates the list. You will start with a predefined list of emails that includes potential duplicates with varying cases.
Write code that processes a list of email strings, converts each to lowercase, and then deduplicates the list. You will start with a predefined list of emails that includes potential duplicates with varying cases.
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@ List<Contact> results = [SELECT Id, FirstName, LastName FROM Contact WHERE LastN
System.debug('Matching Contacts: ' + results.size());
```

### Challenge: Using `toUpperCase()`
---

### Challenge: Using `toUpperCase()` for Data Consistency

Imagine you are developing a part of a Salesforce application that handles user input for a job application form. The application responses are stored in a custom object, and one of the fields captures the job title of the applicant. To maintain consistency in the database, all job titles need to be stored in uppercase.

**Your task:**
Write a piece of Apex code that accepts a string input representing the job title and converts it to uppercase. Declare a variable `jobTitle` and initialize it with the value of a tech role you would like to have. Example: "software engineer", "Salesforce Developer", "Consultant". Convert `jobTitle` to uppercase and store the result in a new variable `formattedJobTitle`. Finally, return `formattedJobTitle`.
Write code that processes a job title string entered by a user, converts it to uppercase using the `toUpperCase()` method, and stores the result in a variable. You will start with a predefined job title string and need to implement the conversion logic.

0 comments on commit f159a0a

Please sign in to comment.