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

trouble with global field reference in filter of append opperation

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

  • trouble with global field reference in filter of append opperation

    I'm trying to append rows to a table adding only non-duplicates. I'm doing this by using field1 as a linking field in the transaction and the master and filtering rows of the master by the key associated with the current set of records I want to update. I keep getting an error says that I'm referencing a non-existent field. The xbasic generated looks like this
    where Project_id is a field in the target table ?? The expression was created with the expression builder...

    a_tbl = table.current()
    append.t_db = "e:\users\bill.standke\my documents\alpha five v11\rpd.dbf"
    append.m_key = "SUBJECT_AREA"
    append.t_key = "SUBJECT_AREA"
    append.m_filter = "Project_Id=var->gbProjectID "
    append.t_filter = ""
    append.type = "Unique, replace existing"
    append.m_count = 3
    append.m_case1 = "EITHER"
    append.m_field1 = "SUBJECT_AREA"
    append.m_exp1 = "@RPD->SUBJECT_AREA"
    append.m_case2 = "EITHER"
    append.m_field2 = "PROJECT_ID"
    append.m_exp2 = "Var->gbProjectID"
    append.m_case3 = "EITHER"
    append.m_field3 = "TIMECREATED"
    append.m_exp3 = "Var->gbTimeStamp"
    append.t_count = 0
    a_tbl.append()

  • #2
    Re: trouble with global field reference in filter of append opperation

    i have same problem using v11
    capture-20150815-223446.png

    pls. help ^_^

    this method is working in my v8
    Last edited by nehru; 08-15-2015, 10:35 AM.
    "Knowledge without application is useless."

    Comment


    • #3
      Re: trouble with global field reference in filter of append opperation

      Originally posted by nehru View Post
      i have same problem using v11
      [ATTACH=CONFIG]40875[/ATTACH]

      pls. help ^_^

      this method is working in my v8
      Please show where and when the variable is dimmed.

      Any other code would be good too.
      Al Buchholz
      Bookwood Systems, LTD
      Weekly QReportBuilder Webinars Thursday 1 pm CST

      Occam's Razor - KISS
      Normalize till it hurts - De-normalize till it works.
      Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
      When we triage a problem it is much easier to read sample systems than to read a mind.
      "Make it as simple as possible, but not simpler."
      Albert Einstein

      http://www.iadn.com/images/media/iadn_member.png

      Comment


      • #4
        Re: trouble with global field reference in filter of append opperation

        The proper syntax is
        append.m_filter = "Project_Id= " + s_quote(var->gbProjectID)
        Where the variable is character or numerical and the variable is of sufficient scope for the code to see it.

        As shown originally it should work if the variable is dimmed as global and numerical but best practice is to "expose" the variable by moving it out of the quotation marks.
        There can be only one.

        Comment


        • #5
          Re: trouble with global field reference in filter of append opperation

          capture-20150816-140649.png

          created in the operations tab
          the variable vORDNUM is set to GLOBAL in a button before the append operation
          ive try STAN's advice but no luck

          it was running in v8 but not in v11

          ty for helping ^_^

          default xbasic code for append


          DIM Append as P

          a_tbl = table.open("orders det")
          append.t_db = "lnkpas_sms_orders_copy"
          ON ERROR GOTO ERROR16082015162011335


          append.m_key = "alltrim(Order_No)+alltrim(Item_Code)"
          append.t_key = "alltrim(Loc_Code)+alltrim(Item_Code)"
          append.m_filter = "Order_No = Var->vORDNUM"
          append.t_filter = ""
          append.type = "Unique, replace existing"
          append.m_count = 10
          append.m_case1 = "EITHER"
          append.m_field1 = "ITEM_CODE"
          append.m_exp1 = "@LNKPAS_SMS_ORDERS_COPY->Item_Code1"
          append.m_case2 = "EITHER"
          append.m_field2 = "ITEM"
          append.m_exp2 = "@LNKPAS_SMS_ORDERS_COPY->ITEM"
          append.m_case3 = "EITHER"
          append.m_field3 = "UNIT_CODE"
          append.m_exp3 = "@LNKPAS_SMS_ORDERS_COPY->UNIT_CODE"
          append.m_case4 = "EITHER"
          append.m_field4 = "UNIT"
          append.m_exp4 = "@LNKPAS_SMS_ORDERS_COPY->UNIT"
          append.m_case5 = "EITHER"
          append.m_field5 = "DISPLAY"
          append.m_exp5 = "@LNKPAS_SMS_ORDERS_COPY->DISPLAY"
          append.m_case6 = "EITHER"
          append.m_field6 = "COST"
          append.m_exp6 = "@LNKPAS_SMS_ORDERS_COPY->COST"
          append.m_case7 = "EITHER"
          append.m_field7 = "SELLING"
          append.m_exp7 = "@LNKPAS_SMS_ORDERS_COPY->SELLING"
          append.m_case8 = "EITHER"
          append.m_field8 = "COMPANY_CODE"
          append.m_exp8 = "@LNKPAS_SMS_ORDERS_COPY->COMPANY_CODE"
          append.m_case9 = "EITHER"
          append.m_field9 = "DATETIME_ENTRY"
          append.m_exp9 = "@LNKPAS_SMS_ORDERS_COPY->DATETIME_ENTRY"
          append.m_case10 = "EITHER"
          append.m_field10 = "Order_No"
          append.m_exp10 = "@LNKPAS_SMS_ORDERS_COPY->Loc_Code"
          append.t_count = 0

          a_tbl.append()


          GOTO CONTINUE16082015162011335
          ERROR16082015162011335:
          ON ERROR GOTO 0
          ui_msg_box("Error","Error running Append Operation"+crlf()+error_text_get())
          END
          CONTINUE16082015162011335:
          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
          Last edited by nehru; 08-16-2015, 05:54 AM.
          "Knowledge without application is useless."

          Comment


          • #6
            Re: trouble with global field reference in filter of append opperation

            Originally posted by nehru View Post
            ive try STAN's advice but no luck
            Did you try Stan's code in the operation builder or as an xbasic script?

            Stan's option is for an xbasic script. It will work there.
            Al Buchholz
            Bookwood Systems, LTD
            Weekly QReportBuilder Webinars Thursday 1 pm CST

            Occam's Razor - KISS
            Normalize till it hurts - De-normalize till it works.
            Advice offered and questions asked in the spirit of learning how to fish is better than someone giving you a fish.
            When we triage a problem it is much easier to read sample systems than to read a mind.
            "Make it as simple as possible, but not simpler."
            Albert Einstein

            http://www.iadn.com/images/media/iadn_member.png

            Comment


            • #7
              Re: trouble with global field reference in filter of append opperation

              ppend.m_key = "alltrim(Order_No)+alltrim(Item_Code)"
              append.t_key = "alltrim(Loc_Code)+alltrim(Item_Code)"
              append.m_filter = "Order_No = Var->vORDNUM"
              tell us the data types stored in "Order_No", "Item_Code", "Loc_Code", "Item_Code", and "vOrdnum". Your code suggests that the first four fields are "CHARACTER" data, but the way you've written the last line vORDNUM is numeric. Is that what you intend?

              Comment


              • #8
                Re: trouble with global field reference in filter of append opperation

                Bill,

                I have been thinking about your question, and have decided I don't understand your goal. If you succeed in applying a filter to the master table and then append "unique, replace existing" you may be creating lots of duplicates in the master table. When the operation tries to identify whether a transaction record is unique, its "view" of the master table should NOT be limited by a filter. Otherwise, transaction records that don't match the filtered view of any records in the master will be appended, right? Some or all of those may duplicate OTHER records in the master, lying outside the range of your filter.

                I'd argue a more typical approach would filter records in the transaction table, not the master.

                Comment


                • #9
                  Re: trouble with global field reference in filter of append opperation

                  tnx for the help guys

                  my main goal is to append the transaction table to the master table (filtered) <unique, replace existing>
                  this is working on A5V8 using default operation append

                  first i will try all your advice then i'll post the result

                  more power to all of us ^_^

                  the Var->ORDNUM is character (10)
                  capture-20150816-140649.pngcapture-20150817-161801.pngcapture-20150817-161830.png
                  Last edited by nehru; 08-17-2015, 04:54 AM.
                  "Knowledge without application is useless."

                  Comment


                  • #10
                    Re: trouble with global field reference in filter of append opperation

                    TOM CONE JR is correct ^_^

                    i've create a field ORDER_NO in the transaction table
                    IT WORKS!

                    in my obervation, when filtering the master table with a field1 and a global variable; the field1 must be also exist in the transaction table
                    the message error we discuss above is for the transaction table not in the master (funny) hmm but i place it in under the master filter not in the transaction filter

                    anyway problem is solve

                    tnx to the effort guys
                    tnx for the help
                    "Knowledge without application is useless."

                    Comment

                    Working...
                    X