New answers tagged

0

You can't return the fields that you specify by querying Mobile Lists. Somehow, MC only lets you retrieve SubscriberKey from Mobile Lists both for MobileConnect and MobilePush. You can use MobileConnect data views to retrieve all the fields available on MobileConnect Data. Please check this link to see available fields and data views. From these data view, ...


0

If you do a retrieve call on this object(DE) you will get the fields that are queryable. But the only useful one is Subscriberkey it appears all the other fields have the same values for the entire audience


2

There is no simple one-line method (as in JavaScript, where we can e.g. Array.prototype.flat), its most simple form would be: List<Contact> allContacts = new List<Contact>(); for(List<Contact> contacts: accountWithContacts.values()) { allContacts.addAll(contacts); }


0

As suggested by @DavidCheng - Created a new Custom Metadata Type Setting (CMDTS) Created a field RoleId Created a new record where RecordName = 'Role Name' RoleId = 'copied and pasted roleid' Queried the CMDTS record String CSR_RoleID = [select RoleId__c from Id_Store__mdt Where DeveloperName = 'Customer_Support_Rep'].RoleId__c; system.debug('>>...


3

Personally, I would suggest that the solution is to be aware of the pitfalls of changing the Developer/API name of anything on the platform, and then not to do it. Change the label by all means, but not the API name, as only problems will ensue. There are plenty of examples where Salesforce themselves have changes the name of something (Wave -> Einstein ...


2

You can't add store an Object in an Account, nor a List of Object in a List of Account. If, and only if, you're sure it's the correct type, you can "cast" to override: accList.addAll((List<Account>)objList); If the type is invalid at runtime, you'll get a TypeException. You note that sometimes your method will return a Boolean, so this would ...


1

Since you're counting down, RestMail[i] will always be out of bounds, unless i = 0. In addition, if more than one field matches, you again run into the error. You may want to instead initialize to the maximum size, then assign instead of adding to the list, and remove the element when done with the loop. Or, simply don't add the value until you're done with ...


3

The easiest is to create a Set<Object[]>, something like the following: Set<Object[]> alreadySeen = new Set<Object[]>(); List<Schedules__c> uniqueSchedules = new List<Schedules__c>(); for (Schedules__c schedules : SchedulesToProcess) { Object[] key = new Object[]{ schedules.Month__c, schedules.Year__c }; if (!...


0

If you add an ORDER BY clause to your SOQL statement, then you can loop through the list of Schedules and remove the subsequent matching Schedules. List<Schedules__c> SchedulesToProcess = [ SELECT Opportunity__c, Month__c, Year__c, term__c FROM Schedules__c WHERE Opportunity__c IN : OppsPriorID.keySet() ORDER BY Month__c,...


Top 50 recent answers are included