iSeries Client Access Macro button

105 pts.
Tags:
Client Access
IBM iSeries
Can the name matching between Macro Name and iSeries screen change by setup?. It seems to stop the matching at spaces. For example, how can it match complete sentence; like "Customer Type." Now it only match the word "customer" wherever it occur on the iSeries screen. This is more obvious when using macro buttons. This are active when Hotspots are activated with 3D buttons.

Software/Hardware used:
Client Access ISeries Macros Version 5.8 - Windows

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 19  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • ToddN2000
    What does your macro look like and what is it trying to accomplish? Not sure what you are trying to match.. Can you provide some more detail?
    11,050 pointsBadges:
    report
  • PRPROG

    Thanks Todd for replying. In this situation it is about the literal on the green screen. Let say that there is a field description that said "Customer Type" . I have a macro name Customer Type.Mac that will pop up an explanation (message) when the macro button is press. Client Access is showing buttons everywhere the word "Customer" is found on every screen. Is there a way to make it recognize the full "Customer Type" so the macro is only applicable only for customer type fields?

    Thanks,

    PRPROG

    105 pointsBadges:
    report
  • ToddN2000
    OK I understand now. You are looking to do something similar to the VB tool tip but with a macro. Your problem is it's happen everywhere "Customer" is displayed on screen. Fields like "Customer Account","Customer Type", "Customer Name", "Customer Address".... and you only want it on "Customer Type".  What does your macro script look like" Can you post the code?
    11,050 pointsBadges:
    report
  • PRPROG

    [PCOMM SCRIPT HEADER]
    LANGUAGE = VBSCRIPT
    DESCRIPTION =
    [PCOMM SCRIPT SOURCE]


    MsgBox "Customer Type determine the invoicing route"

     

    ------------------------------------------------------------------------------

    As you can see it is a very simple Macro.

    105 pointsBadges:
    report
  • ToddN2000
    That Code looks fine. You may want to try using the pComm5250.GetText(row,col,len) to be your trigger and see if that is "Customer Type". You can find some good related info here.
    11,050 pointsBadges:
    report
  • PRPROG

    I understand that the  "row, col"  construct depend on where the cursor is located; on pressing the macro  button the code will "read" where the cursor was left by the user; not necessary on the field we are interested.....unless there is some function/method to read the position of the macro button currently press.....

    105 pointsBadges:
    report
  • ToddN2000
    I wish we could attach screen shots... Then you could show me your button set up...
    I was curios if something like this code may work for you.

    [PCOMM SCRIPT HEADER]
    LANGUAGE=VBSCRIPT
    DESCRIPTION=Shipment Tracking
    [PCOMM SCRIPT SOURCE]
    
    Dim wsh
    Set wsh=CreateObject("WScript.Shell")
    
    Dim pComm5250
    
    autECLSession.SetConnectionByName(ThisSessionName)
    Set pComm5250=autECLSession.autECLPS
    
    Dim ctbUTTON
    CTbUTTON=pComm5250.GetText(20,7,20)
    
    If ctButton = "Customer Type" Then
    MsgBox "Customer Type determine the invoicing route"
    End If
    
    Set wsh=Nothing
    Set pComm5250=Nothing
    Set ctButton=Nothing
    11,050 pointsBadges:
    report
  • PRPROG
    ummm...but you are telling the macro that "GetText(20,7,20)" will always read from a specific row/column position...right?
    105 pointsBadges:
    report
  • ToddN2000
    Yes. How is your screen generated? Can "Customer Type" be located in a different position? How is macro being launched, are they clicking on the text label or a button or the play button ?
    11,050 pointsBadges:
    report
  • PRPROG
    Yes; Customer Type is located in many places...and in many screens (on different locations). The macros are launch by clickling on a button. We want to used buttons to indicate which fields have an specific help information. ...this is why the need to match the macro name with the button.
    105 pointsBadges:
    report
  • ToddN2000
    At this point I'm not sure if I can help.. I did do some searching at lunch and not much luck. The actual button(s) they click on your screen for the macro(s) are created how? I assume this is not a "green screen" application. Is your page being built dynamically using .NET or C++? How many different macro buttons are on a page?  There may be a better method to your dilemma if all you want to do is display a message box with information about your field for your macro.
    11,050 pointsBadges:
    report
  • PRPROG

    The buttons are activated within iSeries Client Access aplication when we select Hotspot setup -> Execute macro/script-> 3-D Button. There is not .NET or C++. This is within iSeries Client Access macro languange (VB Script).

    There could be as many macro as we identify key fields that need a special instruction. The user will see the button and click the button to get additional information.

    105 pointsBadges:
    report
  • ToddN2000
    Played around with this a bit last night. I see what you are trying to do. If you create a custom hotspot/macro will this work only on the pc the macro resides? Secondly the easiest thing I can see would be to make the macro/script on the word "Type" for the quickest fix.
    11,050 pointsBadges:
    report
  • PRPROG
    Thanks Todd. I appreciate that you took time to work on this. Thanks. The macros reside on a shared folder and are available to everyone which we setup the folder. Your suggestion might work for the Customer Type field...but we have other "...type" fields that do not related to Customer Type.  To recap what we need is a way to change the behaviour used by the iSeries Client Access program to match the macro name and the green screen literal. I have not found if there is some setting that will change this behaviour. Again, thanks.
    105 pointsBadges:
    report
  • ToddN2000
    Same here.. I think the space is what is stopping you dead in the water... The only other thing I could think of involves a little work or a lot. It would be to change the label in the display file to something like "Customer_Type". Replacing the space with an underscore. I don't know if you can save a macro with a name with special characters.
    11,050 pointsBadges:
    report
  • PRPROG
    Thanks for the idea...yes the macro name can have an underscore.....but the iSeries screens/application cannot be change; therefore I can't used that option. If only I can find a PCOMM object function and a property where I can read either the button caption (within Client Access host) or the position in row/column of the button press...I can used some logic for a lookup table for the correct information to be presented to the users....I have not found it yet...
    105 pointsBadges:
    report
  • ToddN2000
    The only other option would be to set up help text in your DDS. I am betting if you cannot change the label on the screen you will not be allowed to do this. Either you do not have the source or you cannot make program modifications.

    I'll keep kicking it around a bit longer.
    11,050 pointsBadges:
    report
  • PRPROG

    For this iSeries application we cannot make any changes to the DDS. Thanks again for your effort. Let me know if you find something else.

    Thanks,

    PRPROG

     

    105 pointsBadges:
    report
  • PRPROG

    Todd:

    Since I did not find how to set the macro button based on the full macro file name I decided to change the strategy and used just one button per application screen. The button will be the screen ID name which would match to the macro name. The user put the cursor on the first position of the field to inquire for help and press the macro (hotspot) on the screen. The script based on the cursor position will read an MS Access file that contain the help information specifically for the field. This is the macro in case someone want to used this concept. Again thanks a lot for you help.

    [the application is an HTA application that read the MS Access database using the screen id + Col + Row as an ID for the specific help record.

    -------------------------------------------------------------------------------

    [PCOMM SCRIPT HEADER]
    LANGUAGE = VBSCRIPT
    DESCRIPTION =
    [PCOMM SCRIPT SOURCE]

     

    autECLSession.SetConnectionByName(ThisSessionName)
    Set PCOMM5250 = autECLSession.autECLPS

    '--Set MacroName variable = to screen ID
    MacroName = "FM01A101"

    'Read current cursor - as set by user to request Help
    curcol = PCOMM5250.CursorPosCol
    currow= PCOMM5250.CursorPosRow

    HelpID = chr(34) & MacroName & curcol & currow & chr(34)

    RunAppPath = "KnowStation.HTA " &  HelpID
    Set sObj = CreateObject("WScript.Shell")
    X = sObj.Run(RunAppPath)
    Set sObj = Nothing

     

    105 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following