• Shanth Shenoy 3
  • NEWBIE
  • 55 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 3
    Replies
Hi Friends from the Salesforce Forum,
I was asked this interview question (I am new to Salesforce hence I fubbed the Interview :-( , heres the question, can I request for help so I can be better prepared next time over. Thank you in advance.

-- Findout Issues in this code, Bad practices in this Method
*********************************************************************************
Private Map<ID,String> updateAccounts(List<Account>(accList){
Map<Id, Account> updatedAccs = new Map<Id,Account>(accList);
Set<String> validAccTypes = new Set<String>{'Prospect', 'Customer'};
try{ 
Map<Id, String> errorMap = new Map<Id, String> ();
 If(accList == null || accList.size() ==0)
Return errorMap;
For(Account acc:accList){
if(acc.DunsNumber.Lenght >9){
errorMap.put(acc.Id, 'Duns Number more than 9 Characters';
updatedAccs.remove(acc.Id);
}
} else If(acc.AccountNumber.Lenght >40){
   errorMap.put(acc.Id, 'Account has more than 40 Characters');
   updatedAccs.remove(acc.Id);
} else If(validAccTypes.contains(acc.Type)){
  errorMap.put(acc.Id, 'Account Type is not Valid');
  updatedAccs.remove(acc.Id);
}
Update updatedAccs;
} catch(Exception ex)
  System.debug(ex.getMessage()0;
}
Return errorMap;

 
If I do not know what is the Object type I am handling in a method, what should be the return type of that method, Thank You 
Hello, I am new to SF and Not a practicing Developer, I have this question, I followed all instructions but I am totally fluxomed as how to test the code that I have on Lightning Developer Console? Suggestions that'll help me in this regard is very welcome. just as an FYI I am posting the set of instructions below: Thank you for your assistance & guidance  --> Shanth Shenoy

Copy the helper class code block, UtilityClass, from above and modify it so the sharing rules are enforced based on the sharing setting of the calling class.
Copy the controller code block, TowerMapControllerClass, from above and modify it so the sharing rules are enforced.
Copy and modify the Lightning component code above to implement a lightning:map component named Towermap. Replace the <!-- Create lightning:map here --> with your code. Your code should pass the value of v.mapMarkers to the mapMarkers attribute, pass the value of v.markersTitle to the markersTitleattribute, and set the zoomLevel attribute to 5.
Copy and paste the controller and helper code blocks above to create controller and helper functions to pull all Tower locations from the server.
To view your map, you can use Lightning App Builder to create a standalone one-column app page named Towers and add it to the Lightning Experience App Launcher. More experienced developers can chose another method to expose the component, if desired.
If I do not know what is the Object type I am handling in a method, what should be the return type of that method, Thank You 
Hello, I am new to SF and Not a practicing Developer, I have this question, I followed all instructions but I am totally fluxomed as how to test the code that I have on Lightning Developer Console? Suggestions that'll help me in this regard is very welcome. just as an FYI I am posting the set of instructions below: Thank you for your assistance & guidance  --> Shanth Shenoy

Copy the helper class code block, UtilityClass, from above and modify it so the sharing rules are enforced based on the sharing setting of the calling class.
Copy the controller code block, TowerMapControllerClass, from above and modify it so the sharing rules are enforced.
Copy and modify the Lightning component code above to implement a lightning:map component named Towermap. Replace the <!-- Create lightning:map here --> with your code. Your code should pass the value of v.mapMarkers to the mapMarkers attribute, pass the value of v.markersTitle to the markersTitleattribute, and set the zoomLevel attribute to 5.
Copy and paste the controller and helper code blocks above to create controller and helper functions to pull all Tower locations from the server.
To view your map, you can use Lightning App Builder to create a standalone one-column app page named Towers and add it to the Lightning Experience App Launcher. More experienced developers can chose another method to expose the component, if desired.
I ma new to salesforce. Can anyone please tell what exactly is a sales process and i twould be of great help if you can provide relavent documents.