Hot answers tagged

4

You're using the wrong index variable. opp.Highest_Priced_Competitor__c = competitors.get(highestPricePosition); opp.Highest_Price__c = competitorPrices.get(highestPrice); The second line should also be using highestPricePosition, which is an Integer- or simply assigning highestPrice directly, since you do gather that value in your loop. Arrays ...


4

You need to split(on the basis of "-"), pull out starting element, convert it to number and sort on that. Example const input = ["1-10", "11-20", "201-500", "21-50", "501-99999", "51-200"]; const sortedList = input.sort((range1, range2) => startIndex(range1) - startIndex(range2)); function startIndex(range) { return Number(range.split("-")[0].trim(...


3

The Flow mechanism is bulkified. This means if you return a List<String>, it will map to a single variable, while List<List<String>> will map to a collection variable. You'll need to adjust your code to use List<List<String>> in order for this to work.


3

you can do it by means of the while loop and checking the current size of the partition. Here is a class, that allows a splitting list of any list type. public with sharing class Lists { public static List<List<Object>> doPartions(List<Object> records, Integer size, Type destType){ checkNotNull(records); checkArgument(...


2

What you've done in your test class is instatiate your apex controller, but you haven't provided any context for that controller. In other words, your getURL() in the controller is based on the current page and you need to set this in your unit test. This answer goes over why you need to use it as you might have a single controller for different pages. You ...


2

Error: public is not allowed on locals: Reason That error is coming because inside the private static method you have declared public selection Option removed public keyword from List<SelectOption> testoptions = controller.CountryOptions ; Code: public static testMethod void CountryOptionsTest() { property__c prop = new property__c(); prop....


1

You can either choose to use an existing value (e.g. the record Id): data-record-id={item.Id} Or you can add in your own: @wire(...) wireHandler({data,error}) { if(data) { this.serverResult = data.map((record,index)=>({...record, index: `${index}`})); } if(error) { // do error handling } }


1

As of now, there isn't a way to pass a list of string values and display as dynamic choices in the flow's picklist component. You can check for some alternatives in a similar question asked. (Screen Flow Picklist from Lightning Component).


1

Generally the styling is quite strict on renderAs="pdf". Not sure why the behavior is different in PDF, UI can be achieved by having a span inside list item and style the span. <ul> <li> <span style="padding-left: 10px;"> Text entry </span> </li> <li> <span style="padding-...


1

You don't need to query the records first, unless you needed to lock them. You can just construct the records in memory and update: Date todaysDate = system.today(); Map<Id, Account> accounts = new Map<Id, Account>(); for(ParseAdminResponse par: acctList) { if(par.Success) { accounts.put(par.SfAccountId, new Account(Id=par....


1

Salesforce offers many standard buttons for list views, including many Mass Quick Actions. For example, on a "Leads" list view, the "Change Owner" and "Change Status" buttons are available. To add or remove list view buttons for Standard Objects, follow the steps in Customize Search Layouts. To add or remove list view buttons for Custom Objects, follow the ...


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