Hi All,
I ran this code, the auto-increment field is missing or skipping for the first line of my selection. Does any one know why?
I ran this code, the auto-increment field is missing or skipping for the first line of my selection. Does any one know why?
Code:
FUNCTION PrdAvl_Item_testDlg AS C (vSeriesId as c) 'vSeriesId = "0000001" 'for test dim vSelectAvl as c dim vAvlTreelist as c 'Clean vAvlTreelist = Sub_GetShapeList(vSeriesId) Delete XdialogStyle dim XDialogStyle as p XDialogStyle.AccentColor = "White" XDialogStyle.Color = "#205+237+253" varC_Avail = ui_dlg_box("Select the Product Shapes ",<<%dlg% {Windowstyle=Gradient Radial Bottom Middle} {can_exit=on_exit} {stickto=Left,top} {units=f} {font=tahoma,9} {lf}; {region}{font=Tahoma,9,b}{color=Dark Blue on White} Select the Shape to add:; {endregion}; {region}{font=Tahoma,9} [%S=BLR;D="^"%.80,25vSelectAvl^<$vAvlTreeList!vAvl_Changed]|{sp=2}|; ;; {endregion}; {lf}; {line=1}; {region}{justify=right}<Save!vSave?vSaveFlag><close>;{endregion}; %dlg%,<<%code% If a_dlg_button ="vAvl_Changed" then 'msgbox("test result",vSelectAvl) vSaveFlag = .t. a_dlg_button ="" end if If a_dlg_button ="close" then nCount = *count(vSelectAvl) If nCount>=1 then 'If alltrim(vDoneList)="" then ui_beep(UI_QUESTION_BEEP) vResp = ui_msg_box("Notice","Do you want to close without save?",UI_STOP_SYMBOL+UI_YES_NO) If vResp = ui_ok_selected then a_dlg_button="close" else a_dlg_button ="" end if end if end if %code%) If varC_Avail = "vSave" then vSelectAvl = eval("vSelectAvl") dim tAvl as p cShapeId="" xfoo ="" for each xfoo in vSelectAvl cShapeId = alltrim(xfoo.value) tAvl = table.open("prdctavail",FILE_RW_SHARED) query.filter ="" query.order ="series_id+shape_id" qry = tAvl.query_create("n","series_id="+quote(vSeriesId)+" .and. shape_id="+quote(cShapeId)) rcd = qry.records_get() If rcd = 0 then tAvl.enter_begin() tAvl.series_id = vSeriesId tAvl.shape_id = cShapeId tAvl.enter_end(.t.) end if qry.drop() tAvl.close() next end if end function
Comment