Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Unanswered

need help on formula field

Posted on by 2

Hi,

I am converting formula field from Salesforce .Below is the formula,

IF(DATEVALUE(CreatedDate) = DATEVALUE(Completed_Date_Time__c),
(Completed_Date_Time__c - CreatedDate) * 24,
((CASE(MOD(DATEVALUE(CreatedDate) - DATE(1985,6,24),7),
0 , CASE( MOD(DATEVALUE(Completed_Date_Time__c) - DATEVALUE(CreatedDate) ,7),1,2,2,3,3,4,4,5,5,5,6,5,1),
1 , CASE( MOD(DATEVALUE(Completed_Date_Time__c) - DATEVALUE(CreatedDate) ,7),1,2,2,3,3,4,4,4,5,4,6,5,1),
2 , CASE( MOD(DATEVALUE(Completed_Date_Time__c) - DATEVALUE(CreatedDate) ,7),1,2,2,3,3,3,4,3,5,4,6,5,1),
3 , CASE( MOD(DATEVALUE(Completed_Date_Time__c) - DATEVALUE(CreatedDate) ,7),1,2,2,2,3,2,4,3,5,4,6,5,1),
4 , CASE( MOD(DATEVALUE(Completed_Date_Time__c) - DATEVALUE(CreatedDate) ,7),1,1,2,1,3,2,4,3,5,4,6,5,1),
5 , CASE( MOD(DATEVALUE(Completed_Date_Time__c) - DATEVALUE(CreatedDate) ,7),1,0,2,1,3,2,4,3,5,4,6,5,0),
6 , CASE( MOD(DATEVALUE(Completed_Date_Time__c) - DATEVALUE(CreatedDate) ,7),1,1,2,2,3,3,4,4,5,5,6,5,0),
999)
+ (FLOOR((DATEVALUE(Completed_Date_Time__c) - DATEVALUE(CreatedDate))/7)*5)
- 2) * 9)
+
MAX((
DATETIMEVALUE(TEXT(YEAR(DATEVALUE(CreatedDate))) & "-" & TEXT(MONTH(DATEVALUE(CreatedDate))) & "-" & TEXT(DAY(DATEVALUE(CreatedDate))) & " 01:00:00am") - CreatedDate + 1) * 24, 0))
+
MAX((Completed_Date_Time__c -
DATETIMEVALUE(TEXT(YEAR(DATEVALUE(Completed_Date_Time_c))) & "-" & TEXT(MONTH(DATEVALUE(Completed_Date_Timec))) & "-" & TEXT(DAY(DATEVALUE(Completed_Date_Time_c))) & " 16:00:00pm")) * 24, 0)

How to convert in Dynamics Crm.??

Using Formula column from Powerapps  there is 1000 characetrs limit??

Thanks

  • Leco Lv Profile Picture
    Leco Lv on at
    RE: need help on formula field

    Hi partner,

    The dynamics 365 formula column is using power fx. As Guido suggested, after you know exactly what the formula does, you can come back to this case to list your needs or open a new case.

  • Guido Preite Profile Picture
    Guido Preite 54,081 Super User 2024 Season 1 on at
    RE: need help on formula field

    without knowing what the  formula is doing exactly you will not be sure also if you convert the code. Try to understand what the formula does exactly (there are salesforce communities like salesforce.stackexchange.com/ ) and after you have the logic converting to dynamics will be easier for you

    hope it helps

  • EKL Profile Picture
    EKL 2 on at
    RE: need help on formula field

    Thank you Guido ,We don't have much info  as of now but it is calculation based on created date and completed date fields and some other logic which is not understandable.

    So I tried to replace Switch in place of CASE ,Date in place of DATEVALUE etc but limitation of 1000 characters is coming in Formula column of powerapps.

    pastedimage1677927582397v4.png

  • Guido Preite Profile Picture
    Guido Preite 54,081 Super User 2024 Season 1 on at
    RE: need help on formula field

    what this formula does exactly?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans