Alpha Software Mobile Development Tools:   Alpha Anywhere    |   Alpha TransForm subscribe to our YouTube Channel  Follow Us on LinkedIn  Follow Us on Twitter  Follow Us on Facebook

Announcement

Collapse

The Alpha Software Forum Participation Guidelines

The Alpha Software Forum is a free forum created for Alpha Software Developer Community to ask for help, exchange ideas, and share solutions. Alpha Software strives to create an environment where all members of the community can feel safe to participate. In order to ensure the Alpha Software Forum is a place where all feel welcome, forum participants are expected to behave as follows:
  • Be professional in your conduct
  • Be kind to others
  • Be constructive when giving feedback
  • Be open to new ideas and suggestions
  • Stay on topic


Be sure all comments and threads you post are respectful. Posts that contain any of the following content will be considered a violation of your agreement as a member of the Alpha Software Forum Community and will be moderated:
  • Spam.
  • Vulgar language.
  • Quotes from private conversations without permission, including pricing and other sales related discussions.
  • Personal attacks, insults, or subtle put-downs.
  • Harassment, bullying, threatening, mocking, shaming, or deriding anyone.
  • Sexist, racist, homophobic, transphobic, ableist, or otherwise discriminatory jokes and language.
  • Sexually explicit or violent material, links, or language.
  • Pirated, hacked, or copyright-infringing material.
  • Encouraging of others to engage in the above behaviors.


If a thread or post is found to contain any of the content outlined above, a moderator may choose to take one of the following actions:
  • Remove the Post or Thread - the content is removed from the forum.
  • Place the User in Moderation - all posts and new threads must be approved by a moderator before they are posted.
  • Temporarily Ban the User - user is banned from forum for a period of time.
  • Permanently Ban the User - user is permanently banned from the forum.


Moderators may also rename posts and threads if they are too generic or do not property reflect the content.

Moderators may move threads if they have been posted in the incorrect forum.

Threads/Posts questioning specific moderator decisions or actions (such as "why was a user banned?") are not allowed and will be removed.

The owners of Alpha Software Corporation (Forum Owner) reserve the right to remove, edit, move, or close any thread for any reason; or ban any forum member without notice, reason, or explanation.

Community members are encouraged to click the "Report Post" icon in the lower left of a given post if they feel the post is in violation of the rules. This will alert the Moderators to take a look.

Alpha Software Corporation may amend the guidelines from time to time and may also vary the procedures it sets out where appropriate in a particular case. Your agreement to comply with the guidelines will be deemed agreement to any changes to it.



Bonus TIPS for Successful Posting

Try a Search First
It is highly recommended that a Search be done on your topic before posting, as many questions have been answered in prior posts. As with any search engine, the shorter the search term, the more "hits" will be returned, but the more specific the search term is, the greater the relevance of those "hits". Searching for "table" might well return every message on the board while "tablesum" would greatly restrict the number of messages returned.

When you do post
First, make sure you are posting your question in the correct forum. For example, if you post an issue regarding Desktop applications on the Mobile & Browser Applications board , not only will your question not be seen by the appropriate audience, it may also be removed or relocated.

The more detail you provide about your problem or question, the more likely someone is to understand your request and be able to help. A sample database with a minimum of records (and its support files, zipped together) will make it much easier to diagnose issues with your application. Screen shots of error messages are especially helpful.

When explaining how to reproduce your problem, please be as detailed as possible. Describe every step, click-by-click and keypress-by-keypress. Otherwise when others try to duplicate your problem, they may do something slightly different and end up with different results.

A note about attachments
You may only attach one file to each message. Attachment file size is limited to 2MB. If you need to include several files, you may do so by zipping them into a single archive.

If you forgot to attach your files to your post, please do NOT create a new thread. Instead, reply to your original message and attach the file there.

When attaching screen shots, it is best to attach an image file (.BMP, .JPG, .GIF, .PNG, etc.) or a zip file of several images, as opposed to a Word document containing the screen shots. Because Word documents are prone to viruses, many message board users will not open your Word file, therefore limiting their ability to help you.

Similarly, if you are uploading a zipped archive, you should simply create a .ZIP file and not a self-extracting .EXE as many users will not run your EXE file.
See more
See less

Running scripts from a toolbar

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Running scripts from a toolbar

    I have a script that runs perfectly from a button but it does not execute from the toolbar.
    It is supposed to export records not posted to the server to a "Not_Posted" Table.
    Inserting a "Wait for Idle" does not help
    There is no problem with the second part when the user selects "No"
    The code:
    Code:
    'Displays a message box (style:'Yes, No Buttons', image: 'Information symbol', id: 'vSelected').DIM SHARED  vSelected_result as N
    DIM SHARED  vSelected_YES_Button as L 
    DIM SHARED  vSelected_NO_Button as L 
    vSelected_YES_Button = .F.
    vSelected_NO_Button = .F.
    title_var = "Quit Bookings"
    message_text_var = <<%text%
    Are you sure that you want to quit
    %text%
    vSelected_result=ui_msg_box(title_var,message_text_var,UI_YES_NO+ UI_FIRST_BUTTON_DEFAULT+ UI_INFORMATION_SYMBOL)
    'Test to see which button on the message box was pressed....
    SELECT
        CASE vSelected_result = UI_YES_SELECTED
            vSelected_YES_Button= .t.
            script_play_local("Export_Not_Posted")
            'script_play_local("Rebuild_Indexes")
            'Pause the script for a instant until the user interface has finished repainting.
            'xbasic_wait_for_idle(3)
            'Exit Alpha Five.
            :a5.close()    
    CASE vSelected_result = UI_NO_SELECTED
            vSelected_NO_Button= .t.
            if vRole = "Administrator" then
                script_play_local("Frm_Bookings_Master")
                'Default comment text.
                DIM records_found as N
            end if
            if vRole = "Bookings" then
                script_play_local("Frm_Bookings")
                'Default comment text.
                DIM records_found as N
            end if
            if vRole = "Developer" then
                script_play_local("Frm_Bookings_Master")
            end if
    END SELECT
    I would appreciate any help on the above
    Thanks
    Peter G

    #2
    Re: Running scripts from a toolbar

    My apologies.
    Here is the actual script:
    Code:
    a_tbl = table.open("notposted")
    append.t_db = "bookings"
    ON ERROR GOTO ERROR20032014085331532
    
    
    append.m_key = "INVOICE_NUMBER"
    append.t_key = "INVOICE_NUMBER"
    append.m_filter = ""
    append.t_filter = "Status = \"I\" .OR. Status = \"E\""
    append.type = "Unique only"
    append.m_count = 62
    append.m_field1 = "Booking_Seq"
    append.m_exp1 = "@Bookings->Booking_Seq"
    append.m_field2 = "Invoice_Number"
    append.m_exp2 = "@Bookings->Invoice_Number"
    append.m_field3 = "Tour_Date"
    append.m_exp3 = "@Bookings->Tour_Date"
    append.m_field4 = "Booking_Date"
    append.m_exp4 = "@Bookings->Booking_Date"
    append.m_field5 = "Status"
    append.m_exp5 = "@Bookings->Status"
    append.m_field6 = "Test_Time"
    append.m_exp6 = "@Bookings->Test_Time"
    append.m_field7 = "Test_Time_Two"
    append.m_exp7 = "@Bookings->Test_Time_Two"
    append.m_field8 = "Concierge"
    append.m_exp8 = "@Bookings->Concierge"
    append.m_field9 = "Booking_By"
    append.m_exp9 = "@Bookings->Booking_By"
    append.m_field10 = "Concierge_Company"
    append.m_exp10 = "@Bookings->Concierge_Company"
    append.m_field11 = "Concierge_Mobile"
    append.m_exp11 = "@Bookings->Concierge_Mobile"
    append.m_field12 = "Concierge_Tel"
    append.m_exp12 = "@Bookings->Concierge_Tel"
    append.m_field13 = "Concierge_Fax"
    append.m_exp13 = "@Bookings->Concierge_Fax"
    append.m_field14 = "Con_Com_Paid"
    append.m_exp14 = "@Bookings->Con_Com_Paid"
    append.m_field15 = "Booking_Year"
    append.m_exp15 = "@Bookings->Booking_Year"
    append.m_field16 = "Booking_Month"
    append.m_exp16 = "@Bookings->Booking_Month"
    append.m_field17 = "Booking_Day"
    append.m_exp17 = "@Bookings->Booking_Day"
    append.m_field18 = "Pickup_Time"
    append.m_exp18 = "@Bookings->Pickup_Time"
    append.m_field19 = "Hotel_Name"
    append.m_exp19 = "@Bookings->Hotel_Name"
    append.m_field20 = "Hotel_Booking"
    append.m_exp20 = "@Bookings->Hotel_Booking"
    append.m_field21 = "Hotel_Address"
    append.m_exp21 = "@Bookings->Hotel_Address"
    append.m_field22 = "Hotel_Address1"
    append.m_exp22 = "@Bookings->Hotel_Address1"
    append.m_field23 = "Hotel_Address2"
    append.m_exp23 = "@Bookings->Hotel_Address2"
    append.m_field24 = "Hotel_Address3"
    append.m_exp24 = "@Bookings->Hotel_Address3"
    append.m_field25 = "Hotel_Pcode"
    append.m_exp25 = "@Bookings->Hotel_Pcode"
    append.m_field26 = "Room_No"
    append.m_exp26 = "@Bookings->Room_No"
    append.m_field27 = "Hotel_Tel"
    append.m_exp27 = "@Bookings->Hotel_Tel"
    append.m_field28 = "Sa_Contact_Details"
    append.m_exp28 = "@Bookings->Sa_Contact_Details"
    append.m_field29 = "Pax_Name"
    append.m_exp29 = "@Bookings->Pax_Name"
    append.m_field30 = "Pax_Email"
    append.m_exp30 = "@Bookings->Pax_Email"
    append.m_field31 = "Country"
    append.m_exp31 = "@Bookings->Country"
    append.m_field32 = "Tour_Price"
    append.m_exp32 = "@Bookings->Tour_Price"
    append.m_field33 = "Concierge_Dep_Taken"
    append.m_exp33 = "@Bookings->Concierge_Dep_Taken"
    append.m_field34 = "Total_Amount"
    append.m_exp34 = "@Bookings->Total_Amount"
    append.m_field35 = "Conceirge_Amnt_To_Collect"
    append.m_exp35 = "@Bookings->Conceirge_Amnt_To_Collect"
    append.m_field36 = "Tot_Pax"
    append.m_exp36 = "@Bookings->Tot_Pax"
    append.m_field37 = "Commission_Percentage"
    append.m_exp37 = "@Bookings->Commission_Percentage"
    append.m_field38 = "Commission_Amount"
    append.m_exp38 = "@Bookings->Commission_Amount"
    append.m_field39 = "Invoice_Amount"
    append.m_exp39 = "@Bookings->Invoice_Amount"
    append.m_field40 = "Balance_Outstanding"
    append.m_exp40 = "@Bookings->Balance_Outstanding"
    append.m_field41 = "Client_Amnt_Paid"
    append.m_exp41 = "@Bookings->Client_Amnt_Paid"
    append.m_field42 = "O_S_Comp_Commision"
    append.m_exp42 = "@Bookings->O_S_Comp_Commision"
    append.m_field43 = "Discount"
    append.m_exp43 = "@Bookings->Discount"
    append.m_field44 = "Tot_Received_Client"
    append.m_exp44 = "@Bookings->Tot_Received_Client"
    append.m_field45 = "Tour"
    append.m_exp45 = "@Bookings->Tour"
    append.m_field46 = "Code"
    append.m_exp46 = "@Bookings->Code"
    append.m_field47 = "Tour_Note_Type"
    append.m_exp47 = "@Bookings->Tour_Note_Type"
    append.m_field48 = "Miscelan"
    append.m_exp48 = "@Bookings->Miscelan"
    append.m_field49 = "Outsourced_Company"
    append.m_exp49 = "@Bookings->Outsourced_Company"
    append.m_field50 = "Contact_Outsourced_Comp"
    append.m_exp50 = "@Bookings->Contact_Outsourced_Comp"
    append.m_field51 = "Outsourced_Price"
    append.m_exp51 = "@Bookings->Outsourced_Price"
    append.m_field52 = "O_S_Comp_Paid"
    append.m_exp52 = "@Bookings->O_S_Comp_Paid"
    append.m_field53 = "Cost_Internet_And_Oth"
    append.m_exp53 = "@Bookings->Cost_Internet_And_Oth"
    append.m_field54 = "Guide"
    append.m_exp54 = "@Bookings->Guide"
    append.m_field55 = "Vehicle"
    append.m_exp55 = "@Bookings->Vehicle"
    append.m_field56 = "Vehicle_Capacity"
    append.m_exp56 = "@Bookings->Vehicle_Capacity"
    append.m_field57 = "Notes_Office"
    append.m_exp57 = "@Bookings->Notes_Office"
    append.m_field58 = "Notes_For_Client"
    append.m_exp58 = "@Bookings->Notes_For_Client"
    append.m_field59 = "Client_Name"
    append.m_exp59 = "@Bookings->Client_Name"
    append.m_field60 = "Booking_Status"
    append.m_exp60 = "@Bookings->Booking_Status"
    append.m_field61 = "Void"
    append.m_exp61 = "@Bookings->Void"
    append.m_field62 = "Res_Balance"
    append.m_exp62 = "@Bookings->Res_Balance"
    append.t_count = 0
    
    
    a_tbl.append()
    
    
    GOTO CONTINUE20032014085331532
    ERROR20032014085331532:
    ON ERROR GOTO 0
    ui_msg_box("Error","Error running Append Operation"+crlf()+error_text_get())
    END
    CONTINUE20032014085331532:
    a_tbl.close()
    'If the Operation is run from within a Form or Browse, then refresh the window
    if is_object(topparent.this) then
        if topparent.Class() = "form" .or. topparent.class() = "browse" then
            topparent.Refresh_layout()
        end if
    end if
    Thanks
    Peter G

    Comment


      #3
      Re: Running scripts from a toolbar

      My apologies:
      This post was posted on the wrong forum.
      It was meant to be posted on the A5V11 Desktop Applications forum
      Last edited by Al Buchholz; 04-10-2014, 03:31 PM. Reason: Moved to proper forum

      Comment


        #4
        Re: Running scripts from a toolbar

        How have you addressed the script on the Toolbar?
        Your options are;
        Play Global Script - it needs to be saved
        Run Xbasic - put the script content in the right place
        Internal Action - Never used this.

        Did you create the Append using the Operations genie?

        I have found that Toolbars do not work in the same way as buttons on a Form. Looks like they should, says that they will, but they don't always.
        Stan suggested that Context might be an issue, but I was unable to find a satisfactory solution to the Cancel problem I had with a Browse.

        Read this bit from Help Text;

        Xbasic Script Context

        When you run a script that is attached to a toolbar button, the script has the same context as the active window. The aliases this and parentform, used in a script attached to a toolbar button, refers to the active window.
        See our Hybrid Option here;
        https://hybridapps.example-software.com/


        Apologies to anyone I haven't managed to upset yet.
        You are held in a queue and I will get to you soon.

        Comment

        Working...
        X