Hot answers tagged

5

It is interesting that the documentation that I've found doesn't explicitly state this scenario is covered, at least in the main text, where it says: The value of the IN or NOT IN operator in WHERE clauses, allowing filtering on a dynamic set of values. Note that this is of particular use with a list of IDs or Strings, though it works with lists of any type ...


3

Sharing does not affect query selectivity The records have to be located first before the sharing rules can be applied. If you think about it, record visibility includes: The Org Wide Defaults Criteria-Based Sharing Rules Manual sharing Apex sharing Record ownership Role hierarchy Territories Account/etc team membership Salesforce, in effect, uses a ...


2

Here's a commented example of how this code could be restructured using a map to associate the id values to one another. As an aside, don't use String for Id values. It is safer to use the correct data type whenever you can. trigger Add_Event_ID on Hum_data__c(before insert) { // a place to store our results Map<Id, Id> callIdToEventIdMap = new ...


2

Try this code, here I'm assuming call__Callid__c is lookup field trigger Add_Event_ID on Hum_data__c (before insert) { List<Id> callIdList = new List<Id>(); for (Hum_data__c h : Trigger.new) { callIdList.add(h.call__callid__c); } Map<Id,Id> IdMap = new Map<Id,Id>(); for(call__Call_Detail__c cc : [...


2

It looks like an issue with the Trigger Code, it can be a code quality issue (SOQL Query in a loop, excessive use of SOQL, etc. ). I think that you can still load your data but a code review should be done to bulkify the triggers code. If the Business logic implemented in the trigger (on that object you're loading) can be bypassed, you can deactivate the ...


2

I don't know if it is a bug in the way ORDER BY is applied, but if you want it to work you have to include the ORDER BY field in the SELECT output, like: SELECT String1__c, String2__c, Number__c FROM Metadata_Type__mdt WHERE Number__c > 0 ORDER BY Number__c ASC


2

First thing to note Right away, the isPrimary field on AccountContactRelation (ACR for short) is not writable. It is automatically set, and becomes true if the AccountId on the ACR record is the same as the AccountId field on the related Contact. An ACR record is automatically created (if a suitable ACR doesn't already exist) when you set or update the ...


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