What's the deal with Deno? We talk with a major contributor to find out. Listen now.

Hot answers tagged

11

There is a nested limit of 7 collections. If you attempt to go beyond this, you'll get an error: Nested type exceeds maximum level: 8 First question: Is this even possible? Am I exceeding any limits with a Map like this? I have looked over documentation and can't find anything regarding nested map limits. I know it's in the documentation[citation ...


11

You need to use breakBefore and colspan parameters of the apex:column: <apex:pageBlock> <apex:pageblocksection title="Order Lines" showheader="true" collapsible="true" columns="1"> <apex:pageBlockTable value="{!accounts}" var="a"> <apex:column value="{!a.Name}"/> <apex:column value="{!a.Street__c}"/> ...


11

When you use the pattern of: <c:parent> <c:child name="xyz" /> </c:parent> Then you must use includeFacets="true" to make a component event from the child bubble to the parent in the way you think it would in a DOM i.e. <aura:handler name="childInitialized" event="c:childInitialized" action="{!c.registerStep}" includeFacets="true"/&...


8

Ahh, Salesforce doesn't allow direct field to field comparisons in a query. Source: Field to field comparison in WHERE clause of SOQL Knowledge Article Number 000187460 Description I want to execute a query by comparing two fields of the same object in WHERE clause, but I am not able to use a field in the right hand side of a ...


7

Your loop: for(Integer i = 0; i < bulkDataValue; i+2){ never terminates hence you hit the CPU limit. You probably meant something like: for(Integer i = 0; i < bulkDataValue; i += 2){


6

I think you can address this effectively with a mix of collections and custom classes, like this: public class countryLocale { public String preferredLanguage; public String preferredLocale; public Map<String, Locale> languages; } public class Locale { public String langCountry; public String defaultLang; } That saves you from ...


5

You can use CASE function and try something like this CASE ( Order_Status__c , 1, "Pseudo Machines – not sold", 2, "Sale Confirmed – waiting for spec", 3, "Spec complete – BOM creation", 4, "BOMs complete – procurement", 5, "Production orders released", 6, "Assembly Started", 7, "Shipping", 8, "Installation started", ...


5

You can't filter a child value like that directly, but you can use a subquery: WHERE Id IN (SELECT OpportunityId FROM Quote WHERE Id = '0Q00E0000004PEESA2')


4

The second parameter in the DISTANCE function is GEOLOCATION (with latitude and longitude parameters). Your query should look like this: ORDER BY DISTANCE(locationField__c, GEOLOCATION(account.Location__latitude__s, account.Location__longitude__s), 'km') UPDATE: Apparently Apex bind variables aren’t supported for the units parameter in DISTANCE or ...


4

You will also need an Opportunity class with the fields that you have queried from ConvertedOpportunity. Something like (untested): private class Lead { public const String SObjectTypeName = "Lead"; public string Id { get; set; } public string Name { get; set; } public bool IsConverted { get; set; } public Opportunity ...


4

You had a spurious parenthesis resulting in closing an IF too early. I think this is what you're aiming at here (note the comment, which you shouldn't include in your formula): IF( ISPICKVAL(Sector__c, "Supplier/Distributor"), "Supplier", IF( ISPICKVAL(Account_Region__c , "Middle East"), "Middle East", IF( ...


4

If function will work inside the case statement in formula You can do like this:- CASE( sa_nket__case_text__c , '00', 'Member', '02', 'Member', '03', 'Member', '99', 'Member', '23', IF( ISBLANK( sa_nket__text_field__c ) , 'Memeber', 'Non-Member'), '85', 'Non-Member','' ) Note:- CASE functions cannot contain functions that return true or false. ...


4

Your main concern shouldn't be the if statement, it's the fact that you've got a query inside a loop--if there's more than 99 shadow contacts on an account--boom, you get an uncatchable error. Realistically, this is going to work the way that will seem obvious once you see the pattern. Map<String, Contact> contacts = new Map<String, Contact>(); ...


3

As the error message saying, the relationship name you are using is incorrect. __r is used for custom relationships in salesforce(Course_line_item__r); and plural form of the object when refer to child object. It should be something like below. list<Course__c> LC=[SELECT Id, (SELECT Id FROM Course_line_items__r) FROM Course__c]; Make sure you get the ...


3

You can in fact used the rendered attribute to do this. For the : <apex:pageblocksection title="Order infos" showheader="true" collapsible="true" columns="1"> you need to put logic in the controller to check the columns of each row and you can then use that variable on the columns. The next one is easy: <apex:pageblocksection title="Shipment ...


3

// // Generated by JSON2Apex http://json2apex.herokuapp.com/ // public class FileVarClass { public String ProductionOrder; public String statusType; public List<Electronics/> Electronics/; public class FileVar { public String Name; public String currentext; public String Dirfilename; public String ...


3

if (c!=TOTAL) tempTot+=allvals.get[s].get[r].get[c]; You are using square brackets here. Should you be using normal? if (c!=TOTAL) tempTot+=allvals.get(s).get(r).get(c);


3

You're missing one comma. IF( ISPICKVAL(Sector__c, "Supplier/Distributor"), "Supplier", IF( ISPICKVAL(Account_Region__c , "Middle East"), "Middle East", IF( ISPICKVAL(Account_Region__c , "Americas"), IF( BEGINS(TEXT(Sector__c) , "Restaurants"), "US Restaurants", "US Hotels" ), ...


3

You can't, unfortunately. Apex does not have an "import" function that you might expect from another C-family language, Python, etc. ClassA.NextedInA is going to be called exactly that everywhere except inside the scope of ClassA. Your only option is to promote the inner class to its own outer class.


3

let's assume, you have only one Support_Settings__c record per each Case RecordTypeId field value. In this case, in order to avoid nested loops, you can group Support_Settings__c records by RecordTypeId__c field. After that on iterating Case records in the trigger, just get value from Map by Case RecortdTypeId field value. //grouping support settings by ...


2

Your query could be simplified to: SELECT (SELECT Email__c from Players__r) FROM Team__c WHERE Name = '14104' Using Eclipse IDE V30, view the screen shot to see child record values:


2

Posting my comment as an answer: rendered attribute should help you hide the page block section. Try adding rendered = {!NOT(ISNULL(gp.opp))} . ie <apex:pageblocksection title="Shipment Info" collapsible="true" columns="1" rendered = {!NOT(ISNULL(gp.opp))}>


2

If you mean you don't want the second green header bar to appear, I think if you simply remove the second nested pageBlockSection, you'll get what you want. <apex:pageblocksection title="Order Lines" showheader="true" collapsible="true" columns="1"> <apex:pageBlockTable value="{!gp.ct}" var="p"> //page block 1 <apex:column></...


2

The relationship name between Account and Opportunity is Opportunities, so you need to use that instead when writing your query. [SELECT Name, (SELECT Name FROM Contacts LIMIT 1), (SELECT Name FROM Opportunities LIMIT 1) FROM Account WHERE Name != null]


2

IF( AND( OppRegion__c = "EMEA", IF(Account_Country__c = "Azerbaijan","Middle East", IF(Account_Country__c = "Bahrain", "Middle East", IF(Account_Country__c = "Iraq", "Middle East", IF(Account_Country__c = "Israel", "Middle East", IF(Account_Country__c = "Jordan", "Middle East", IF(Account_Country__c = "Kuwait", "Middle East", IF(Account_Country__c = "...


2

Following up on my comment here is an example on getting a list of contacts related tot he account with the bank name in your filter: Set<ID> accIDs = New Set<ID>(); for(Bank_Name__c b : [SELECT Stores_Account__c FROM Bank_Details__c WHERE Bank_Name__c LIKE '%WBC%]) accIDs.add(b.Stores_Account__c); Contact[] cons = [Select ID, email from ...


2

Try to change your code to Map<Integer, List<String>> copyMap = new Map<Integer, List<String>>(); for(iterator=0; iterator<(cd.size()/2); iterator++) { //copyMap = new Map<Integer, String[]>(); if(copyMap.contains(cd[iterator])){ copyMap.get(cd[iterator]).add(cd[iterator+2]); }else{ copyMap.put(cd[...


2

It should look something like this, although I'm not completely sure if it's the right syntax. List<Contact> activeCandidates = [ SELECT Name FROM Contact WHERE Id in: ( SELECT Test_Process__r.Candidate__c FROM Test_Result__c WHERE Status__c = 'New' Limit 1) ];


2

Sure, just group by both. SELECT Main__c, Sub__c FROM MyObject__c GROUP BY Main__c, Sub__c This query will give you all the combinations. Note that without a where clause, it pulls every record in the table so the query rows limit might be a concern.


2

There's a problem with the query you're asking us about. List<Object1> obLis=[SELECT Id, Name, (SELECT Id, Name FROM Object2), (SELECT ID, Name FROM Object3]; If the relationship exists as you describe, the query should look something more like this: List<Object1>obLis =[SELECT Id, Name, (SELECT Id, Name FROM Object2s), (SELECT ID, Name FROM ...


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