 • srujith chintha 4
• NEWBIE
• 20 Points
• Member since 2021

• Chatter
Feed
• 0
• 0
• 0
Likes Given
• 9
Questions
• 9
Replies • • March 25, 2022
• Like
• 0
• Print out all positive integers from 1 to 100, inclusive and in order.
• Print messages to standard output, matching the Sample Output below.
• In the output, state whether each integer is ‘odd’ or ‘even’ in the output.
• If the number is divisible by three, instead of stating that the number is odd or even, state that the number is ‘divisible by three’.
• If the number is divisible by both two and three, instead of saying that the number is odd, even or divisible by three; state that the number is ‘divisible by two and three’.
• Design the logic of the loop to be as efficient as possible, using the minimal number of operations to perform the required logic.
• • March 17, 2022
• Like
• 0
• Print out all positive integers from 1 to 100, inclusive and in order.
• Print messages to standard output, matching the Sample Output below.
• In the output, state whether each integer is ‘odd’ or ‘even’ in the output.
• If the number is divisible by three, instead of stating that the number is odd or even, state that the number is ‘divisible by three’.
• If the number is divisible by both two and three, instead of saying that the number is odd, even or divisible by three; state that the number is ‘divisible by two and three’.
• Design the logic of the loop to be as efficient as possible, using the minimal number of operations to perform the required logic.
• Print out all positive integers from 1 to 100, inclusive and in order.
• Print messages to standard output, matching the Sample Output below.
• In the output, state whether each integer is ‘odd’ or ‘even’ in the output.
• If the number is divisible by three, instead of stating that the number is odd or even, state that the number is ‘divisible by three’.
• If the number is divisible by both two and three, instead of saying that the number is odd, even or divisible by three; state that the number is ‘divisible by two and three’.
• Design the logic of the loop to be as efficient as possible, using the minimal number of operations to perform the required logic.
• Print out all positive integers from 1 to 100, inclusive and in order.
• Print messages to standard output, matching the Sample Output below.
• In the output, state whether each integer is ‘odd’ or ‘even’ in the output.
• If the number is divisible by three, instead of stating that the number is odd or even, state that the number is ‘divisible by three’.
• If the number is divisible by both two and three, instead of saying that the number is odd, even or divisible by three; state that the number is ‘divisible by two and three’.
• Design the logic of the loop to be as efficient as possible, using the minimal number of operations to perform the required logic.
• Print out all positive integers from 1 to 100, inclusive and in order.
• Print messages to standard output, matching the Sample Output below.
• In the output, state whether each integer is ‘odd’ or ‘even’ in the output.
• If the number is divisible by three, instead of stating that the number is odd or even, state that the number is ‘divisible by three’.
• If the number is divisible by both two and three, instead of saying that the number is odd, even or divisible by three; state that the number is ‘divisible by two and three’.
• Design the logic of the loop to be as efficient as possible, using the minimal number of operations to perform the required logic.
• • March 17, 2022
• Like
• 0
@isTest private class TestAccountDeletion { @isTest static void TestDeleteAccountWithOneOpportunity() { // Test data setup // Create one account with one opportunity by calling a utility method Account[] accts = TestDataFactory.createAccountsWithOpps(1,1); // Perform test Test.startTest(); Database.DeleteResult result = Database.delete(accts, false); Test.stopTest(); // Verify that the deletion should have been stopped by the trigger, // so check that we got back an error. System.assert(!result.isSuccess()); System.assert(result.getErrors().size() > 0); System.assertEquals('Cannot delete account with related opportunities.', result.getErrors().getMessage()); } }
1.when i am trying in developer console its showing TestDataFactory variable does not exit
• • January 13, 2022
• Like
• 0
public class CalloutClass { @future(callout=true) public static void makeCallout() { HttpRequest request = new HttpRequest(); // Set the endpoint URL. String endpoint = 'http://yourHost/yourService'; request.setEndPoint(endpoint); // Set the HTTP verb to GET. request.setMethod('GET'); // Send the HTTP request and get the response. HttpResponse response = new HTTP().send(request); } }

1.how to make callout by adding trigger

• • January 06, 2022
• Like
• 0
1.The Apex class must be called AccountHandler and be in the public scope
2.The Apex class must have a public static method called insertNewAccount
3.The method must accept an incoming string as a parameter, which will be used to create the Account name
4.The method must insert the account into the system and then return the record
5.The method must also accept an empty string, catch the failed DML and then return null.
• • January 06, 2022
• Like
• 0
• • December 21, 2021
• Like
• 0
• • December 21, 2021
• Like
• 0
• • December 21, 2021
• Like
• 0 • • March 25, 2022
• Like
• 0
• Print out all positive integers from 1 to 100, inclusive and in order.
• Print messages to standard output, matching the Sample Output below.
• In the output, state whether each integer is ‘odd’ or ‘even’ in the output.
• If the number is divisible by three, instead of stating that the number is odd or even, state that the number is ‘divisible by three’.
• If the number is divisible by both two and three, instead of saying that the number is odd, even or divisible by three; state that the number is ‘divisible by two and three’.
• Design the logic of the loop to be as efficient as possible, using the minimal number of operations to perform the required logic.
• • March 17, 2022
• Like
• 0
• • December 21, 2021
• Like
• 0
• • December 21, 2021
• Like
• 0
Hi All,
I'm new to salesforce and started working on Trailhead's. I facing issue with the Trigger Challenge. Here is the triger code im writing

trigger AccountAddressTrigger on Account (before insert) {
for(Account a : Trigger.new){
a.ShippingPostalCode = a.BillingPostalCode;
}
}

}

System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, TestTrigger: execution of AfterInsert caused by: System.NullPointerException: Attempt to de-reference a null object Trigger.TestTrigger: line 3, column 1: []
• • June 14, 2016
• Like
• 1
This is the Challenge:

To pass this challenge, create an Apex class that inserts a new account named after an incoming parameter. If the account is successfully inserted, the method should return the account record. If a DML exception occurs, the method should return null.The Apex class must be called 'AccountHandler' and be in the public scope.
The Apex class must have a public static method called 'insertNewAccount'.
The 'insertNewAccount' method must accept an incoming string as a parameter, name the account after the parameter, insert it into the system and then return the account record.
The 'insertNewAccount' method must also accept an empty string, catch the failed DML and return null.

My Class:

public class AccountHandler {

public static Account insertNewAccount (String accName, Account a) {
try{
a.name = accName;

insert a;
return a;
}
catch(Exception e) {
return null;
}
}
} Throwing this error, how many times i modified the class.
what is the correct class.?

• • May 02, 2015
• Like
• 0