Hot answers tagged

5

You've got the right idea just the wrong syntax for the semi-join (not technically an inner query). Try this: List<Contact> conList = [ SELECT id, name FROM Contact WHERE id IN (SELECT contactId FROM Opportunity WHERE StageName = 'Closed Won') ];


2

Your query is generally correct. Contacts will be between 3 years and 3 years and 364 (or 365 on leap years) days old assuming you run this query annually. If you want to be more precise, consider LAST_N_DAYS instead: LastModifiedDate < LAST_N_DAYS:1095 This will generally find contacts that haven't been modified in the more usual sence of "last ...


2

It's a weird behavior with the compiler. Change it to Database.Batchable<sObject> instead. Notes: You don't need to copy the list before deleting it. Use an inline query. Don't query fields you don't need. global Class Batchsample implements Database.Batchable<sObject>{ global Database.QueryLocator start(Database.BatchableContext BC){ ...


1

In your code, you need to set the username and email for the first user. You aren't seeing the first user because the email and username are not set therefore the record is not created. User[] users = new List<User>{ new User(FirstName='Test', LastName = 'User', Email = 'some_email@email.com, Username = '...


1

This is kind of clunky and would be far more efficient if you populated your Sentio Tagging using SFMC's EmailIds and Names, such that you could use a plain UNION query. But this should work for you... SELECT y.Emailid, y.EmailName FROM ( SELECT ROW_NUMBER() OVER(PARTITION BY Emailid ORDER BY x.CreatedDate DESC) AS RowNumber, ...


1

Ok i got the answer, and it's a stupid one... It appears that as I query a list, if I debug it I don't have the debug information of the parent. I have to debug element by element to see the parent relationship. list<FLU_PaymentDeadline__c> pdl = [Select FLU_Contract__r.Name, FLU_Contract__r.FLU_ReviewAutoPay__c, SystemModstamp, FLU_PaymentMeans__c ...


1

Two things are going on here. First of all, you debug the list itself, so you get type coercion. If you want to view all elements in list with 10+, you should first serialize it. Second, a while back Salesforce made a change in Sprint 19: To help prevent connection pool timeouts caused by exceptionally large queries, strings are now truncated at 512 ...


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