I have been asked to apply a security rule on PA52.1 that would restrict our end users from entering specific Action Codes with effective dates that are earlier than the employee Hire Date. Someone accidentally entered a PA with a 'very wrong' effective date and it passed through the approvals..... This should be fairly simple to do but here I am two days later... and I'm beginning to feel like I've falling down a rabbit's hole. I swear, I've written rules like this before but naturally now I cant find any of them.
I've modified the rule to be similar to: if( (form.PCT_ACTION_CODE=='NEWHIREII') && (getDBField('EMPLOYEE','DATE-HIRED',form.PCT_COMPANY,form.PCT_EMPLOYEE)<=form.PCT_EFFECT_DATE). That was no good because the DATE-HIRED is returning 2018 September 10 (where does that come from?) and PCT.EFFECT_DATE is 09/10/2018. I've tried a multitude of combinations, incorporating the use of strToNum and dateFormat functions and can't break through this. Any suggestions would be greatly appreciated. PS: I did see somewhere that there were issues with the dateFormat at one time, but can't seem to find the related KB now.
Also, if anyone is aware of a listing anywhere that shows what the valid DateFormats for this security function are, I would love to refer to it because when it is really wrong - the error is 'outside of IOS'. Additional insight into why the getDBField is returning the date in the format of '2018 September 10' instead of a something simple, like maybe the SQL value of '2018-09-10' or even 'yyyymmdd' would also be appreciate. (Possibly the user locale def ?.?.?)