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
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
Comment