Questions tagged [nested]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
11
votes
2answers
3k views

How deep can nested Maps go, and how do I properly add data to those nested maps?

Background: Long story short, my company is integrating with a platform that has a "Role Hierarchy", so to speak, but that Hierarchy isn't stored in Salesforce. To get the "roles" I have to query ...
7
votes
3answers
331 views

SOQL Query to retrieve Contacts from an Account sorted by the distance between the contact location and the account location

I'm trying to create a SOQL query to retrieve Contacts from Accounts, with the contacts for each account sorted by the distance between the contact location and the account location. This is what I ...
6
votes
1answer
3k views

SOQL: Comparing two custom relationship fields in a nested query

I think I may be hitting some sort of SOQL limitation in the WHERE clause. I am trying to return fields from two parent objects, after comparing two date fields on both Objects. The goal is to have a ...
5
votes
2answers
7k views

Nested table using pageblock

So I want to add a nested table for another table. I'm able to add table 2 as nested for table 1. I could do this by adding a pageblocktable table 2 inside the last column of the pageblocktable of ...
5
votes
1answer
7k views

Lightning component event not fired or handled

To build a nested component structure as detailed here I have build the solution described in one of the answers which recommended to send an APPLICATION event... parentInitialized.evt <aura:...
4
votes
1answer
184 views

How to capture the nested fields on a lead object?

I am using .NET toolkit for integration with salesforce.com One of the queries I have is Select Id, Name, ConvertedOpportunityId, ConvertedOpportunity.Amount , ConvertedOpportunity.Name, ...
3
votes
1answer
144 views

How can i create a Map for unrelated objects?

Background We create shadow records for Contacts that are Inactive (record type) and I am working on building a UI for the user to Activate one or more shadow records associated to that Account. ...
2
votes
1answer
990 views

Nested IF Statements

We are moving to use X-Author to upload our planner information into Salesforce via their excel app. The excel spreadsheet has been set up prior and fields are pretty fixed. We are trying to map their ...
2
votes
2answers
2k views

Accessing fields from nested SOQL and exposing them in Visualforce

I have a question in regards to Nested SOQL queries and exposing their fields, that are part of that Nested SOQL, into a Visualforce page. This is a structure sample: List<Object1> obLis=[...
2
votes
2answers
149 views

Nested query get failed

I am trying to do nested query but getting error while saving it. Contact and opprotunity have lookup to account. So I am trying to build a nested soql using this. But getting an error while saving ...
2
votes
1answer
658 views

Nested map without SObject

I'm using a nested map to store inputs from a Visualforce page and when I try to write the code to retrieve those inputs, I am getting "Error: Compile Error: Initial term of field expression must be a ...
2
votes
1answer
54 views

Only the first IF condition works, and the rest doesn't when nested in Process Builder formula

GOAL: I'm trying to create this criteria in Process Builder where I can detect phone number like (000) 000-0000, 000-000-0000 and 000.000.0000 and turn them into +1 0000000000 format. I tried to ...
2
votes
2answers
2k views

common.apex.runtime.impl.ExecutionException: SObject row was retrieved via SOQL without querying the requested field: Contact.bp_Billing_Address_1__c

I am trying to display a value from list which is created from multi-joined SOQL and though the field is part of SOQL statement, I still get the error: common.apex.runtime.impl.ExecutionException:...
1
vote
1answer
138 views

Many unnested loops cause 'Apex CPU time limit exceeded'

I'm not sure what's happening, but all what I'm trying to do is to write a simple test class which inserting a lot of records. However, my records are related in different relations. My test class is:...
1
vote
2answers
3k views

How to restrict a column to display value if value exists

I have a pageblocktable that is inside pageblocksection. The pageblocktable has many columns. I want 1 of the columns to appear only if it exist. Following is my code... <apex:...
1
vote
1answer
6k views

Formula Field - Case Function

Am trying to build a formula field with multiple IF conditions, so decided to go with Case function, below is the return statement based on the picklist value 0 Member 2 Member 3 Member 22 Only a ...
1
vote
2answers
126 views

Relationship problems in DML/SOQL

I am unable to understand relationships with DML/SOQL. Example, I have custom objects Course__c and Course_line_item__c. Course_line_item__c has a lookup field on it that points to Course__c. So this ...
1
vote
1answer
13 views

Avoid specifying an outer class when using its nested class outside

How can I avoid specifying an outer class when using its nested class outside the outer? For example, I have the following: public with sharing class ClassA { public class NestedInA { } } ...
1
vote
1answer
4k views

Nested IF formulas for a simple logic field on the opportunity

Can you please cast your eyes at my formula and spot the mistake? I've been trying to crack this but to no avail. Looked through example nested formulas and this forum as well... I know I'm just ...
1
vote
1answer
3k views

How to get unique values of two fields in one SOQL?

I have a custom object named "Performance" in which there are two text fields named "Main Category" and "Sub Category". Here, I would like to first extract the unique values of Main Category from all ...
1
vote
1answer
44 views

How to look up a parent of a parent from a child

I have 2 queries and I cannot figure out how I can nest them. I have 3 objects that look to each other in this order: test_result__c looks up to test_process__c which looks up to contact. Here are ...
1
vote
1answer
146 views

How to obtain email contacts from the nested query on account object

I am quite new to SOQL and is trying to obtain a list of email address based on the result of the below nested query which returns the account ID. Here are the two custom objects related to the ...
1
vote
1answer
3k views

Nested If Statment Formula field for Text fields

Hi I am trying to create a formula field that will provide a geography field based on the value of one or more fields. I currently get the followign error Error: Incorrect number of parameters ...
1
vote
1answer
36 views

VF page render as pdf not working properly

I am trying to display some HTML(stored as HTML text in rich text field) in to vf page via output text tag. This HTML text has unordered list inside an unordered list(like a nested unordered list). It ...
1
vote
1answer
154 views

SFDX FORCE:DATA:TREE:EXPORT Nested __r Relationship Query

I am attempting to export data using the FORCE:DATA:TREE:EXPORT CLI command, using a nested query like the following (for use in our Scratch-Orgs): SELECT ...,(SELECT ... FROM My_Custom_Object__r) ...
1
vote
1answer
2k views

Custom Object Nested Query on Standard Object [duplicate]

Is it possible to do a custom object nested query on a standard object? Like so: [SELECT (SELECT Id, Case__c FROM Accounting_Instructions__c WHERE Accounting_Complete__c = TRUE AND Case__r.Id =:...
1
vote
2answers
69 views

Need help gaining access to the fields of a large nested SOQL query?

Today I am using a nested query for the first time.I have a giant query and I am having trouble using it in the best way. After a couple of days of using this style for (variable : list_or_set) of ...
1
vote
2answers
453 views

Displaying nested maps in pageBlockTable

I have a nested map - map<product2,map<string,forecast__c>>, where the string represents a month period, ie "Apr 2018". I've put the months in an ordered list of strings called ...
1
vote
0answers
990 views

How to export data queried from nested loop soql query

I need to export data by using nested loop query.Both workbench and data loader does not allow to export data queried from nested loop.Is there any way to export nested loop queried data.
1
vote
0answers
390 views

Can I show master - detail within a lightning table component [closed]

I want to show parent & child rows in table such that that on clicking a + on master row i show the child rows with different data structure right below the master row? something like pageblock ...
1
vote
2answers
749 views

apex:inputText not working inside nested apex:repeat tags

I am trying to have multiple text-boxes inside a table cell. I am creating the table using apex:repeat tag and the multiple text-boxes using another apex:repeat tag nested in the earlier one. The ...
0
votes
1answer
1k views

How to parse nested objects in JSON response

Im trying to parse the below JSON response: { "preferredLanguage":"en", "preferredLocale":"en_GB", "languages":{ "en":{ "langCountry":"en-bn", ...
0
votes
1answer
52 views

Why do I get an error on Quotes.Id in my SOQL query

I have the following query where when I remove the where part it works fine. When I add the WHERE part I get an error on Quotes.Id SELECT Name, StageName, CloseDate , Amount, (SELECT Id FROM Quotes) ...
0
votes
1answer
1k views

Nested IF with PICKVAL

I dived into a nested if statement and it's now way over my head. Could you please take a look and let me know why it doesn't work? All I wantis to categorize our accounts based on multiple criteria. ...
0
votes
3answers
159 views

What happens with an IF formula with multiple TRUE conditions?

I have a multi nested IF statement like below - what happens if a field meets more than one condition - is there a rule to determine which value gets returned? IF(CONTAINS( Custom__Name__c , "/cs/"), ...
0
votes
1answer
55 views

Spurious parenthesis issue in Nested IF statement (continued)

I dived into a nested if statement and it's now way over my head. Could you please take a look and let me know why it doesn't work? All I wantis to categorize our accounts based on multiple criteria. ...
0
votes
3answers
2k views

Save a nested query into a Map

I have a nested query: List<Case> comments = [SELECT (SELECT Id, CommentBody, CreatedDate, ParentId, CreatedById FROM CaseComments), AccountId, CaseNumber FROM Case WHERE AccountId = :...
0
votes
1answer
820 views

how i deserialize Nested Json String into Maps and need to insert it in Salesforce?

{ "ProductionOrder":"O000039", "statusType": "download", "Electronics/": [{ "Fridges": [{ "FileVar": { "Name": "Samsung", "currentext":...
0
votes
1answer
63 views

SOQL API query with custom objects and relationships. Returning a flat result - Not nested

I am working with a third party software solution that consumes Salesforce API data via WDSL. I can run queries on any of the tables to return the result object - this works fine. I need to get ...
0
votes
1answer
29 views

Hot to get value of relationship dynamic Soql

I am using the following string in a dynamic soql: SELECT id, name, orderdate__c, status__c, sold_To_Customer__r.id, sold_To_Customer__r.name, sold_To_Customer__r.customerreference__c, ...
0
votes
2answers
776 views

How to save record from a different object using nested recordEditForm

I have managed to get fields from two different objects to display in one lighting component but I am having a few problems off the back of this. When saving it will only save the main record and ...
0
votes
1answer
1k views

Compare Value of One Map with Key of Another Map to create new Map?

I have two maps, and am currently using a nested for loop to compare the keys of one map with the values of the other, and then placing the matching info into a new map. Is there a more efficient way ...
0
votes
1answer
2k views

Nested For Loop and SOQL Best Practice

I am in need of looping through three Objects: Opportunity, OpportunityContactRoles, and a custom object we will call CR__c. My question is: is it better to write a Wrapper class for these three ...
0
votes
1answer
305 views

Compile Error: expecting a map literal assignment, found ',' in nested map put values

I am compile error as in subject line for below code. Can someone please help me? Apex Code Snippet for(iterator=0;iterator<(cd.size()/2);iterator++) { answerchoices.put(sq....
0
votes
1answer
24 views

formula field with lots of nested Ifs and Ands - confusion

having a little trouble following the necessary logic to get this formula field syntax correct. i need to accomplish the following: If source_system__c="Adobe" AND If type__c="...
0
votes
1answer
81 views

Mastering Maps: Help needed for bulkifying a simple Opp Trigger Handler

As a beginner I'm currently learning how to bulkify my Apex Classes. I wrote an Apex Class with the following logic: When an Opportunity's stage is changed to Closed Won ... 1. Create an Asset for ...
0
votes
1answer
401 views

how can i revise this to avoid nested for loops?

for(String name : nameList ){ for(WrapperClass wrap : WrapListRun){ if(name == wrap.acc.Name){ accountWrapperList.add(wrap); } else if(name == wrap.con.Account....
0
votes
1answer
252 views

Trying to run SOQL query on master detail relationship between tasks and leads for Conga report

I'm trying to get a table of all the individual tasks that belong to specific leads. I only want to pull tasks that belong to leads with a custom checkbox field "hedgehog_account__c = true." The ...
0
votes
2answers
519 views

Displaying results of a nested SOQL query in Schema Explorer

I have two custom objects, Team (parent) and Player (child). I'm using Schema Explorer in the Force.com IDE to understand the data that exists in those objects. I tried the following simple query as a ...
0
votes
0answers
30 views

Compare two Set <String> and return list<String> that does'nt exist in Set2 [duplicate]

I am getting the desired result, but I want to avoid the nested FOR in my code. However my attempt failed. This is the best I could do. Can someone please guide me how I can avoid the nested FOR? // ...