Want to get rid of Google Ads, click here.
+ Reply to Thread
Results 1 to 8 of 8

Thread: Invoke javascript from a button

  1. #1
    Junior Member
    Join Date
    Jan 2009
    Posts
    27

    Default Invoke javascript from a button

    I am a web developer. I am working on a Service Center 6.2 project. I need to invoke javascript code when a button is clicked on a SC form inside the fat Client not web client. Would anyone give me a step by step guide on how this can be accomplished in Service Center client?

    Thank you very much.

  2. #2
    Senior Member
    Join Date
    Apr 2006
    Location
    Poland
    Posts
    680

    Default

    1. in SC client go to your format on which you want the button
    2. notice the text in the brackets in rigth bottom corner (this is screen id) and the text before the corner (this is name of the format). for example:
    IM.update.incident(apm.edit.problem)
    IM.update.incident - is format name
    apm.edit.problem - is screen id
    3. in command line (left upper corner) write "do" and hit enter
    4. search for displayoptions with screen id = apm.edit.problem
    5. add a new displayoption and place the javascript on the javascript tab,
    choose the unuiqe gui number (above 200) and save it
    6. in command line write fd and hit enter
    7. search for your format and hit Design
    8. place a new button. In button id field place the gui number from point 5
    9. save it

    regards
    Artur

  3. #3
    Junior Member
    Join Date
    Nov 2008
    Posts
    11

    Default

    Why the gui number must be above 200? I have read in the documentation the difference in the gui number should be above 800, because below 800 are used for buttons in the toolbar.

    By the way, once this JS code is executed, what are the steps to open a new fd I have created?
    I have seen in the documentation a function called wopen that seems to be valid for this purpose, but I don't know how to use it.

    In my case I have put in the do associated to my button a jscall to my script library instead writing the JS code in the JS tab.

    Thanks a lot in advance.

  4. #4
    Senior Member
    Join Date
    Apr 2006
    Location
    Poland
    Posts
    680

    Default

    When you search for "800" in help server - nothing appears. So 200 is the 'magic' number for deciding where the option will be displayed.

    If you want the form to be displayed - you have to use scripts, wizards or just some application which by default displays the forms.

    I was refferring the original question, which I understood as how to add the button on existing form, not how to add the button and then display new form.

    regards
    Artur

  5. #5
    Junior Member
    Join Date
    Jan 2009
    Posts
    27

    Default

    Thanks a lot Artur. That really help. I followed your steps and created a button but when the form is loaded, the button is disabled. What did I miss? (see attachment)


    BTW, jcperez, what document you referred to in your message. I have little document about SC except windows client help and two handout from essential and tayloring classes (I have not attended class BTW).

    I am a web developer by trade and need to finish a project in less than two months. I practically has no mentors to learn from except from those books and from existing code and from your guys. If any of you would point me to the right direction in order to get to speed quickly with windows client tayloring, I will be grateful.

    Thanks again.
    Last edited by gzhao888; 2009-01-11 at 21:48.

  6. #6
    Junior Member
    Join Date
    Jan 2009
    Posts
    27

    Default

    I figured it out. Somehow, the screen ID used in form design is totally different from the screen ID when form is running. Only the screen ID in a running form matters.

  7. #7
    Junior Member
    Join Date
    Nov 2008
    Posts
    11

    Default

    Hi gzhao888,

    The pdf document I was talking about could be found in the Help Contents, under the section ServiceCenter PDF Guides, at the bottom of the Contents. In that section there are attached several pdf guides: the one I found the wopen call is the Rapid Aplication Development (RAD) one.

    Hope this helps.

  8. #8
    Junior Member
    Join Date
    Jan 2009
    Posts
    27

    Default

    I never realized there are links to a bunch of pdf documents in Help Contents. It is not very obvious until you clicked a search result. That helps. Thanks, jcperez.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Tags for this Thread

Bookmarks

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts