Skip to main content

Notifications

Dynamics 365 Community / Forums / Sales forum / need help on formula f...
Sales forum
Unanswered

need help on formula field

Posted on by

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

Categories:
  • 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,059 Moderator 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 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,059 Moderator on at
    RE: need help on formula field

    what this formula does exactly?

Helpful resources

Quick Links

Dynamics 365 Community Update

Welcome to the inaugural Community Platform Update. As part of our commitment to…

Dynamics 365 Community Newsletter - August 2024

Catch up on the latest D365 Community news

Community Spotlight of the Month

Kudos to Mohana Yadav!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,115 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 227,971 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans