public cDir, cScript_Name, cTask_File, cTran_Ref, nFixes nFixes = 0 cScript_Name = "Failed Matrix Transaction Fix" * uncomment the following line and comment out the subsequent line to automate this script to the appropriate directory *cDir = "v:\vision\home\sample" cDir = GetDir("v:\vision\home") cd [&cDir] if not file("nm.dbc") messagebox("This is not a valid Noble Matrix for Vision directory."+chr(13)+cDir,0,"Not a Vision Database") return endif use MatTasks in 0 use Trans in 0 use Trade in 0 select MatTasks scan select MatTasks if TaskId = "ProcTran" and empty(enddate) and logdate > {^2008-06-01} cTask_File = alltrim(Parameters) if file("&cTask_File") use &cTask_File alias TaskFile in 0 select TaskFile recall locate for not empty(IntInvRef) if found() cTran_Ref = IntInvRef else cTran_Ref = "" endif * Close the TAble *browse Use if not empty(cTran_Ref) select trade locate for IntInvRef = cTran_Ref if not found() messagebox("There are no Trade lines for invoice: " + cTran_Ref,0,cScript_Name) select trans locate for internref = cTran_Ref and trantype = 7 if found() *browse delete *browse * Delete the trans entry * next blank out startdate and enddate in MatTasks endif select MatTasks *browse recall replace startdate with ctod("") replace starttime with 0 nFixes = nFixes + 1 *browse endif endif endif endif endscan *browse if nFixes > 0 messagebox("There were " + alltrim(str(nFixes)) + " transactions fixed",0,"Axsapt Matrix Fix Transactions") else messagebox("There were no transactions required to be fixed",0,"Axsapt Matrix Fix Transactions") endif