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

'e.rv' and 'e.rtc' variables with AfterRecord Events

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

    'e.rv' and 'e.rtc' variables with AfterRecord Events

    There are so many 'e.' variables, it's hard to know which to use when.
    It is also very difficult to find information describing the differences, and which to use under what circumstances.

    Can anyone point me to a good reference that encompasses all this information in one place?

    More specifically, what is the difference between the 'e.rv.' variables and the 'e.rtc.' variables, when is it appropriate to use which?

    I have xbasic in the AfterInsertRecord, AfterUpdateRecord, and AfterDeleteRecord events.

    I assign Member_id = e.rv.session.a_tbl.Member_id
    I loop though some code, and in the end do a tbl.update()

    This code all works perfect in WORKING PREVIEW,
    and it works mostly in LIVEPREVIEW,
    but for some reason it is NOT WORKING in the SERVER APPLICATION.

    It appears that the UPDATE is not happening when working from the server application.

    Since it works fine elsewhere, I'm totally stumped as to how I can track down the problem.

    My variables are DIM SHARED , I am opening the table as SHARED,
    I assign the update.field & Update.expr after the tbl is opened, and I
    execute the Update() prior to closing the table.

    I am working with 2 open tables, but have them assigned to different variables.

    Any idea on what why the update() would work in all modes EXCEPT on the server?


    This is the code in AfterInsertRecord: ( I have trimmed out the clutter to make it more readable)

    dim tbl as p
    dim indx_name as P
    dim ccmember_id as c

    DIM Shared Is_PCP AS C
    DIM Shared Is_EO AS C
    DIM Shared Is_Cc_Member AS C
    DIM Shared Is_Exec_Cmty_Member AS C
    DIM Shared Is_Office_Abrev AS C

    tbl = table.open("[PathAlias.ADB_Path]\members_offices_held",FILE_RW_SHARED)

    ccmember_id = e.DataSubmitted.Member_id

    'VERIFY IF MEMBER IS A PCP
    Is_PCP = if(a5_get_records_in_query("[PathAlias.ADB_Path]\members_offices_held","member_id=" + quote(ccmember_id) + ".and. office_abrev="+ quote("PCP"))>0,"Y","N")

    'VERIFY IF MEMBER IS AN ELECTED OFFICIAL
    Is_EO = if(a5_get_records_in_query("[PathAlias.ADB_Path]\members_offices_held","member_id=" + quote(ccmember_id) + ".and. office_abrev="+ quote("EO"))>0,"Y","N")

    'RESET QUERY TO CHECK FOR VOTING MEMBERS (CC & EXEC)
    query.filter="member_id=" + quote(ccmember_id)
    indx = tbl.query_create()

    if indx.records_get() > 0 then

    indx.find_first()
    'Open Central Committee Admin to create id matching members_master ..
    dim cctbl as p
    cctbl = table.open("[PathAlias.ADB_Path]\members_cc_master",FILE_RW_SHARED)

    'VERIFY THAT RECORD EXISTS
    if (exist(ccMember_id,cctbl.name_get(),"Mem_Id")) = .t. then
    dim Yes_CC_Vote as L
    dim Yes_EX_Vote as L

    Yes_EX_Vote = .f.
    Yes_CC_Vote = .f.

    'reorder Central Committee Admin by Member_id, get recno for newly created record
    indx_name = cctbl.index_primary_put("Mem_Id") 'put table in order based on new last_name (fieldname that was entered prior to search)
    cctbl.fetch_find(ccmember_id) ' goto current member_id record

    ' initialize update fields with default values
    Is_Cc_Member = "N"
    Is_Exec_Cmty_Member = "N"

    update.fields = 4
    update.field1 = "Votng_Cc_Mem"
    update.expr1 = "N"
    update.field2 = "Exec_Cmty_Member"
    update.expr2 = "N"
    update.field3 = "Pcp"
    update.expr3 = quote(Is_PCP)
    update.field4 = "Eo"
    update.expr4 = quote(Is_EO)


    while .not. (tbl.fetch_eof() .or. (Yes_EX_Vote = .t. .and. Yes_CC_Vote = .t.))


    tbl.fetch_next()

    end while
    '*******************************************************
    ' if OFFICE switches set to non-member, must check COMMITTEES for membership to ACRC
    if Is_Cc_Member = "N" .or. Is_Exec_Cmty_Member = "N"
    tbl.close() 'close cc_office file
    tbl = table.open("[PathAlias.ADB_Path]\members_cc_committees",FILE_RW_SHARED)

    'RESET QUERY TO CHECK FOR VOTING MEMBERS (CC & EXEC)
    indx = tbl.query_create()

    if indx.records_get() > 0 then

    indx.find_first()

    Yes_EX_Vote = .f.
    Yes_CC_Vote = .f.

    while .not. (tbl.fetch_eof() .or. (Yes_EX_Vote = .t. .and. Yes_CC_Vote = .t.))



    end while
    end if
    end if 'end of resetting OFFICE switches

    ' set query filter so only selected record updated
    query.filter="mem_id=" + quote(ccmember_id)
    indx = cctbl.query_create()

    update.expr1 = quote(Is_Cc_Member)
    update.expr2 = quote(Is_Exec_Cmty_Member)
    CCtbl.update()

    cctbl.close()
    query.order = ""
    query.filter = ""
    end if

    else
    ui_msg_box("Error","Record number is past end of table.",UI_STOP_SYMBOL)
    query.order = ""
    query.filter = ""
    end if

    tbl.close()

    end function
    Attached Files

    #2
    Re: 'e.rv' and 'e.rtc' variables with AfterRecord Events

    I doubt anyone's going to have time to go through all your code.

    Instead, follow this rule: Look at the prototype code that's provided in the event where you're coding, and follow the example.
    -Steve
    sigpic

    Comment


      #3
      Re: 'e.rv' and 'e.rtc' variables with AfterRecord Events

      There are so many 'e.' variables, it's hard to know which to use when.
      It is also very difficult to find information describing the differences, and which to use under what circumstances.

      Can anyone point me to a good reference that encompasses all this information in one place?
      Yes, the debugger. Put debug(1) in your code, working preview and examine the e object. Steve's suggestion is what I generally follow too.

      BTW: rv = request variable, rtc = runtime calc
      Peter
      AlphaBase Solutions, LLC

      [email protected]
      https://www.alphabasesolutions.com


      Comment


        #4
        Re: 'e.rv' and 'e.rtc' variables with AfterRecord Events

        I have done the debug(1) in Working Preview prior to posting, and everything works great.

        The code also "mostly" works in Live Preview.

        However, the UPDATE does not happen on the WEB, though it APPEARS to run through properly (ie, no error messages, the child grid is updated propertly, but not the parent grid that is linked).

        When should one use a Request Variable, and when should one use a Runtime Calc when they both appear to contain the same data?

        Comment

        Working...
        X