want to call change password from in codeunit 1

tanmaykotharitanmaykothari Member Posts: 73
Dear All,

we want to call change password from(System Form) in on company open
codeunit

Tolls -> Security -> Password

Is this possible? how?
Please help..


Thanks in advance... ](*,)

Comments

  • ppavukppavuk Member Posts: 334
    I don't think it is possible.
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    You could try using SendKeys, to send the keystrokes Alt-T, S & P. But it's a dirty hack to get the job done.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • ppavukppavuk Member Posts: 334
    I would not rely on sendkeys for this. But, the question is what is purpose of this requirement? It could be easier to implement windows logins and manage password change policy within domain.
  • tanmaykotharitanmaykothari Member Posts: 73
    You could try using SendKeys, to send the keystrokes Alt-T, S & P. But it's a dirty hack to get the job done.

    Thanx =D>....

    It's working using SendKeys

    below is the code for the same

    IF ISCLEAR(WshShell) THEN
    CREATE(WshShell);
    WaitForKeys := TRUE;
    WshShell.SendKeys('%{T}{s}{p}',WaitForKeys);

    Steps
    Declare variable WshShell dtatype is Automation and subtype is 'Windows Script Host Object Model'.WshShell

    % for ALT
    {T} to open Toll
    {s} to open security
    {P} to open password
  • ppavukppavuk Member Posts: 334
    Ok, you did this. But what stopping user just to escape from this form? What requirement you truing to implement with this?
  • tanmaykotharitanmaykothari Member Posts: 73
    ppavuk wrote:
    Ok, you did this. But what stopping user just to escape from this form? What requirement you truing to implement with this?


    can you please tell me how to close navision if user press escape from this form
    or can i use sendkey function two times 1) for trigger change password form
    2)and another is if user press escape button
  • ppavukppavuk Member Posts: 334
    It is just a wrong way to sort out security. Use active directory - it is much more flexible.
  • vaprogvaprog Member Posts: 1,141
    I agree with ppavuk, but since you (or your superior/customer) insist...

    You might check the Password field in the User table for change. If it did not change, no new password was entered. This way you can even check that the password was not set to blank.
  • ppavukppavuk Member Posts: 334
    Our job is to decrease entropy, so I think we must use right tools and technologies to achieve customer's requirements. If you boss forcing you to use wrong approach - it make sense at least to try to offer better solution.

    This one is dirty hack and big mess. At some point someone else will support this stuff and blame this code authors. The NAV security can do what it can do, if you need more - use active directory. I am sure its better to spend time to implement right solution.
Sign In or Register to comment.