• Rajnarayan Deenadayalan
  • NEWBIE
  • 15 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
I have a requirement
In which have to Integrate between Salesforce to Salesforce using REST
Could please provide any sample program to proceed with POC.
Sample worked example's or sites for reference are appreciated.



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.


Getting following Error message :

Challenge not yet complete... here's what's wrong: 
Executing the 'insertNewAccount' method failed. Either the method does not exist, is not static, or does not insert the proper account.



Following is the Code written for this ,any help is appreciated to complete the challenge
//

Public class AccountHandler{


public static List<Account> insertNewAccount(String firstname){

Account a=new Account();
a.Name=firstname;   
insert a;


List <Account> queriedaccoutn = [SELECT Name 
                          FROM Account 
                          WHERE Name =:firstname 
                          LIMIT 1];
return queriedaccoutn;
}

}
//



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.


Getting following Error message :

Challenge not yet complete... here's what's wrong: 
Executing the 'insertNewAccount' method failed. Either the method does not exist, is not static, or does not insert the proper account.



Following is the Code written for this ,any help is appreciated to complete the challenge
//

Public class AccountHandler{


public static List<Account> insertNewAccount(String firstname){

Account a=new Account();
a.Name=firstname;   
insert a;


List <Account> queriedaccoutn = [SELECT Name 
                          FROM Account 
                          WHERE Name =:firstname 
                          LIMIT 1];
return queriedaccoutn;
}

}
//