Skip to main content
New
Stack Overflow Jobs powered by Indeed: A job site that puts thousands of tech jobs at your fingertips (U.S. only). Search jobs

Questions tagged [bestpractice]

Referring to the use of recognized community and platform best practices. May relate to all areas of lifecycle and all development and administration activities.

Filter by
Sorted by
Tagged with
0 votes
0 answers
29 views

Is it ok to import campaign members to a parent campaign?

Currently, we have a hierarchy with parent and child campaigns. Right now, all campaign members are housed in child campaigns. I have a campaign that isn't relevant to any existing parent campaigns, ...
svd582's user avatar
  • 1
-1 votes
1 answer
22 views

Can we call apex method with the same name but with different letter case in another class?

Can I call a method in another class with the same method name but with different cases. For example a method testMethod() is in classA. And itsl is called as ClassA.TestMethod() in ClassB. Will it ...
BeginnerBuddy's user avatar
0 votes
1 answer
54 views

Using a Custom Object or Standard Object to expose data for integration

I have a requirement to integrate with a 3rd party application for Account data (Account creation). The idea is that Salesforce will be the primary source of truth and the other application will be ...
Minz's user avatar
  • 101
1 vote
0 answers
26 views

How can I Jest Test an LWC without relying on implementation details and assuming extended HTML does its job?

I have this test: it('handles errors from getDummyApiUsers', async () => { // Arrange const mockError = new Error('Simulated error from getDummyApiUsers'); ...
Brian Kessler's user avatar
2 votes
1 answer
105 views

How do you correctly populate an External Credential from a Principal for a Named Credential?

In Salesforce, I want to consume a web API which I can successfully call from my command line like: curl --location 'https://dummyapi.io/data/v1/user?limit=10' \ --header 'app-id: SomeApiKey' In ...
Brian Kessler's user avatar
0 votes
0 answers
28 views

SF Campaign Naming Conventions for Evergreen Campaigns

I'm wondering if anyone has suggestions or best practices for campaign naming conventions when it comes to evergreen campaigns or campaigns that run beyond a single fiscal year. Currently, my company'...
svd582's user avatar
  • 1
1 vote
1 answer
83 views

Is it a best practice to give all admins the system administrator profile?

A team reporting up to me that uses Salesforce is experiencing severe disagreements around whether admins should all be given the system administrator profile, or if all but the lead admin should be ...
krock's user avatar
  • 119
1 vote
0 answers
49 views

Avoid using merge fields in validation formulas

So I've just come across this as part of Salesforce best practices for validation rules. Avoid using the IsClosed or IsWon opportunity merge fields in validation formulas. Instead, use the ISPICKVAL ...
Dan Beer's user avatar
0 votes
0 answers
69 views

Best practice for designing flows that require recursion and same-record updates

I'd like some inputs on the current best practice for building Flow automation which a) needs to update the same triggering record but only after an action (like sending an email) that isn't available ...
JustinF's user avatar
  • 485
-1 votes
1 answer
67 views

Edit the color of an email subject line in Marketing Cloud

Currently I was asked to format the subject line of an email, that is, to show it in green for example. I understand that this cannot be done but I wanted to confirm with you
CALU's user avatar
  • 1
3 votes
1 answer
95 views

apex trigger best practice - update from formula field or query for related object?

I'm working on an insert trigger that's assigning the Opportunity Record Type based on a value of a field on a custom lookup Account. Our org has a few record types that are available to users, so ...
msing's user avatar
  • 31
1 vote
1 answer
93 views

Why is using Async LWC component for Batch updates against best Practice?

Sometimes companies need to make bulk updates to all data so they can fill in object fields following a service call to an external platform that is communicating with their Salesforce org following ...
NickZeus's user avatar
  • 187
1 vote
1 answer
675 views

Is there a best practice in Flow for using "IS CHANGED" operator vs. "When to Execute Outcome" setting?

Flow decision elements have multiple ways to control when to run a particular path. I frequently have requirements which look like "when this application step is completed, move the Application ...
JustinF's user avatar
  • 485
0 votes
1 answer
30 views

How to guide org users to visit in-house documents and best practices

I have created a few best practices and guideline documents for our org users. It includes our orgs practices, limits, what should be the process etc. stuff. But the problem is: all these documents ...
Newbie in salesforce's user avatar
0 votes
0 answers
60 views

Use "Business Hours" on a custom process?

I have the following requirement: From 8AM to 5PM i should add X value to some lead's custom field this should happen to new leads being inserted, any insertion outside of that range should not be ...
Giovanni's user avatar
-1 votes
1 answer
47 views

Are there any risks to creating custom fields on a Salesforce custom object from a managed package?

I've created custom fields on a custom object in my org that came with Agile Accelerator. I want to know if there are any downsides to doing this. My largest fear would be updating the package and it ...
AbbyVS's user avatar
  • 3
2 votes
1 answer
169 views

Best Practices for CRUD/FLS/SHARING checks in unmanaged code

I'm auditing an ORGS unmanaged Apex and trying to form a concrete framework for when I care about PMD warning for ApexCRUDViolation & ApexSharingViolations. It's always been my understanding that ...
NSjonas's user avatar
  • 10.2k
1 vote
1 answer
114 views

trigger to update parent record without sub-query

suggestion required: Below trigger updates a parent record (an Account) fields based on changes to its related child records (Opportunities). The trigger works well and updates the parent record ...
Gaurav kumar's user avatar
2 votes
3 answers
767 views

How to avoid if-else/switch chains and preserve open/closed principle in Calculator program (apex) [Solution: Strategy Pattern]

TL;DR In apex, is it possible to get around the use of if-else/switch statements to supply unique code via an enum or other parameter? Something like storing functions or class instances in maps or ...
Jwok's user avatar
  • 789
0 votes
0 answers
110 views

Best practice for deleting One Time Batch Jobs

As you know there is a common case like data cleanup and data migration or even the case when we add new field which should be populated on new records and we need to populate it on all existing ...
Dmitriy Yurkin's user avatar
1 vote
3 answers
857 views

Where does the colon (:) belong in the Apex SOQL query - to the operator or the variable?

I'm asking about a best practice - Salesforce gives us freedom here but we'd like to establish some sort of consistency in our team. Similar to the case size - although Apex is case-insensitive, it's ...
Przemysław Długoszewski-Tamoń's user avatar
3 votes
3 answers
260 views

Should be Triggers inactive by default in Unit Tests?

Apex Triggers can cause problems when developers need to create test data. This is because triggers can execute a lot of logic, such as validation, API callouts, and multiple SOQL and DML statements (...
Piotr Gajek's user avatar
  • 2,754
0 votes
1 answer
106 views

Is it best practice to have separate apps for different teams within an organisation?

This is a super basic question, so apologies if this is the wrong platform. My experience is largely with platforms like Zendesk and Kayako and have done a bunch of learning through Trailhead, however ...
Mike.A's user avatar
  • 3
1 vote
2 answers
679 views

How to populate wrapper's properties?

The question is about the best practices when working with the Wrapper class. Assumptions We have PersonWrapper. public class PersonWrapper { private String id; private String firstName; ...
Piotr Gajek's user avatar
  • 2,754
0 votes
1 answer
48 views

Custom Aura Components Throwing Errors in Builder - Best Practices

We are using custom Aura components in our Lightning Community and these components like most, respond to whomever is logged into the Lightning Community and populate themselves with relevant data. My ...
Slinky's user avatar
  • 135
0 votes
1 answer
85 views

CODE BEST PRACTICE - Calling the custom metadata check from every method in Trigger

I had previously asked how to write test class to cover custom metadata in Test class coverage required for Custom metadata that turns a Trigger on and Off and found solution from the answers. As a ...
Abhinandana 's user avatar
1 vote
1 answer
197 views

Best practices Use == or isSameDay apex date

Currently in production I check if two dates are identical in apex by doing date1 == date2 I see in the documentation that there is also isSameDay Would you know if using == between two dates is a ...
arnaud's user avatar
  • 106
0 votes
1 answer
422 views

Is it considered bad practice to have Cases permanently owned by a Queue?

I am using Salesforce for Case Management. I have quite a number of queues (about 250) set up for my various teams and I need all members of a queue to continue viewing cases even after a specific ...
JustinF's user avatar
  • 485
1 vote
1 answer
284 views

Why are unused imports bad in LWC?

For Ex, if I use uiRecordApi and import getrecord but never used that, why is this a bad practise? Does it affect performance, script load times etc?
Apex Srinivas's user avatar
1 vote
1 answer
316 views

Dynamic SOQL inside for loop

We have some legacy code in one of Salesforce orgs. While going through code, I encountered this piece of code List<query_metadata__c> dyQueries=[select id,query__c,object__c from ...
Amit Rajput 's user avatar
0 votes
1 answer
100 views

Best practices for managing Github during Salesforce Releases?

My team is working on a project that will likely take over 6 months. We are making edits to Site pages, classes, fields, flows, etc. Part of this process involves staging changes in a partial sandbox ...
user avatar
3 votes
2 answers
6k views

Salesforce Scheduled flow bulkification best practice/ clarity

I have a question about bulkifying scheduled flows. When you create one you have two options. Use a get element to grab the records you want or set an object & conditions. I've found the ...
Thomas Gunn's user avatar
-2 votes
1 answer
206 views

Mass Contact Merge in Apex

I am trying to implement Mass merge of contacts in apex, Like uploading a CSV of multiple records which has would have details like retainable ID , duplicate contact Id etc., now I need to traverse ...
Kishore's user avatar
1 vote
1 answer
201 views

prefix Phone field, different Objects

I have a method in beforeInsert trigger, when new SObject is inserted it should add a numeric prefix. That alone is working, but my assignment now is make it much shorter. Currently I'm having 1 block ...
jur1s77's user avatar
  • 47
2 votes
3 answers
507 views

Which way efficiently fill a map

In a certain scenario I need to fill a Map<Id, List<...>> In our example let's say All the contacts linked to their accountId (Map<Id,List> contactsPerAccountId) I'm asking myself ...
Yaac0's user avatar
  • 165
1 vote
0 answers
413 views

Is there a design pattern for structuring Record Triggered Flows?

Whilst reviewing The Ultimate Guide to Flow Best Practices and Standards from Salesforce, I saw no mention of any design patterns or best practices on how to handle structuring Record Triggered Flows ...
Swisher Sweet's user avatar
0 votes
0 answers
138 views

What are the benefits of the internal Platform integration with using Platform Events?

I'm learning about the Event-driven Architecture from Trailhead, this unit to be exact: Understand Event-Driven Software Architecture. As in general I can say that the concept is pretty clear to me (...
Przemysław Długoszewski-Tamoń's user avatar
0 votes
2 answers
505 views

Best practice for async apex classes (Queueable, Batchable) in relation to service classes

When creating async apex classes (e.g. Batcheable, Queueable), especially classes associated with specific SObjects, what might be the best practice for where these async classes should be housed. ...
Jwok's user avatar
  • 789
0 votes
1 answer
671 views

Platform event Fired from two objects

We are planning to build a platform event, which should publish changes from two objects. Consider there is an insert/update of records in Account object or Customer__c object. We need to insert/...
SFDC_Admin's user avatar
0 votes
1 answer
119 views

Is pushing all changes on one branch on Git a great idea?

We didn't use much Git during development and we created multiple functionalities. Is pushing all changes on one branch a great idea or should we create one branch for every feature? Advantages: we ...
NonameJavaNoob's user avatar
3 votes
2 answers
287 views

What do I have to do in this case: List<Sobject> or Sobject?

I am beginner in Salesforce and I have to verify if the field Order.ShippingCountry is filled using the OrderId. I would like to reuse this method below to fetch the Order.ShippingCountry. But I was ...
Cline's user avatar
  • 111
2 votes
0 answers
110 views

How to handle triggers with dependent objects?

I have a problem regarding triggers on objects that effect other objects. When a Contact is saved on Salesforce, in my case it also saves an Affiliation. I have a trigger on each object that when ...
Patrick Packham's user avatar
0 votes
1 answer
1k views

Why have service classes? (Service Layer Model)

tl;dr - What are the advantages of having handler and service methods separate housed in separate classes, rather than joined in a single class. Background Salesforce and others reference using ...
Jwok's user avatar
  • 789
0 votes
1 answer
153 views

What are the best practices for wsdl2apex and SOAP callouts from Salesforce

I wonder, what are the best practices I should apply when I need to integrate Salesforce with an external SOAP webservice? First of all - Apex class names generated with wsdl2apex have names which ...
Grzegorz Połuch's user avatar
0 votes
1 answer
345 views

Is hard coding custom metadata type name in Apex a good practice?

I am new to custom metadata types (CMDT). With the Winter'22 maintenance, I learned that there is no longer a need to write Salesforce Object Query Language (SOQL) to access custom metadata records in ...
Naven's user avatar
  • 55
2 votes
1 answer
2k views

How to share lwc modules as reusable utility components

So I am looking to implement reusability pattern across Lwc's using utility components. What Im not understanding is limitations of importing modules/dependencies like ShowToastEvent. If I create a ...
CloudHugger's user avatar
  • 1,757
6 votes
2 answers
1k views

SOQL query performance with many or few fields

I have a doubt. Sometimes the developer repeats many queries in different places, but what changes is the number of fields. I sometimes think about centralizing queries, but queries can have fields ...
dsd's user avatar
  • 121
1 vote
3 answers
2k views

@testSetup best practice

I'm trying to understand something so I can use @testSetup annotation wisely. As i read here: https://developer.salesforce.com/docs/atlas.en-us.202.0.apexcode.meta/apexcode/...
Benj's user avatar
  • 45
2 votes
3 answers
1k views

How to prevent accidental config changes made directly in Production?

Too many times we've had developers (as well as our release manager, who also dev's) inadvertently make a change directly in Production because they had the Prod org open alongside their dev org in ...
Brent Bowers's user avatar
  • 3,144
0 votes
1 answer
299 views

Count of RelatedLIsts on a Page Layout

Using Tooling API, or Reports, is there a way to find how many related lists are on each Page Layout ? I am dealing with a large Org with more than 600 Objects, and some objects have more than 100 ...
GroundToCloud's user avatar

1
2 3 4 5
9