Sara
0
Q:

async await cacurios animal

function afterPrintSave() {
    Xrm.Page.data.save().then(
        function () {
            resolve();
        },
        function (err) {
            resolve(alert(err.message));
        }
    );
}
0
// Verifying a user with async/await
const verifyUser = async function(username, password){
   try {
       const userInfo = await dataBase.verifyUser(username, password);
       const rolesInfo = await dataBase.getRoles(userInfo);
       const logStatus = await dataBase.logAccess(userInfo);
       return userInfo;
   }catch (e){
       //handle errors as needed
   }
};

// Here we use the same `database.verifyUser`, `database.getRoles`
// and `database.logAccess` implementation based on promises
0
await async
-1

New to Communities?

Join the community