Skip to main content

New answers tagged

0 votes

Error: Incorrect parameter type for function 'MOD()'. Expected Number, received Date/Time

The issue is MOD() function expects a number, but you're providing a date/time value. You can try this formula: DATE( YEAR(CreatedDate), MONTH(CreatedDate), DAY(CreatedDate) + ...
Tushar Jadav's user avatar
  • 2,148
0 votes

Error: Incorrect parameter type for function 'MOD()'. Expected Number, received Date/Time

MOD(CreatedDate, 7) doesn't work, because you can't divide a date by a number. However, just choose a date that is a Sunday, and subtract that from the CreatedDate. MOD(CreatedDate - DATE(1970, 1, 4), ...
sfdcfox's user avatar
  • 497k
0 votes

Error: Incorrect parameter type for function 'MOD()'. Expected Number, received Date/Time

try something like this public static Date calculateDueDate(Date startDate, Integer daysToRespond) { Integer daysToAdd = 0; while(daysToAdd < daysToRespond) { startDate = startDate.addDays(1); ...
Flecso's user avatar
  • 43
1 vote
Accepted

Help editing formula field

To ensure that the Price_Book_Name__c field populates with only one of the names from either Price_Book__c or Product_Interested_In__c, you can use a formula that checks if one field is filled and ...
Tushar Jadav's user avatar
  • 2,148
0 votes

How to make a formula with correct difference between dates in months?

You can use a more precise method by calculating the number of days and then dividing by the average number of days per month. ROUND( ((YEAR(EndDate__c) - YEAR(EffectiveDate__c)) * 12 + ...
Tushar Jadav's user avatar
  • 2,148
0 votes

Help with date formula

I would break down this into 2 separate use cases: When Start_date__c is less than today's date we need the field value to be rolled over by 1 year i.e. 12 months When Start_date__c is greater than ...
Rohit's user avatar
  • 2,091
1 vote

Help with date formula

Below is a Formula you can use: IF( TODAY() > DATE(YEAR(TODAY()), MONTH(Contract_Start_Date__c), DAY(Contract_Start_Date__c)), DATE(YEAR(TODAY()) + 1, MONTH(Contract_Start_Date__c), DAY(...
Tushar Jadav's user avatar
  • 2,148
1 vote

How to calculate the number of days until close on a summary-level formula column in a report?

I believe you should be using the API name of the field, which is CloseDate if the main object of your report is the opportunity. You can read this article too, on Salesforce Ben, about Summary ...
Renato Oliveira's user avatar
6 votes

Best way to lessen the characters used in a formula field

You can rely on some common patterns in your example and use the CONTAINS function within nested IFs with the last else use case being the CASE to handle odd-balls IF (CONTAINS(...
cropredy's user avatar
  • 72.1k
5 votes

Best way to lessen the characters used in a formula field

If I were to address this requirement, I would introduce an object to represent the various programs (e.g. Program__c) and have that object hold both the program name and the type of institution. I'd ...
Phil W's user avatar
  • 37k

Top 50 recent answers are included