<% file_reference=orequest.form('file_reference') if isnull(file_reference) file_reference=orequest.querystring('fref') endif record_number=orequest.form('record_number') if isnull(record_number) record_number=allt(transform(nvl(orequest.querystring('rref'),''))) endif new_enumber=orequest.form('new_enumber') if isnull(new_enumber) new_enumber=allt(transform(nvl(orequest.querystring('eno'),''))) endif file_reference=allt(transform(file_reference)) record_number=allt(transform(record_number)) new_enumber=allt(transform(new_enumber)) if not empty(new_enumber) and not new_enumber==[111] and not empty(record_number) tfilename=dbclocation+[details] tcmd=[update (']+tfilename+[') set enum=']+new_enumber+[', enumdt=date() where allt(reffid)==']+file_reference+[' and recno()==val(']+record_number+[') and empty(enum) ] *tfile=addbs(oprop.appstartpath)+[temp\new_enumber.err] *erase (tfile) *Strtofile(tcmd,tfile) &tcmd theresponse='{"status":"success","message":"enumber saved successfully","fref":"'+file_reference+'","rref":"'+record_number+'","eno":"'+new_enumber+'"}' tfile=addbs(oprop.appstartpath)+[temp\new_enumber.json] erase (tfile) Strtofile(theresponse,tfile) else theresponse='{"status":"error","message":"You must save the enumber yourself","fref":"'+file_reference+'","rref":"'+record_number+'","eno":"'+new_enumber+'"}' endif return theresponse %>