I am trying to use Child to Parent Relationship queries, but the ! doesn't cover the parent record's accessibility.  Say I am owning a Contact, but I don't have access to its parent record 'Account'. Does this relationship query give access to the parent record 'Account' by passing the security layer?
123199
A->B are two objects connected using lookup relationships. If somehow, I get read only access to child record but do not have access on parent record then still i am able to see data from parent record through formula fields. Similarly will SOQL in Apex also allow me to fetch fields from parent record regardless of using 'WITH Sharing ' keyword at class level?
111298
Are Parent Fields supported in lightning Datatable?  I'm trying to display Account Name with Contact information, but it seems parent fields are not supported in lightning datatable.  Component:  &lt;aura:component controller="PagingSortingController"&gt;     &lt;aura:attribute name="mydata" type="Object"/&gt;     &lt;aura:attribute name="mycolumns" type="List"/&gt;     &lt;aura:handler name="init" value="{! this }" action="{! c.init }"/&gt;     &lt;lightning:datatable data="{! v.mydata }"          columns="{! v.mycolumns }"          keyField="con.id"         onrowselection="{! c.getSelectedName }"/&gt; &lt;/aura:component&gt;   Controller:  ({     init: function (cmp, event, helper) {     cmp.set('v.mycolumns', [                 {label: 'Contact Name', fieldName: 'Name', type: 'text'},                 {label: 'Phone', fieldName: 'Phone', type: 'phone'},                 {label: 'Email', fieldName: 'Email', type: 'email'},                 {label: 'Account Name', fieldName: 'Account.Name', type: 'text'}             ]);         helper.getData(cmp);     }  })   Helper:  ({     getData : function(cmp) {         var action = cmp.get('c.getContacts');         action.setCallback(this, $A.getCallback(function (response) {             var state = response.getState();             if (state === "SUCCESS") {                 cmp.set('v.mydata', response.getReturnValue());             } else if (state === "ERROR") {                 var errors = response.getError();                 console.error(errors);             }         }));         $A.enqueueAction(action);     } })   Apex Controller:  @AuraEnabled     public static List&lt;Contact&gt; getContacts() {         List&lt;Contact&gt; contacts =                  [SELECT Id, Name, Phone, Email,Account.Name FROM Contact];         return contacts;     }
123689
I have a hierarchical query in Oracle 11gR2 that returns something like this:   Parent (Level 1)  Child (Level 2)  Grandchild (Level 3)  Child (Level 2)  Grandchild (Level 3) Grandchild (Level 3)  Child (Level 2)    The query I would like to write should get all the rows matching some predicate, for the minimum level; i.e. nearest the parent. For example, if one of the child rows matches the predicate, it should return just that row, irrespective of whether any grandchild rows match. If multiple child rows match, it should return all of them, again irrespective of grandchild rows. If no child rows match, it should return any grandchild rows that match, etc. (In the real system I have a lot more than three levels, and lots more rows per level.)  I assume this is possible with analytic functions, but I'm not sure which one to use, or how to integrate it into my query. I've seen similar problems solved using min (level) keep (dense_rank last order by level), but that doesn't seem to do quite what I want.
17784
Not sure if this is actually desired, but  is currently showing me (a SE non-dev)  results, including all queries that are being run against the DB (not talking about data-explorer queries of course, talking about site rendering queries).    New feature of  or a deployment whoops?  Edit:  I didn't realize that data was .  With that in mind, this probably isn't a security problem after all, and is in fact more likely .
116124
I've been trying to block ANY queries in my BIND server with no success.  I followed this post  which says that I can use minimal-responses but it doesn't work.  None of the answers fit my current configuration.  view world {     match-clients   { world-clients; };     allow-recursion { none; };     recursion       no;     allow-transfer  { key XXXXXX; };      minimal-responses yes;      forwarders      { };      include         "/etc/bind/world.conf"; };
42901
I'd like to run a query using the EntityFieldQuery object. I need value from both the node and node_access table therefore I'd need to use INNER JOIN. From the d.o documentation I can't figure out how this is possible.  Here's what I have --  $query = new EntityFieldQuery(); $result = $query-&gt;entityCondition('entity_type', 'node') -&gt;entityCondition('bundle', 'node_access') -&gt;propertyCondition('type', 'external_link') -&gt;propertyCondition('status', 1) -&gt;fieldCondition('gid', '3', '=') -&gt;fieldCondition('realm', 'domain_id', '=') -&gt;fieldCondition('grant_view', '1', '&gt;=') -&gt;range(0,1) -&gt;execute();
34344
The standard object Account has a master-detail relationship with a child object called Address__c. In the Address__c object we store the various addresses an account might have.   My question is as following:  Can you make the creation of an address mandatory when an account is created by the user in the UI?  Thank you
20384
With the following code, if the current user does not have 'bypass node access' (see  for exact verifications), then the query checks for node_access, even though I do not use the "node_access" tag.  How can I avoid the node_access check with the following query for a non-admin user?   I'm using this code from a module, so I can verify permissions myself, no need for node_access checks.    $query = new EntityFieldQuery;   $result = $query     -&gt;entityCondition('entity_type', 'node')     -&gt;entityCondition('bundle', 'foo')     -&gt;fieldCondition('custom_id', 'value', $custom_id)     -&gt;execute();
81531
We had a small widget that allowed customers to share records that were set to a private sharing model in our community. Everything was rather simple and it would simply allow them to select users that were visible via Sharing Sets and create an __Share record in APEX.  I've been reported recently that an error is thrown but only on the community side of things. Nothing seems to be working where it was working. We are using    Customer Community Plus licenses.  The error being thrown is : System.TypeException: DML operation INSERT not allowed on &lt;Object&gt;__Share which seemed to indicate access not available on the object. That seems odd because they are able to interact with the object just fine in order to create/edit/delete them.  I looked up the Sharing Model (its private both internally and externally), I looked at the profile and their access and the sharing sets in the community. Like I said, they seem to interact fine with the objects when it comes to seeing the records and their right.  Additionally, standard license users can use the component fine and also share with community users without a problem. They also see the records as expected.  Am I missing an update or something that seem to make it so this doesn't work anymore? Anyone having trouble with this or encountered the same problem?
35632
On Opportunity there is a lookup relationship to Account.But why it behaves as Master-Detail as we can create Rollup Summary Fields on Account.  Similarly if we delete Account then Contact gets deleted but there is lookup relationship between Contact and Account  What is the relationship between Opportunity/Account and Contact/Account ? (Lookup or Master-Detail)
44574
I have requirement where an user should not be able to submit  a master record for approval until all the related child records are approved.  Submit for approval button on approval history related list cannot be removed. So, this is not an option.  The approach I was thinking is to have a custom field on the master record which specifies whether all child records are approved and add that field in the entry criteria. S0, the record won't be submitted as it does not satisfy the entry criteria. But I need to inform users why they are not able to submit the record. So, I want to customize the error message as well. I have done some search and could not find anything.  Can anyone please let me know if this is possible or suggest any workaround for the above scenario?
39112
I would like to be able to execute a SOQL query that will allow me to see which users have access to a certain record type for a certain object.  For example, if I have a case record type called Phone Team, I would like to make a query that returns the names of all the users that have been assigned the Phone Team record type, as can be seen in the native user interface in a profile's Object Settings page.  So far I have managed to get a query that can get the names of all the users that have, for example, read access to the case object:  SELECT Assignee.Name FROM PermissionSetAssignment      WHERE PermissionSetId IN          (SELECT ParentId FROM ObjectPermissions WHERE SObjectType = 'Case'               AND PermissionsRead = true AND Parent.IsOwnedByProfile = true)   However, there doesn't seem to be any way to access record type assignment in the same way that you can object permissions.  I see from  that the info can be obtained via the metadata API, but I would much prefer to do it by SOQL if possible.  Thanks
103352
The  tells me I can answer protected questions, but I still can't answer protected questions on The Workplace. I know it is  (also ); I have more than 10 reputation but the association bonus does not count.  I propose that the new user restriction privilege page's check should factor in the association bonus.
94031
I have a query in a before-update trigger that looks like following:  [SELECT Id,(SELECT Id,Active_opp__c              FROM Opportunities              ORDER BY Days_from_Last_Stage__c ASC)   FROM Account WHERE Id IN: conAccMap.values()]   I have checked this in query plan and it looks like :    Is there a chance that the inner query will cause selective query error since I dont have a WHERE Clause on an indexed field in the inner query?
98595
I have an account with account hierarchy setup and there is one Custom object &quot;Agreement&quot; added as related list on the account. When, I search an account with an account name on global search I want all related agreement records of that account as well as of all account comes under the account hierarchy, to be displayed after search. How to achieve this in Salesforce? For Example: There is an account'A' with child accounts A1, A2, A3 under Account Hierarchy. and there is a related object Agreement 'AG' on account 'A' and 'AG1', 'AG2', 'AG3' on Account A1, A2 and A3 respectively. Ideally, the relationship should look like below:                                           A-&gt;A1-&gt;A2-&gt;A3  (Account Hierarchy)                                                                                                       |  |   |   | -&gt; (Lookup relationship)                                             AG AG1 AG2 G3  (Agreement records of respective account)  So, now If I search on global search by account name of an account 'A' then it should give me list of all agreement records of account 'A' as well as 'A1', 'A2' and 'A3'. can anyone help to achieve this functionality? How to perform this exactly?
102621
Now there is a question we commonly use this technique to maintain the parent child relation i.e we store all the entities in one tables with a parent_id column and all top most parents have 0 in the parent_id column this is a good and normalized technique i agree but there is a disadvantage also, it’s slow and inefficient. This is mainly caused by the recursion like for each parent we have to run the query again and again to make a tree  SELECT id FROM `table` WHERE parent_id=something   I have looked at the solutions some might try to do it with any programming language by running query again and again which makes a loads on server , Some have provided the stored procedure but that also involves the recursion.  So my question is can we do it with one database query for the tree(joins or subqueries) if we know the depth or if we don't know if it is possible so how can we get the top most parent(i.e parent_id=0) of any child if it is not possible then why this technique is so famous while it has the flaws or we have another solution for this? . i have added the sql fiddle but it only has the schema
93413
I’m in a permanent discussion with the developers of the company where I work because they say it is better to get rid of relationship enforcement (via FOREIGN KEY constraint definitions) in a relational database in order to speed up large queries and to gain better performance. The platform under consideration is MySQL 5.x, and no FOREIGN KEY has been set up, even some PRIMARY KEY constraints of the relevant tables are missing which, at least for me, is not reasonable. Maybe they’re right and I’m wrong, but I don’t have enough arguments to discuss about this situation. This has been the preferred approach for three years now. I’m new in this company (only one month) but, as the product “works”, there is hesitation to enhance the database; nevertheles, the first thing I noticed is one page taking 1 minute to load (yes, 60 seconds!). One of the claims behind the current state of affairs is that a “denormalized” database is faster than a normalized one, but I don’t believe that’s true. Most of the relevant queries include JOIN operations, which makes them run very, very, very slow with large amounts of data (the database contains millions of rows). Commonly, the handling of “CRUD” operations is implemented at the application program code level; for example, in order to DELETE some data FROM, let’s say, TableA:  it is necessary to first check on the fly if there is some relationship between the rows of TableA and TableB, in case that said relationship is “detected”, then the app program code won’t allow to DELETE the pertinent row(s), but if for some reason the app program code fails, then the DELETE operation will “succeed”, no matter if there is any relationship regarding the involved rows and tables.  Question Could you help me to elaborate a good, accurate and solid answer to enrich the debate?  Note: Maybe something like this has been asked (and answered) before, but I couldn’t find anything by means of Google.