cancel
Showing results for 
Search instead for 
Did you mean: 

How to display work orders in WM 6.1 application in agentry based on past, today and future dates?

former_member223904
Participant
0 Kudos

Hi Experts,

I am having an requirement in work manager 6.1 application where i have to display work orders based on past,today and future dates. For displaying the work orders i am using an rule but the rule is not working properly.

Please assist how to display work orders based on the date.

Please find attached screen shot of the rule for reference.



Accepted Solutions (1)

Accepted Solutions (1)

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

You can simplify your include rule.  Since you just need to return true or false you can just let the comparison do the return.  Since dates are internally stored as numbers past epoch you can just compare the two values directly.  The example rule below returns true if the RequiredDate is greater than today.

--Bill

former_member223904
Participant
0 Kudos

Hi Bill,

Thanks for update.

Please let me know whether the Required Date property is string data type or DATE data type.

former_member223904
Participant
0 Kudos

Hello Bill, Can you please help me in resolving this issue. Can we use this rule using string property? We are using date property but still no luck. Regards, Sandeep

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

Sandeep,

You don't need to worry about the format of the date.  The display of a type date property is determined by the regional settings on the device. 

Based on the rule name I am assuming you want to include all work orders where ZPlannedStartDate is before today.  If that is the case you should simple need to remove the formatting from the DATE rule function and it should work.

As Steve mentioned, I would recommend using the newest Editor plugin (SP07 / PL01) and use the built in ATE and rule debugging to see exactly what your rule is doing and confirm the behavior.

--Bill

Answers (3)

Answers (3)

former_member223904
Participant
0 Kudos

Hi Bill/Ak,

Thanks for helping me.

I am able to resolve the issue by using above logic.

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

If your question has been answered, please mark this Discussion with a Correct Answer and Helpful Answer where appropriate.  See http://scn.sap.com/community/support/blog/2013/04/03/how-to-close-a-discussion-and-why   Even if you discovered the solution without any outside contributions, it helps others to understand what the solution turned out to be.


--Bill

former_member223904
Participant
0 Kudos

Hi Bill,

I am using below rule to display work orders in past.

ZPlannedStartDate is DATE type property and format showing is MM/dd/yyyy in ATE and i am changing the current date format to MM/dd/yyyy but still future and today work orders are displaying in past work orders screen.

Please help me on this.

Former Member
0 Kudos

Sandeep, the Date file is saved internal as a integer.  You dont need to do the format the date when you are doing a compare.

Also, I would recommend using the Debug client within the SP06 editor to see what it returns for each object on the screen.

former_member223904
Participant
0 Kudos

Hello Stephen,

We are using SP05 not able to debug it as it is Android platform.

Regards,

Sandeep

former_member208808
Active Participant
0 Kudos

Hi sandeep,

Consider following points as well

1) You don't need to convert it to any format.Just compare two Date's as everyone's suggesting it      should work.As documentation says

"A numeric value may be passed for date parameter, in which case it will be treated as the number of days before or after the Agentry epoch date".

2) Don't forget to check your systems date as well.Since it says

"The DATE function returns either the current system date of the client device or the one specified as a parameter to the function"

3) If it still not working and you want to try with format for date try it like below rule..

4) Since you are using SP05/Android and you are not able to debug this.In this case i suggest you to add a dummy field to your tile screen and apply this/your rule as update rule for this dummy field and give it a try.See whether it returns you TRUE/FALSE as expected in each case..

Let us know it it works for you...

Regards,

AK

former_member223904
Participant
0 Kudos

Hi Bill,

Thanks for update.

Please let me know whether the Required Date property is string data type or DATE data type.

bill_froelich
Product and Topic Expert
Product and Topic Expert
0 Kudos

My Required Date property is a Date type property.

--Bill