Hot answers tagged

4

This is because where groups__c IN :groupIds will only return against hard matches of each single value, instead of checking against a LIKE operator. Simply change your groupIds.add(gm.GroupId); line to groupIds.add('%' + gm.GroupId + '%');, and your IN clause to a LIKE, and it should function as you expect. List<String> groupIds = new List<String&...


2

You can't change the key using Map constructor, it always uses the Id value. If you want to use any other key, you have to use a loop. Map<Id, My_Object__c> records = new Map<Id, Object__c>(); for (My_Object__c record : [/*query*/]) { records.put(record.Some_Other_Field__c); } If you want to pull a key from your inner join, then you need to ...


1

In case you are not sure about relationship API name then describe the object from Workbench and check the relationship API name. May be it is DB_Line_Items__r


1

tl;dr; Change your relationship name from "DB_Item__r" to "DB_Items__r" Explanation: Navigate to Setup -> Object Manager -> DB Line Item. Look at the relationship field (Lookup or Master Detail) on DB Line Item to Debit Note. There should be an attribute on the field definition called "Child Relationship Name". I believe that yours will say "DB Line Items",...


1

You can either remove the quotes surrounding %s otherwise the date will be considered as String, which is not correct OR simply write where CreatedDate > YESTERDAY. Please see date literals here.o https://developer.salesforce.com/docs/atlas.en-us.soql_sosl.meta/soql_sosl/sforce_api_calls_soql_select_dateformats.htm


1

The field logic should be as follows, just need to use the commented code during the selectOption assignment. public List<SelectOption> getObjectFields() { Map<String, Schema.SObjectType> schemaMap = Schema.getGlobalDescribe(); Schema.SObjectType ObjectSchema = schemaMap.get(selectedObject); Map<String, Schema.SObjectField> ...


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