Hi
I'd like to add the 2nd action script on my xDialog scripts. When I add or change a xDilog field("vFieldCode") and not null value, the 2nd action script runs and displys the value for as designed in the "vCurField".
How do I insert the 2nd script? See Red color scripts at bottom.
I'd like to add the 2nd action script on my xDialog scripts. When I add or change a xDilog field("vFieldCode") and not null value, the 2nd action script runs and displys the value for as designed in the "vCurField".
How do I insert the 2nd script? See Red color scripts at bottom.
Code:
'Create an XDialog dialog box to prompt for parameters. DIM SHARED vProjectId as C DIM SHARED vFieldCode as C DIM SHARED vTrimCode as C DIM SHARED vCurField as N DIM SHARED vCurTrim as N DIM SHARED vConvertTrim as N DIM SHARED varC_result as C ok_button_label = "&OK" cancel_button_label = "&Cancel" DIM vProjectId_rl_def as C vProjectId_rl_def = "k=projects,{keylist_build(\"H=.05,1:20[Title]\",''+Project_id,left(''+Title,20))}{}" DIM vFieldCode_rl_def_orig as C vFieldCode_rl_def_orig = "k=material,{keylist_build(\"H=.05,1:10[Plan_Code],2:10[Name]\",''+Material_id,left(''+Plan_code,10),left(''+Name,10))}{Project_id = [varC->vProjectId]}" DIM vFieldCode_rl_def as C vFieldCode_rl_def = replace_parameters(vFieldCode_rl_def_orig,local_variables()) DIM vTrimCode_rl_def_orig as C vTrimCode_rl_def_orig = "k=material,{keylist_build(\"H=.05,1:10[Plan_Code],2:10[Name]\",''+Material_id,left(''+Plan_code,10),left(''+Name,10))}{Project_id = [varC->vProjectId]}" DIM vTrimCode_rl_def as C vTrimCode_rl_def = replace_parameters(vTrimCode_rl_def_orig,local_variables()) varC_result = ui_dlg_box("Criteria Box",<<%dlg% {region} Project:| [%@vProjectId_rl_def%.30vProjectId!vProjectId_changed]; Field:| [%@vFieldCode_rl_def%.20vFieldCode!vFieldCode_changed]; Trim:| [%@vTrimCode_rl_def%.20vTrimCode]; Current Field:| [%z%.20vCurField]; Current Trim:| [%z%.20vCurTrim]; Converted Trim:| [%z%.20vConvertTrim]; {endregion}; {line=1,0}; {region} <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL> {endregion}; %dlg%,<<%code% If a_dlg_button = "vProjectId_changed" then vFieldCode_rl_def = replace_parameters(vFieldCode_rl_def_orig,local_variables()) a_dlg_button = "" end if If a_dlg_button = "vProjectId_changed" then vTrimCode_rl_def = replace_parameters(vTrimCode_rl_def_orig,local_variables()) a_dlg_button = "" end if If a_dlg_button = "vFieldCode_changed" then vTrimCode_rl_def = replace_parameters(vTrimCode_rl_def_orig,local_variables()) a_dlg_button = "" end if [COLOR="Red"]If a_dlg_button = "vFieldCode_changed" .and. "vFieldCode" <> "" then a_dlg_button = "" 'vCurField = script_play(xdlg_get_qty_field) vCurField = tablesum("qty","material_id="+quote(vFieldCode)+" .and. Project_id="+quote(vProjectID),"area_qty") end if[/COLOR] %code%)
Comment