-
ChatterFeed
-
0Best Answers
-
0Likes Received
-
0Likes Given
-
9Questions
-
9Replies
- srujith chintha 4
- March 25, 2022
- Like
- 0
- Continue reading or reply
print all of the positive integer from 1 to 100
- 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.
- srujith chintha 4
- March 17, 2022
- Like
- 0
- Continue reading or reply
Print all of the positive integers from 1 to 100.
- 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.
- srujith chintha 4
- March 17, 2022
- Like
- 0
- Continue reading or reply
Now that you’ve added the test utility class, modify the test class to take advantage of this class. In the TestAccountDeletion class, replace the block that starts with // Test data setup and ends with insert opp; with:
@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[0], 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()[0].getMessage()); } }
1.when i am trying in developer console its showing TestDataFactory variable does not exit
1.when i am trying in developer console its showing TestDataFactory variable does not exit
- srujith chintha 4
- January 13, 2022
- Like
- 0
- Continue reading or reply
callout class
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
1.how to make callout by adding trigger
- srujith chintha 4
- January 06, 2022
- Like
- 0
- Continue reading or reply
trailhead error dml operations
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.
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.
- srujith chintha 4
- January 06, 2022
- Like
- 0
- Continue reading or reply
- srujith chintha 4
- December 21, 2021
- Like
- 0
- Continue reading or reply
- srujith chintha 4
- March 25, 2022
- Like
- 0
- Continue reading or reply
print all of the positive integer from 1 to 100
- 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.
- srujith chintha 4
- March 17, 2022
- Like
- 0
- Continue reading or reply
- srujith chintha 4
- December 21, 2021
- Like
- 0
- Continue reading or reply
Create an Apex trigger for Account that matches Shipping Address Postal Code with Billing Address Postal Code based on a custom field.
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){
if(a.Match_Billing_Address__c && a.BillingPostalCode != null){
a.ShippingPostalCode = a.BillingPostalCode;
}
}
}
but i'm getting the following error. Not sure where i'm doing wrong. can someone please help me here. Thanks in advance.
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: []
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){
if(a.Match_Billing_Address__c && a.BillingPostalCode != null){
a.ShippingPostalCode = a.BillingPostalCode;
}
}
}
but i'm getting the following error. Not sure where i'm doing wrong. can someone please help me here. Thanks in advance.
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: []
- VENKATA RANGA
- June 14, 2016
- Like
- 1
- Continue reading or reply
Trailhead class error
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.?
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.?
- Deepu B
- May 02, 2015
- Like
- 0
- Continue reading or reply