Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.
9 votes

Better practice to analyse and quantify code coverage with OR conditions

Not specific to this scenario, the below applies in general Don't write Unit tests with focusing only code coverage as target. We should focus on writing tests with both positive and negative ...
user avatar
9 votes

Workflow versus Process Builder. How to choose which to use?

Last I checked, Workflow performs significantly better on CPU Time. That on its own is a compelling argument to reverse your assumption. Instead ask yourself why you would use Process Builder when you ...
user avatar
  • 142k
8 votes
Accepted

How can we inactivate user those are not logged in last 120 days

List<User> usersToUpdate = new List<User>(); for(User u : [Select id, IsActive from User where isActive=true and lastLoginDate <= :DATE.TODAY()-120]){ u.IsActive = false; ...
user avatar
  • 323
7 votes

How to trigger an automation from another automation

You can certainly check the start and status of an Automation using a SSJS Script Activity. If you don't see it in your list of Activity types, SFMC Support can enable it for you. Here's an example ...
user avatar
  • 27.9k
7 votes

How to automate data import on full sandbox refresh

If you're willing to take the time, the SandboxPostCopy interface lets you write code that's called once upon refresh. You could write a bunch of code to populate records. If you're planning on moving ...
user avatar
  • 430k
7 votes
Accepted

can i run an automation only when a data extension have data or records?

There is a new Verification Activity in Automation Studio. You can set this to verify if there are no subscribers in DE then stop the automation. This will prevent the error. New Verification ...
user avatar
  • 27.9k
7 votes

Workflow versus Process Builder. How to choose which to use?

I'll add: When working with e-mail alerts, the setup UI knows which workflow rules use any given alert and will show you this in a very simple way. The setup UI has no idea which Process Builders use ...
user avatar
  • 10.6k
6 votes
Accepted

Object Reference Error on "Automation" RetrieveRequest

Add the ProgramID to the Properties list when making the retrieve. The Automation object has a few issues with it.
user avatar
  • 590
6 votes

Salesforce Command line Dataloader - Passing Parameters to Process-conf.xml ?

Yes, you should absolutely be making use of the config.properties file - it's best practice. You can then add all of your UN and PW to it and adjust the key's accordingly. project/config/config....
user avatar
  • 1,844
6 votes
Accepted

How to edit the "created by" field for case attachments?

Take a look at this help article: Considerations before having Create Audit Fields enabled: Salesforce has the ability to set system fields through the API. When you are migrating data from an ...
user avatar
  • 142k
6 votes
Accepted

Automation studio SFTP file drop trigger to Import Activity

So the way I solve file conflict scenarios if I have no control over the file naming patterns is: Create 2 File Locations pointing to 2 seperate folders in your FTP: File Locations: import/...
user avatar
6 votes
Accepted

How to pre-populate fields when creating a new record?

In lightning: you can do that using Set Predefined Field Values for Quick Action Fields. Here you predefine values for the new record created in quick action attributes and thus they gets ...
user avatar
6 votes

Update Salesforce object with a Script Activity

You can't execute AMPscript directly from a Script Activity, since they're only for server-side JavaScript code. There are also no SSJS functions for updating SF objects. You can, however, force ...
user avatar
  • 27.9k
6 votes
Accepted

SSJS Error retrieving the automation activities of an automation

The issue is that the column AutomationTasks is not a retrievable property in the Automation object. From Describe call on the object: <Properties> <PartnerKey xsi:nil="...
user avatar
  • 27.9k
5 votes

programatically create Partner Community Accounts using Apex / API

To enable the accounts as partner accounts, set the 'IsPartner' field to true after creating the account (it cannot be done during creation, only by update). Account partnerAccount= new Account( ...
user avatar
5 votes

Better practice to analyse and quantify code coverage with OR conditions

First, your Real usage seems wrong to me: This happened because of the case that accountMap didn't contain the key and Map#get(key) method will raise an exception False! If a Map does not contain a ...
user avatar
  • 4,972
5 votes
Accepted

Automation Query Error in Marketing Cloud

The issue is with SMTPBounceReason. This field can return an excess of 4000 characters. To bypass this, remove leave the length field blank. This will force it to VARCHAR(MAX) (Over 4000 characters). ...
user avatar
  • 6,459
5 votes

Journey Builder: "Process all records" vs "New Records"

The location of this configuration has changed some in the last couple of years. It is still an option when using a Data Extension entry source connected to an Automation Studio automation. After ...
user avatar
5 votes
Accepted

Create or update Automation with Marketing Cloud REST API new endpoint

I made some investigation and think that to create/update Automation using REST, it is needed to use .json payload in this format: { "id": "e906af34-4a19-42e9-9ce2-ac6413a77a09", "legacyId": "...
user avatar
4 votes
Accepted

Is there a list of every possible metadata component?

These are listed in the metadata API guide http://www.salesforce.com/us/developer/docs/api_meta/ AccountSettings ActionOverride ActivitiesSettings AddressSettings AnalyticSnapshot ApexClass ...
user avatar
  • 11.3k
4 votes
Accepted

Can I force a recalculation of objects?

I think the easiest approach would be to export all the OpportunityLineItems (Products) that you need to update (via a report or dataloader export, making sure you include the OpportunityLineItem.Id), ...
user avatar
  • 5,165
4 votes
Accepted

Automated Testing Salesforce one app (3rd party)

There is no way you can officially get access to the Salesforce1 IPA and APK files. Of course, there are other tricks in which you can recover these files from the device but they wilL NOT obviously ...
user avatar
4 votes

Process builder not activating in production

That gack is mentioned in this post, in which we're told is related to this known issue. You're encouraged to contact Tier 3 support if you get this error. They have a fix. They don't say what causes ...
user avatar
  • 430k
4 votes
Accepted

Export Data Extension data to Email, not FTP?

Short Answer: No Explanation: The two methods of exporting data from a data extension are : If the file is less than 20 MB it can be downloaded to your pc. Files larger than this will have to be ...
user avatar
  • 6,459
4 votes
Accepted

Using Automation Studio to Export a Data Extension

This is easily done with an Automation containing a Data Extract Activity. Go to Automation Studio and create a new automation. Add a new Data Extract Activity, choose a name, a file naming pattern ...
user avatar
4 votes

Workflow versus Process Builder. How to choose which to use?

Once a process in Process Builder has been activated, it cannot be modified, only cloned. Conversely, a workflow can mostly be modified while it is active. For orgs that might need to update their ...
user avatar
4 votes

Workflow versus Process Builder. How to choose which to use?

I'm not sure I prefer one over the other, but one thing that keeps pulling me back to workflow rules is that I can easily see all the field updates and where they are used. Process builder hides the ...
user avatar
4 votes
Accepted

Inserting an iframe in a Visual Flow

iframes have been disabled in Salesforce since 2015 to prevent clickjack. Please see resource here: https://help.salesforce.com/articleView?id=IFRAME-or-Web-Tab-Content-Displays-Blank-Page-...
user avatar
  • 370
4 votes
Accepted

Restrict tab access via search

It's not enough to remove access to the tab, or, strictly speaking, field level security. You need to remove access to the object itself (turn off "Read Object", e.g. "Read Accounts"). Triggers are ...
user avatar
  • 430k
4 votes
Accepted

Automation skipped

Usually what I do in these types of automations is include a second 'failsafe' script activity after the one used to initialize the next automation. I have found that depending on the activity in the ...
user avatar
  • 27.9k

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