Thursday, 13 July 2017

To Keep password while logging into AX application

To keep a password while logging into AX,
Use the first method that is called while logging into AX. i.e,
Application(Class) > startuppost() method.

void startupPost()
{
dialog d;
dialogfield df, df1, df2;
userinfo user;
boolean ret;
;
d = new dialog(“Password”);
df = d.addField(typeid(userid),”UserName”);
df1 = d.addField(typeid(userid),”UserName”);
df2 = d.addField(typeid(string30),”Password”);
df.value(curuserid());
select user
where user.id == curuserid();
if(user)
{
df1.value(user.name);
}
df1.allowEdit(false);
df1.displayLength(25);
while(d.run())
{
if(!(df2.value() || df2.value() == ‘Suri’))
{
infolog.shutDown(true);
throw error(“wrong password”);
df2.doNull();
continue;
}
else
{
ret = true;
break;
}
}
if(ret == false)
{
infolog.shutDown(true);
}
}

No comments:

Post a Comment