Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community

At 01 NOV 2004 12:20:33PM Lea Goodwin wrote:

I am just starting out with OpenInsight and am having an odd issue with an edittable. On Write of a record from the form, we are running a loop through the values in our edittable. If certain criteria exist, we update the database and change a value of one of the fields in the edittable. The process seems to be running fine and the @record values and temporary values change as needed, but when we are done and go back to the form, the edittable is not showing the change in that field and the field for the source table is not changed. Where could I find code that would change the field in the edittable before final save?

The following is the code we are using currently, but I am thinking we should have this code within our sub-routine (SAVE_FAD) so it catches any changes made to multiple lines.

* Declare Subroutine Forward_Event, Set_EventStatus, fsmsg, ConvFill_Record, convfill_ctl Declare Function Get_EventStatus, MSG, SET_PROPERTY savew=Set_Property(@WINDOW, "SAVEWARN", 1) x=set_property(@WINDOW,"@PREC",@RECORD) call SECURITY("") key1=.SSN-]text key2=.TERM-]text key =key1:'*':key2 orec=XLATE("STU_FAD_CHECKS",key,,'X') updstat=1 * make the current screen into @record RECORD=@RECORD CONVFILL_RECORD(@window,record,key) CONVFILL_CTL(@window,record,key) * @record=record currec=record call SAVE_FAD(@Window,orec,currec,updstat) @RECORD=CURREC RECORD=CURREC * RECORD IS SAME AS CURREC FROM PROCEDURE HERE…ALL VARIABLES MATCH as they should * DEBUG Z=CURREC *put in just to test value of record which was changed Y=@RECORD *put in just to test value of the specific field which was changed * TESTING *.DIS_PGM_TYPE.TYPE-]TEXT=@RECORD *Does not work * X=SET_PROPERTY(".DIS_PGM_TYPE","TEXT",Y) *Does not work if updstat=1 then .lastupdt-]text=DATE() .lastupid-]text=@USERNAME * .dis_type-]text=@record *was in original version that did not work * TESTING * ONLY WORKS ON LAST RECORD PROCESSED Need to put in loop on subroutine. * STU_FAD_CHECKS IS THE DATABASE TABLE NAME FOR THE VALUES BEING PULLED IN THE EDIT TABLE. DIS_TYPE IS THE NAME OF THE FIELD IN STU_FAD_CHECKS. * DIS_PGM_TYPE IS THE NAME OF THE EDITTABLE. TYPE IS THE NAME OF THE FIELD IN THE EDITTABLE *.DIS_PGM_TYPE.TYPE-]TEXT=@RECORD *Does not work * STU_FAD_CHECKS.DIS_TYPE=@RECORD *Does not work * X=XLATE("STU_FAD_CHECKS",key,,@RECORD) *Does not work Set_EventStatus(0) Forward_Event() status=Get_EventStatus(errcodes) if len(errcodes) then fsmsg(errcodes) end end else savew=Set_Property(@WINDOW, "SAVEWARN", 0) end return 0 </QUOTE> —- === At 02 NOV 2004 04:04AM dsig_at_sigafoos.org wrote: === <QUOTE>I would suggest a couple things .. 1) if you are going to use scripts AND a stored Procedure then just use the script as a launching point .. similar to a QE. This way ALL processing is handled in the commuter module and you don't have to worry about what is in the script. call commutermodule(ctrlEntId, EVENT, param1, param2, param3 … ) this way you can pass any of the needed parameters and know what is what based on the EVENT you are calling for 2) RECORD and @RECORD are really pretty funcky things during the window process. I would like to suggest that instead what you do is get the data from the table control and update as you need. THEN the forward_event will handle the writing of correct data. So .. * I tend to use list instead of array .. but either way lstTableData=get_property(@window:'.tablectl','LIST') * update lstTableData * update lstTableData set_property(@window:'.tablectl','LIST', lstTableData) at this point the screen will reflect correctly

* you only need this IF you are going to do processing POST read

* otherwise you may simply set the RETURN value to continue or not

FORWARD_EVENT()

* post process .. note the write has been done

* post process

dsig_at_sigafoos.org

DSigs Radio Free Oregon

Phone: 971-570-2005

View this thread on the forum...

  • third_party_content/community/commentary/forums_nonworks/899fca546c17613185256f3f0059c5f2.txt
  • Last modified: 2023/12/28 07:40
  • by 127.0.0.1