I have a grid that I use to insert new customers. When the user "submits" the grid, I use server side events get the primary key and insert records into multiple tables. I use the caninsertrecord event to determine the next job number. Then I use onAfterSQLCommandExecute to insert records into multiple tables based on the job_number created in the caninsertrecord. This all works great.
From their I want to use clent-side events to close the grid and open another one. The problem I have is getting the job number created in the server side to the client side. On the client side, I am using the event afterGridSubmit. The following java code works if I manually set the vars to the jobid I want to open.
How can I pass the jobid created in the caninsert to the client side so I can open the a5w page?
From their I want to use clent-side events to close the grid and open another one. The problem I have is getting the job number created in the server side to the client side. On the client side, I am using the event afterGridSubmit. The following java code works if I manually set the vars to the jobid I want to open.
Code:
if(e.hasErrors == false) { var rowNum = {Grid.Object}._selectedRow; window['jobid'] = {grid.object}._getValue('G','JOB_ID',rowNum); window['companyid'] = {grid.object}._getValue('G','COMPANY_ID',rowNum); window['lastname'] = {grid.object}._getValue('G','OWNER_LAST_NAME',rowNum); //alert(window['jobid']+' '+ window['companyId']+' - '+window['lastName']); {grid.object}.closeParentContainer(); var tbiObjTemp = getTabbedUI(); var jobId = ''; var companyId = ''; var lastName = ''; jobid = window['jobid']; companyid = window['companyid']; lastname = window['lastname']; var paneName = 'PANE_' + Date.parse(new Date().toString()); var paneTitle = ''+jobid+'-'+lastname+''; var url = 'Job_00_tabs_new.a5w?job_00_tab_argument_N_company_id='+companyid+'&job_00_tab_argument_N_job_id='+jobid+''; tbiObjTemp.add({title: paneTitle , name : paneName, type:'url', url: url }); }
Comment