Quantcast
Channel: SCN : All Content - SAP for Mobile
Viewing all articles
Browse latest Browse all 6147

Using Date type in rules

$
0
0

[Migrated from the Syclo Resource Center]

KarthikSetty   04/07/2011 08:01,

Hi,I have a fetch screen where I have To and From dates.I want to automatically update the From date

 

to the To date value when the To date is greater and visa versa.When I create an update rule it was displays it in String context. I dont know if GT works with dates.In the RuleEditorGuide it mentions that dates are converted into integers. However the return date from the rules gets defaulted to 01.01.2001.Any tips?Thanks,

 

 

Jason Latko   04/07/2011 09:18

What you are describing should work fine.

 

  Dates are stored internally as integers.

 

  You should be able to use math rule terms to compare them.

 

  It seems somehow your rule thinks it is working with strings though.

 

  Are your field types "Date" in the drop down?

 

  Are you tying these to object properties outside the fetch that are strings?

 

  That would confuse the update rules.

 

  Let me put together a working example and I will post shortly.

 

Jason LatkoSenior Product Developer at Syclo

 

 

Jason Latko   04/07/2011 10:08

I attached a screen shot of my fetch screen with two "Date" type fields on it.

 

  These are not tied to anything outside the fetch.

 

  I have an update rule on each field as shown in the attachment.

 

  These rules look directly at the screen fields to do a GT comparison and then set the values accordingly.

 

  Let me know if you are still having trouble after trying this approach.

 

Jason Latko Senior Product Developer at Syclo

 

 

KarthikSetty   04/07/2011 10:48

Jason,Works great! Thanks for the quick response.Two comments for the benefit of the others for the reasons it did not work previously.1. I used the fetch properties and not the screen properties.2. I did not have a else part, I just assumed it would use the screen property.

 

Best Regards,Karthik

 

 

 

 

Jason Latko   04/07/2011 11:20

Karthik,Glad to help.

 

  Never assume that the ELSE is implied in a rule.

 

  Always provide the parameter yourself.You can also approach it using the fetch properties like you wanted using the rule below.

 

  Assume you have fetch properties called One and Two for the Dates.

 

  Using CurrentValue will force Agentry to give you the current property value that was just updated by the screen field.

 

  Without this, you sometimes get outdated information when your rule executes:Jason LatkoSenior Product Developer at Syclo


Viewing all articles
Browse latest Browse all 6147

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>