3 Replies Latest reply on Oct 10, 2013 10:54 PM by danielfarnan

    Custom record privileges

    vijaybhanabhai

      In Security -records privilges-Edit-Limited - i Am trying to limit the edit if the field (Sales date) is not less then 2 days older then (Current date).. I am using Sale Date < Get ( CurrentDate ) - 2 which doesnt work. Whats the correct method?

        • 1. Re: Custom record privileges
          danielfarnan

          Perhaps Sale Date < ( Get ( CurrentDate ) - 2 ) would be what you want?

           

          I suspect that the evaluation precedence is for the comparison before the subtraction, i.e. if the sale date is less than the current date your result will be 1 and then the 2 is subtracted, giving -1.

           

          There are other ways to convert this to give the answer you want, but I find that explicitly declaring evaluation priority with parentheses leads to more readable code.

          • 2. Re: Custom record privileges
            vijaybhanabhai

            what i want to achieve is restrict edit if he record is MORE then 2 days old. Your suggest solution doesnt work.

            • 3. Re: Custom record privileges
              danielfarnan

              Well, in that case you probably want Sale Date >= ( Get ( CurrentDate ) - 2 )

               

              When you want to restrict access using privileges, remember that you need to specify the conditions where access is allowed rather than the conditions where access is denied. The above expression is the opposite of my earlier suggestion.