Options

Company Dialog call

IwanIwan Member Posts: 17
Hi everybody

I have a question about the company dialog under the menupoint file, company, open

Is it possible to call this dialog (form) in the code ?

Thanks for your help.

Greetings Iwan

Comments

  • Options
    RobertMoRobertMo Member Posts: 484
    You can create your own form using Company table as SourceTable.
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • Options
    IwanIwan Member Posts: 17
    Hi everybody, hi RobertMo

    Thanks for your posting.

    Is it the only way to create the dialog completle new ? I have seen the company table and I only saw that this table stores the current companies of the database. What I'm interessted in is the functionality to change the company, not just the display the available ones.

    Is it correct that I have to program the change mechanism ?


    Thanks for your help.

    Greetings Iwan
  • Options
    RobertMoRobertMo Member Posts: 484
    Yes you are correct. What would you like to achieve?

    If you run the form, then you need a user's action to select a company. Is it really that hard for user to do the switching (Pressing Ctrl+O)?

    If you want to automate something you could utilize Record.CHANGECOMPANY function. But this works only with specific record variable and you have to be careful with table relations – since the relation will be checked according to current (global) company.
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • Options
    IwanIwan Member Posts: 17
    Hi RobertMo

    Thanks for the information.

    The users of my navision solution can't press ctrl-o because they working with a touchscreen without keyboard.

    I will try to program a solution with the CHANGECOMPANY function.

    Thanks a lot for your support.
    Iwan
  • Options
    RobertMoRobertMo Member Posts: 484
    now we know the real reasons - a touchscreen. I asume, that the users don't see the menu bar?
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • Options
    RobertMoRobertMo Member Posts: 484
    a good tip on other topic by fb might help using 'Windows Script Host Object Model'.WshShell.

    http://www.mbsonline.org/forum/topic.asp?TOPIC_ID=12350
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • Options
    RobertMoRobertMo Member Posts: 484
    Declare global automation:
    aWshShell 'Windows Script Host Object Model'.WshShell

    Create a button with following code OnPush()
    CREATE(aWshShell);
    aWshShell.SendKeys('^o');
    CLEAR(aWshShell);
    
    Be sure to use lowercase 'o'. If File/Company/open has different shortcut then change letter accordingly
               ®obi           
    ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
  • Options
    IwanIwan Member Posts: 17
    Hi RobertMo

    Thanks a lot for your help. I tryed it and it works. When it push the button the dialog starts and also the windows cmd.exe is starting.

    It hope I find a way to hide the cmd.exe dialog.


    Thanks a lot for your help
    Greetings Iwan
Sign In or Register to comment.