Re: Selecting a random item from a Global List
Greetings James,
Thank you for providing this kind of useful information.
Sincerely,
Steven Williams
exteNd & IDM Senior Specialist
Novell Engineering
On Thu, 05 Nov 2009 00:36:02 +0000, jhillyerd wrote:
> Hi. I searched around and didn't find anyone else doing this, but
> managed to figure it out so I thought I'd post a code snippet.
>
> We wanted to randomly choose an Exchange database when provisioning a
> new mailbox, but still give the option to change it if needed.
>
> I created a global list with the DNs of the Exchange databases. Added
> it to the approval form, then added the following code as an onload
> event:
>
> exdbs = IDVault.globalList(null, "exchange-database")[0]; idx =
> Math.floor(Math.random() * exdbs.length); form.select("exchangeDb",
> exdbs[idx]);
>
> "exchange-database" is the name of the global list, and "exchangeDb" is
> the name of the form field.
>
> Hope someone finds it helpful.
>
> -james
|