Hot answers tagged

6 votes

How to add many values at once in Apex?

You can initialize list with your items: List<String> l = new List<String>{'a', 'b', 'c', 'etc'};
user avatar
4 votes
Accepted

How to manipulate date type list to not capture time

That's just how Date values are printed to the debug log. You can see it yourself: System.debug(Date.today()); // Outputs: USER_DEBUG [1]|DEBUG|2022-05-10 00:00:00 They are proper dates, it's just ...
user avatar
  • 429k
2 votes
Accepted

How to pass a list to another list?

You can't generally just assign one arbitrary data type to another. For example, the following is also invalid: TemporaryCustomObj value = new CustomObj__c(); What you need to do is to translate the ...
user avatar
  • 429k
1 vote

Getting list of Opportunity Id with apex. (getting an error)

The error is simple, List<Id> and List<Opportunity> are not compatible, so you cannot assign one to the other. Your query is giving you a List<Opportunity>. Probably the simplest way ...
user avatar
  • 46.5k
1 vote
Accepted

Help to send data from one list to another using temporary object type

Instead of ... for(OppNegocioTemp i:listTempOppNegocios){ oppNegocios.add(listTempOppNegocios(i)); } ... you need to have (notice that you need to call get on list to get ...
user avatar
  • 1,424
1 vote
Accepted

Logic problem, it is possible? Add more quotelineitems if it has more than 1 on quantity

There a few issues with this code: You are appending to the loop while looping through it. This will cause a run-time error. You have your for loop setup wrongly - it won't iterate at all like this. ...
user avatar
1 vote
Accepted

Modify string value in soql list and add back to list

You don't want to remove the commas, you just want to escape them properly. You'd also have problems with quote characters ("). Just do this: getCustomerExport = [SELECT Customer_ID__c, Name from ...
user avatar
  • 429k

Only top scored, non community-wiki answers of a minimum length are eligible