on 03-13-2015 10:21 AM
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
Hi Bill/Ak,
Thanks for helping me.
I am able to resolve the issue by using above logic.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
Hi Bill,
Thanks for update.
Please let me know whether the Required Date property is string data type or DATE data type.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.