function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MaxFrielMaxFriel 

Get amount of time until password expires...

I wanted to make something that reported how many days a user has left before their password expires.  I found the LastPasswordChangeDate field on the User table.  Now I was just wondering if there was anywhere I could pull down the org's policy on "User passwords expire in" programatically? 

MandyKoolMandyKool

Nope,

 

As of now, i have never seen any object which stores this kind of information and is available for Apex.

boBNunnyboBNunny

No, most of the "Org" data you find in Company Information isn't available via API at this time.  For me, it's unbelievable that at least number of licenses used and limited to are not exposed.

 

That said, an easy way around this might be to create a Custom Setting for the same value as the Org setting and then just access it.  Then make sure your System Admin changes the custom setting if/when they change the Org Setting.