AccountService.createAccount Method

Creates an account with the specified options. The ID field should be left empty, as the result will have it set to the new ID.
 

Parameters

account

Type: Account
The account object that should be created.

Return Value


Type: jQuery.Promise
Value: dundas.account.Account
A promise object that is resolved when the call is complete. If successful, a dundas.account.Account is returned. 

Examples

This creates a new local user account object.




        var accountsService =
            new dundas.account.AccountService();

        var account = new dundas.account.Account();

        account.accountType = dundas.account.AccountType.LOCAL_USER;
        account.id = "2f3224b1-9484-4a84-8963-d6172743a9ef";
        account.name = "MyUserAccount";
        account.displayName = "MyDisplayName";
        account.emailAddress = "myemailaddress@dundas.com";
        account.password = "1234";

        accountsService.createAccount(account)
        .done(
            function (account) {
                var viewService = new dundas.view.ViewService();
                viewService.showSignal("Success");

                BindAccountsList();

            }
        )
        .fail(
            function(error)
            {
                var viewService = new dundas.view.ViewService();
                viewService.showSignal("Failure");
                viewService.showError(error);
            }
        );