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

update operation on marked fields in browse

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

    update operation on marked fields in browse

    i am tying to update a few records at once (the field i want to update is an invoice number and we may have a few records on the same invoice).

    i have made a form which is filtered where the invoice number is blank. the records are in an embedded browse based upon a set.

    i have made a button to easily mark the records which need to be updated

    i have cretaed a global variable to receive the invoice number which will be used for the marked records

    i have created an update operation where the expression is based upon the variable.

    then finally i have a button to execute the operation.

    i am getting an error when i click the button to run the code

    script onpush line:13
    update.run (operation_name, query.filter, query.order)
    object does not support requested interface
    here is the code
    Code:
    '
    current_filter = current_filter_expn()
    current_order = current_order_expn()
    query.filter = current_filter + ".and. marked()"
    query.order =  current_order
    
    DIM operation_name as c
    operation_name = "invoice_addno"
    If operation_name <> "" then 
    	update.run(operation_name,query.filter,query.order)
    End if
    the strange thing is there is no line 13 in my code.

    this is the first time i have attempted something like this.

    #2
    Re: update operation on marked fields in browse

    code for the operation

    Code:
    'Get the current filter and order expressions for the current session....
    dim current_filter_expression as c
    dim current_order_expression as c
    
    delete temp_filter
    delete temp_order
    
    
    dim mru as p
    mru = mru_query("sleadmngmt.set")
    current_filter = mru.filter
    current_order = mru.order
    current_flags = mru.flags
    
    
    temp_filter = current_filter
    temp_order = current_order
    
    
    'Check to see if the current filter/order expression is valid in the context of "sleadmngmt.set". If not, set the filter to ".t."
    table_list = tables_in_set("sleadmngmt.set")
    if temp_filter <> "" then
    	if eval_valid(temp_filter,table_list) = .f. then
    		temp_filter = ".t."
    	end if
    end if
    
    if temp_order <> "" then
    	if eval_valid(temp_order,table_list) = .f. then
    		temp_order = ""
    	end if
    end if
    
    
    temp_filter = a5_unflatten_query(temp_filter)
    
    current_filter_expression = ""+temp_filter
    current_order_expression = ""+temp_order
    
    
    'This Operation is defined for a set. A set can only be opened in its own session.
    'Therefore, the evaluate_template_private() function is used. It executes code in a new session.
    
    'This is the argument that is passed to the evaulate_template_private() function
    xbasic_code = <<%code%
    table.reset("sleadmngmt.set")
    a_tbl = table.current()
    
    ON ERROR GOTO ERROR28052008150141484
    
    
    DIM a5_operation_filter as C
    a5_operation_filter = "<filter_expression>"
    query.filter = a5_operation_filter
    DIM a5_operation_order as C
    a5_operation_order = "<order_expression>"
    query.order = a5_operation_order
    query.options = "I"+ "<current_flags>"
    query.description = "Temporary Query"
    a_tbl.query_create("N")
    
    update.fields = 1
    update.field1 = "INVOICE_NUMBER"
    update.expr1 = "if(Invoice_Number=\"\",Var->addinvoice,INVOICE_NUMBER)"
    
    a_tbl.update()
    
    
    GOTO CONTINUE28052008150141484
    ERROR28052008150141484:
    ON ERROR GOTO 0
    ui_msg_box("Error","Error running Update Operation"+crlf()+error_text_get())
    END
    CONTINUE28052008150141484:
    
    'Display a dialog box showing the results of the Operation
    '(If last parameter is blank, button to show result is not displayed).
    a5_update_op_result(a_records_processed, a_records_violated,"sleadmngmt.set",a5_operation_filter)
    
    
    %code%
    
    'Note: <filter_expression> and <order_expression> are macros used to pass variables into the session in which
    'the evaulate_template_private() function executed.
    
    macro1 = "<filter_expression>="+ current_filter_expression
    macro2 = "<order_expression>="+current_order_expression
    macro3 = "<current_flags>="+current_flags
    evaluate_template_private(xbasic_code,macro1,macro2,macro3)
    
    
    
    
    '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

    Comment


      #3
      Re: update operation on marked fields in browse

      i took the form from the set and based it just on the table and it works great.

      i built this form at the beginning so just a lack of knowledge as the form didnt need to be based upon the set as it only contains fields from the parent table.

      Comment


        #4
        Re: update operation on marked fields in browse

        I have a similar problem with a button on a form which runs an operation that adds two figures together and subtract another. Also there is no line 16. This operation run fine from the control panel. I created this form originally in ver 8 and I'm using ver 10. I have only recently started using the buttons (ver 10 only - form originally created in ver 8) so do not get too technical.

        script onpush line:16
        update.run (operation_name, query.filter, query.order)
        object does not support requested interface

        Copied from x-basic

        'Run a saved 'Update' operation: 'Inventory Status'.
        record_number = current_record_number()
        query.filter = "recno() = " + record_number
        query.order = ""

        DIM operation_name as c
        operation_name = "Inventory Status"
        If operation_name <> "" then
        update.run(operation_name,query.filter,query.order)
        End if

        Comment


          #5
          Re: update operation on marked fields in browse

          It would be best if you described your specific problem in detail so we wouldn't have to spend a bunch of time trying to figure out what the original problem was and then have to extrapolate it to your situation.
          Mike W
          __________________________
          "I rebel in at least small things to express to the world that I have not completely surrendered"

          Comment


            #6
            Re: update operation on marked fields in browse

            Since the operation runs from the control panel there is nothing wrong with the operation.
            Since the button was ok in V8 there is apparently some difference in V10 causing a problem.

            Best sugggestion is to recreate the form in V10 and see how it performs. It isn't clear whether you use an action script to run the operation and are showing us the xbasic of the action script or whether you are using the converted xbasic. If you are using an action script you may be able to just recreate the button, choose the action, and the new action should perform correctly. There are minor differences in action scripting from version to version.
            There can be only one.

            Comment

            Working...
            X