Skip to Content

CRM - Time Rule - Date and duration difference in XML

Hi All,


Please provide your input on the below query .

Objective

To create a date rule in CRM system, the date rule is created using XML . The date should be output of date - duration , omitting the weekends ( saturday and sunday ) .

Input

The input is date ( lets says - 25.07.2014) and duration is 5 days . The output should be the input date - duration ,if there is any weekend which is falling between the input date and duration ,it will not count the weekend as number of days and provide the result .

Please find the example ,In the below code

VarTimeExp = 25.07.2014

ConstDuraExp = 5days

VarTimeExp will contain the output/result = Date provided in the ZRC04_01 - Duration of 5 days in ConstDuraExp.

Result = 20.07.2014 . It is considering the weekends in counting number of days

Expected result - 18.07.2014, should not consider the weekends


Note - The factory calendar is already set and badi is implemented

Case 1

<?xml version="1.0"?>

<TimeRule>

<TimeRuleSource>

<ruleline>

<AssignTimeExp displaytype="AssignTime">

<VarTimeExp displayType="VarTime" name="RESULT" position='B'>

<VarObjectExp displaytype="VarObject" name="ZXXX001"/>

</VarTimeExp>

<MoveTimeExp displaytype="MoveTime" direction="-">

<VarTimeExp displayType="VarTime" name="ZRC04_01" position="B">

<VarObjectExp displaytype="VarObject" name="ZXXX001"/>

</VarTimeExp>

<VarDuraExp displaytype="VarDura" name="ZRC04_D4" timeunit="DAY">

<VarObjectExp displaytype="VarObject" name="ZXXX001"/>

</VarDuraExp>

</MoveTimeExp>

</AssignTimeExp>

</ruleline>

</TimeRuleSource>

</TimeRule>

but when i implement the Case 1 code i am not getting the desire result . Please find the screen shot .

Please provide your input on the above scenario and do let me know if you need more information from my end .

Thanks

OM

re_2.png (22.6 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Best Answer
    Posted on Jul 28, 2014 at 01:34 PM

    Hi All,

    The issue is resolved .The above rule will work perfectly fine , only we have to provide the missing configration in the system . Please find the same below

    Also if you want to have constant duration then the above configration is also not required the rule will work without the above configration . Please find the rule written - when you have constant duration .

    <?xml version="1.0"?>

    <TimeRule>

    <TimeRuleSource>

    <ruleline>

    <AssignTimeExp displaytype="AssignTime">

    <VarTimeExp displayType="VarTime"

    name="RESULT"

    position='B'>

    <VarObjectExp displaytype="VarObject"

    name="ZXXX001"/>

    </VarTimeExp>

    <MoveTimeExp displaytype="MoveTime" direction="-">

    <VarTimeExp displayType="VarTime"

    name="ZRC04_01"

    position="B">

    <VarObjectExp displaytype="VarObject"

    name="ZXXX001"/>

    </VarTimeExp>

    <ConstDuraExp displaytype="ConstDura"

    duration="5" timeunit="DAY">

    <VarObjectExp displaytype="VarObject"

    name="ZXXX001"/>

    </ConstDuraExp>

    </MoveTimeExp>

    </AssignTimeExp>

    </ruleline>

    </TimeRuleSource>

    </TimeRule>

    Thanks,

    OM


    809_config.png (945.5 kB)
    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.