New answers tagged

0

I read the apex dev guide for the LeadConvert class (Since I have never used it) and I went through your code snippet. Following is my understanding : The convertLead Database method converts a lead into an account and contact, as well as (optionally) an opportunity. In your case, If the Contact's(already present in system) email matches Lead's email, merge ...


1

You are comparing an array with a string. Try updating the code like: for (Object namedStatusAsObject : (List<Object>) mapCustList.get('list')) { Map<String, Object> namedStatus = (Map<String, Object>) namedStatusAsObject; if (((String) namedStatus.get('Name')) == 'AA') { mapList.add(namedStatus); } }


0

You are making two errors in the code: You have insert DML statement whereas you have said in the question that your requirement is to update the Agreement object. In the second for Loop you are just adding the same Agreement record multiple times to listAgreement which is bound to fail when there is more than one Agreement Line Items. You should modify ...


6

map is a keyword, and it cannot be used as an identifier (the name of a variable, method, etc...). Chose a different name for your variable, update the lines of code which use that variable, and you should be fine. +edit: To be a bit more specific, you can't use a reserved word (loop, and, map, etc...) as an identifier by itself, but it can be part of an ...


0

If you can explain your requirement in detail then maybe I can help you to modify code well. Since you want to remove for within for and wants to avoid SOQL query within for loop, I have modified your code below. Please note that I haven't tested the code. This is just for your reference of how can you write a better code with the help of single map instead ...


Top 50 recent answers are included