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

Questions tagged [business-logic]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-2 votes
1 answer
33 views

Help on a method to calculate date ranges [closed]

I want to calculate date ranges based on number of splits (called here nbr) between two dates. My Code works only for nbr equals to 1or 3; getRangesBasedOnNumber (2, Date.newInstance(2022, 04, 01),...
user avatar
  • 3
0 votes
0 answers
12 views

How to constrain field service resources to enter Product Items while they take parts from Warehouse

Scope : To force field service resources to enter product items in a salesforce while they pick up parts from salesforce. Business Requirements : 1.) We are trying to implement field service inventory ...
user avatar
0 votes
1 answer
30 views

Will Method called in for loop with Update statement(dml) will have governerLimit Issue

I have below requirement ,i have called method in for loop ,i want to know 1.Will this cause an Dml governer limit issue? 2.how we can optimize the below code Requirements - Update Primary contact on ...
user avatar
  • 3
0 votes
1 answer
50 views

Not able to check map condition in trigger

I have a requirement where on Update of account I need to check case if contactId is present and if that contacts Account is same as Case accountId then need to update one field. I have written some ...
user avatar
  • 5
0 votes
2 answers
43 views

Better way of searching for values in apex list

I have a list of unique strings say 'one' to 'ten' as below: List<String> values = {'one', 'two', 'three','four','five','six','seven','eight','nine','ten'}; I have a requirement to check if the ...
user avatar
  • 169
0 votes
1 answer
67 views

Validation Rule to find a duplicate value

I need to create a custom field, say REG_NO__c(text) which allows N/A multiple times but should not allow duplicate values from ST001-ST999, I tried to make it as unique(case insensitive), but it also ...
user avatar
  • 13
0 votes
3 answers
60 views

Is there any way we can identify the insertion/updation of record is happened through UI or not

I have requirement where I have one trigger and its calling handler and in handler i have one method, I need to run that method if I am updating the record through UI in,i dont want to run trigger or ...
user avatar
  • 1
-2 votes
1 answer
200 views

how to compare old and new values for specific fields in trigger

I have requirement where I need to compare few fields in account object, If there is any change in the value of any of the field I need to insert into log object. Those fields can be change later as ...
user avatar
  • 3
0 votes
1 answer
33 views

Fetching the Opportunities Id from a list of Opportunities name

Fetching the Opportunities Id from a list of Opportunities name. I have an asset list through which i am creating opportunities. However at the end i require a map of which contains the key as ...
user avatar
0 votes
1 answer
24 views

Architecture quest - what is the efficient way to track an opportunity amount being used and reallocate the unused balance [closed]

To all the sf experts out here, trying yo get your inputs for a use case that i’m trying to incorporate. Use case: We have a currency field called “Amount Owed” on opportunity which holds an $ value. ...
user avatar
  • 25
0 votes
2 answers
52 views

I have written a logic for deciding which user can change the owner of an Account record. Is there a way to generalize this for other objects?

The logic is as follows: public static void changeOwner(Map<Id, Account> newAccs, Map<Id, Account> oldAccs) { Map<Id, Id> objOwnerMap = new Map<Id, Id>(); for(...
user avatar
  • 456
-3 votes
1 answer
27 views

Getting Error while running the class

You have uncommitted changes .. I am running it from anonymous Below is my class, i am not doing any DML ,just hitting api I am hitting the api to get different salesforce instance Status and sending ...
user avatar
0 votes
1 answer
506 views

get custom setting fields names in apex class

Requirement-I need to create a map of custom setting in apex class with fields and value like. "Name":"test", "cal__c":"tesq", "industry__c":"...
user avatar
0 votes
1 answer
33 views

Need to get count of same contact in 2 account

Requirement- I have 2 accounts (source and target) and i want to get the count of same contact name in target account Ex- Ac1 ==> {con1,con2,con3 con4} AC2 ==> {con1,con2,con4} then count should ...
user avatar
1 vote
1 answer
1k views

get second highest salary of employee using soql

I need to calculate second highest or 4th highest salary etc.. what is the way to calculate it. select salary__c from Staff_Details__c order by salary__c desc I am getting the salary in desc order but ...
user avatar
0 votes
1 answer
71 views

Apex trigger To throw an error if case is updated with ContactId Which is associated with Account

I have requirement where on Case Update if ContactId in same of accounts contact associated with that case then needs to throw an error. Example; Case 1 AccountId 1 and contactId 1 If case 1(...
user avatar
  • 1
0 votes
1 answer
36 views

How to check all Case startdate and updated case with high duration from startdate

I have requirement where on new case insertion need to check AccountId and all associated cases with that account. Then need to compare startdate of all cases and whichever is earlier need to ...
user avatar
  • 3
0 votes
0 answers
89 views

new instance of object creation for updating a record

Requirement-I have custom object request__C where i am storing sourceAccount ID and TargetAccountID. My requirement is to update the field in request object with max contact in any of the account. ...
user avatar
  • 1
0 votes
1 answer
16 views

not able to update contact based on the requirement-seems bulkification issue

i have requirement where i am passing list of accountuuids to method 1.If contact with same accountname not present then create new contat call as shadow contact 2.if contact with same accountname ...
user avatar
  • 1
1 vote
1 answer
904 views

Component Visibility in Flow's Screen with Number data type

I'm trying to set up a filter to manage a component visibility in a flow's screen component. In particular, I want the field to be available to the user for the insert of data only when a particular ...
user avatar
-1 votes
1 answer
42 views

Can I create an AND and OR filter and apply that to a data extension

I'd like to create a Data Filter that has AND and OR conditions in it, like x AND y AND (a OR b OR c) I'm unable to merge two filters. Is this feasible?
user avatar
  • 119
0 votes
2 answers
367 views

Triiger Switched On/Off using Custom Metadata

I want to switch of trigger to run or not based on custom metadata. below is the logic i used ,but getting null exception if no User record in metadata. I dont want triger to fire when user and ...
user avatar
  • 5
0 votes
1 answer
20 views

Configure the FROM of send email on Case

Is it possible to configure the emails that appears on the "FROM" based on the profile or role or some type of criteria of the current user? If it is, how can I do it? thanks in advance
user avatar
0 votes
1 answer
26 views

Problem with begginer logic

While studying doing some exercises, I created an Account with 1000 Contacts related to this account. My problem is, there the Number_field__c in the Contact Obj. What I need to do is populate the ...
user avatar
-2 votes
1 answer
3k views

Process Builder - Customize the Logic [closed]

Can I customize the logic of a process builder as below? (4 AND 1) OR 2 OR 3
user avatar
0 votes
2 answers
314 views

Handle 1 AND (2 OR 3) in Apex Query

In the List View we can see the Filter logic that enable us to handle many condition such and 1 AND (2 OR 3) . But I m not able to figure out how this logic is being handled in apex. For example if ...
user avatar
  • 2,462
0 votes
2 answers
1k views

Process Builder formula only partially evaluates(Edited version after trying with one of the proposed solutions)

I am working on writing a formula inside process builder "Formula Evaluates to true" and it seems my logic is not working. Suppose I have a following logic: 1 OR 2 OR 3 OR(4 AND 5) Below is my ...
user avatar
0 votes
1 answer
40 views

Need Apex Logic

I have a Leave__c as a custom object. It contains 3 fields: Employee Name (lookup to User), Leave Start Date (Date) and Leave End Date (Date). Example: User "John" is on leave from Start Date "4th Jan ...
user avatar
  • 141
0 votes
1 answer
382 views

validating required field dynamically using apex controller

I have a list of field api names of type string belong to particular object. I want to validate whether the field has value or not at the time of saving the record and throw error message exactly at ...
user avatar
2 votes
1 answer
185 views

Translating Workflow-like logic into Apex

In a workflow you can define logic like ( (1 AND 2) OR 3 ) AND 4 I need to build configurable criteria that will do something similar in structure, but with more complex criteria. For example, I'd ...
user avatar
  • 626
1 vote
1 answer
80 views

Report Folder and Report Name Control (Validation? Workflow? Apex?)

Is there a way to control (to any degree) the naming conventions of Report Folders and Reports? I'm not finding a solution via Google searches or Salesforce resources. Some examples: Block create/...
user avatar
  • 4,564
1 vote
0 answers
42 views

Sending Email Template FROM: Different Addresses By Same User

Does anyone know of a solution for User "Anthony" being able to PICK from more than ONE EMAIL ADDRESS to be the "FROM:" address when sending a Template (without using an open text box when sending the ...
user avatar
  • 4,564
0 votes
1 answer
485 views

Number to word logic

My code to convert number to words is as below. Here i am getting output properly but if i have number 5,07,920 it is showing result five hundered and seven thousand nine hundred and twenty. i want ...
user avatar
0 votes
1 answer
574 views

Need Help to build a Custom notification read logic for Individual user basis

I'm building a custom Notification section, which provides notification or messages to multiple users on any particular object update, I've created a Custom page where I have added a Alert section or ...
user avatar
1 vote
1 answer
40 views

Min Order date within last 24months from list of orders related to Account Object

I have a date field on the Account object and the date field is called "New_Cust_date_for_cellsep_in_last_24mnth__c". Account object has orders related to them. The Orders object is called "...
user avatar
0 votes
1 answer
40 views

Use case of the code [closed]

On exploring collections, I came across the following code: String myName = [select Id, managerName, address__c from User where Id =: userInfo.getUserId()].managerName; I see that myName will ...
user avatar
  • 3,101
4 votes
1 answer
418 views

Checking if a certain custom permission is enabled in a Profile

Is there a way to programmatically figure out whether a certain custom permission is enabled in User profile? The problem that I'm trying to solve – is that I need some kind of a flag for a small ...
user avatar
1 vote
2 answers
2k views

How to create day/Time counter on specific field update

I have a pick list field in opportunity object name “Opportunity status”. There are two values in this field Hold and Un-Hold. I want, when I do select hold another field name "Hold duration" start ...
user avatar
0 votes
1 answer
1k views

How can I create report on Stage velocity as per Sales user

I want to create a report on Stage velocity of opportunity per sales person. Like if a salesperson have 10 Opps in first stage and only 6 forward to second stage then from 6 only 4 forward to third ...
user avatar
0 votes
1 answer
75 views

I need to update incremental code in a custom field on accounts so that if user changes the Type then no. should be incremented by 1 [duplicate]

I need to update incremental code in a custom field on accounts. So that, If user changes the Type from Prospect to customer then no. should be incremented by 1. For example: For account1, it will ...
user avatar
  • 1
0 votes
1 answer
2k views

Create report to get Stage conversion rate of opportunity

I want to create a report on opportunity object to get conversion rate. Like if I have 100 opportunities are in 1 stage and 10 of them will travel all the stage and end with close-won So first stage ...
user avatar
2 votes
2 answers
103 views

Why is Force.com aimed at employees? [closed]

I am new to Salesforce and am reviewing it for an organisation who are planning to build a customer-facing application. I notice in several places in the Salesforce marketing material that Force.com ...
user avatar
0 votes
0 answers
205 views

Can we do forecasting on custom date instead of close date

I am using collaborative forecasting and it's using standard close date for forecast period but I have two close dates, one for sales and second for management so I want to use forecast on custom ...
user avatar
1 vote
1 answer
1k views

How do I calculate opportunity stage convestion rate %

I want to conversion rate. Let say 100 opportunities in 1 stage then they 50 opportunities moved to 2 stage so stage conversion rate is 50%. then 25 moved to 2 stage from those 50 opportunities so ...
user avatar
4 votes
1 answer
237 views

Using advanced IF in Formula field

I am trying to get the percentage of process completion. I have some checkboxes, and I want to check if each one is checked or not. For every checked box, I will increase some value and then get the ...
user avatar
6 votes
1 answer
785 views

Salesforce - business logic - best practices

I would be really grateful if anybody could help me clarify, where to deploy business logic. I'm aware of the following possibilities: Write the main parts of the business logic in Apex Apex ...
user avatar
4 votes
2 answers
176 views

Why does this trigger class work when editing individual child records but not when mass loading child records?

February 26 Update: Still hoping someone can help me with this? Are there any takers? February 23 Update: Still have issues. The updated helper class code is below (this is exactly what I have in my ...
user avatar
2 votes
1 answer
107 views

Need help on apex logic

I'm stuck on retrieving account for particular orders. My final requirement is to build a list with all orders details and the account it belongs to. So here's my story so far... I have 2 new custom ...
user avatar
  • 3,101
3 votes
1 answer
471 views

FuelSDK-Python Integration with multiple Business Units - Is this Possible?

In my company's Email Marketing Cloud Account we have multiple accounts (that is business Units). In our earlier integration with SOAP API we were able access the objects in these business units ...
user avatar
  • 81
3 votes
2 answers
5k views

Match two Maps to check if value is missing

I have created two maps of two different Objects i need to check if the ids in obj2 are in obj1 and if they are missing i need to create that value in the database ( the last part we have a function ...
user avatar