Hot answers tagged

3

According to what you said - The query works if I take off the pandadoc__PandaDocDocument__c. This is because Panda documents are child objects of Opportunity. So, you need inner query to get documents: SELECT Account.BillingStreet, (SELECT Id, Name, pandadoc__Account__c, pandadoc__Contact__c, pandadoc__Lead__c FROM pandadoc__Panda_Doc_Documents__r), (...


3

Simpler way? well yes and no. We have Database.getUpdated method that returns Id of records updated in a particular time span. It takes sObject Type , start date and end date as arguments and returns ID of updated record. The tricky bit is not every object is supported, so you have add ignore list or some custom logic for objects not supported by ...


2

I took a quick look at the PandaDoc app in a dev org. There's no pandadoc__PandaDocDocument__c field on Opportunity. The pandadoc__PandaDocDocument__c object has lookups (many-to-one relationships) to Account, Contact and Opportunity. To get the records that are children of the Opportunity, you need to add another child query, eg: SELECT Account....


1

I suspect that your custom profile does not actually remove access to modify Apex code. If run against a Standard Platform User, this query returns the expected values (HasReadAccess true, HasEditAccess et al. false) in my org. Since authoring Apex isn't permissioned on a per-class basis, the permission fields on UserRecordAccess aren't meaningful for Apex ...


1

That's not how the REST API works. To get the Blob (file contents), you have to call that rest resource. This allows the response to be reasonably sized without overwhelming the client, which may be a mobile device. See Get Attachment Content from a Record.


1

The following syntax is not a dynamic query: List<customObject__c> lstCstObj = [SELECT ... FROM ...]; What you need is a dynamic query. A dynamic query normally looks like: String myQuery = 'SELECT ... FROM ...'; List<customObject__c> lstCstObj = Database.query(myQuery); What you're after is probably something like: // get the parameters ...


1

As the [doc states(https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_database.htm?search_text=getquerylocator), the argument to a Database.getQueryLocator can not be an Aggregate query You can't use getQueryLocator with any query that contains an aggregate function. There are two workarounds: If the number of ...


1

HAVING COUNT(Name) > 0 AND CustomField__c = 'myValue' Only aggregated fields can be added in HAVING filter. CustomField__c is not being aggregated in query. In above given query, you are grouping on Account__c and you can add filter in HAVING clause only on this field. I don't your problem but a valid query similar to your query would be: SELECT ...


1

1) Create a formula field FullName__c = FirstName + " "+ LastName 2) Then in your apex code create a third list: List<String> fullNameList = new List<String>(); for(Integer i=0;i<firstNameList.size();i++){ fullNameList.add(firstNameList[i] + ' '+ lastNameList[i]); } List<Contact> contactList = [SELECT Id, firstName, LastName ...


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