Command Button problem

BBHansenBBHansen Member Posts: 8
First of all I have to admit that I have never done any work in Navision before, so therefore my question might sound dumb, sorry.

Ok, I have added a Command Button in a form (Form 21 Customer Card) in the Form Designer.

I have entered exactly the same properties as in the Hyperlink button, but nothing at all happends when I click my button.

Ok ok, I know that I need to write some code somewhere. My big problem is where do I type this code?

So what I want to do is to make a command button exactly as the hyperlink button.

Hopefully someone can help a total newbie as me O:)

Comments

  • ufukufuk Member Posts: 514
    If you have access to C/Side you can use OnPush trigger. (Select your button then hit F9 (View,C/Al Code)
    Ufuk Asci
    Pargesoft
  • BBHansenBBHansen Member Posts: 8
    Ok, that's the reason why I couldn't find it since I havn't access to that module.

    That's probably going to be expensive :-(
  • SavatageSavatage Member Posts: 7,142
    here's an example of some code to put on a command button.

    I added a command button on the item card that brings me to the manufacturer of that items web site.

    *note on the vendor table there is a field called "Home Page" which holds the info ie/ http://www.mibuso.com

    OnPush()
    Vendor.GET("Vendor No.");
    HYPERLINK(Vendor."Home Page");
  • SavatageSavatage Member Posts: 7,142
    BBHansen wrote:
    Ok, that's the reason why I couldn't find it since I havn't access to that module.

    That's probably going to be expensive :-(

    You can still Hyperlink without getting to the code.
    it's not as good ...

    View the properties of the command button.
    TRY THIS AS AN EXAMPLE

    PushAction: RUNSYSTEM
    RunCommand: EXPLORER.EXE http://www.MIBUSO.com

    Save , Compile & press
  • BBHansenBBHansen Member Posts: 8
    Thanks Savatage for your latestest reply with
    PushAction: RUNSYSTEM
    RunCommand: EXPLORER.EXE http://www.MIBUSO.com

    I can see that the code works like a charm, but as you mention it isn't that good as the url is hardcoded.

    I'll have to take a look at the price for the module so that I can start learning the Navision programming language

    BTW: are there any good books that I can read about programming in Navision?
  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    BBHansen wrote:
    Thanks Savatage for your latestest reply with
    PushAction: RUNSYSTEM
    RunCommand: EXPLORER.EXE http://www.MIBUSO.com

    I can see that the code works like a charm, but as you mention it isn't that good as the url is hardcoded.

    [...]

    BTW: are there any good books that I can read about programming in Navision?
    No problem that the URL www.mibuso.com is hardcoded. This is probably the only URL you ever need ;-)

    About the book question: there is a new book coming out this month, specifically about programming in Dynamics NAV. Check out http://www.mibuso.com/bookofferpacktpub.asp
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • SavatageSavatage Member Posts: 7,142
    here's another ROUND_ABOUT way.

    Set your command button to Run A ProcessingOnly Report.

    PushAction: RunObject
    RunObject: Report HyperlinkTest (for example)
    Create a report that has the code you want to use.
    Ex/ pick any dataitem (that you need to run and/or get code from)
    OnPreDataItem()
    HYPERLINK('http://www.mibuso.com');

    This is going to take some thinking but I'm pretty sure it can be done.
    PS if you put the code onAfterGetRecord and use the item table for example. And you have 10000 items. Guess how many tabs your IE is going to try and open :lol:

    So if you can explain wht type of hyperlinking your looking to do perhaps we can figure out a way.
Sign In or Register to comment.