Ray, my 'lockup' problem has continued (intermittent but persistent) - "for quite a while now, intermittently we would have a user working in PO's, and be unable to make changes to a PO because Sesame said it was 'locked', but no one else would be in PO's at all. The only way to unlock the PO was to go exit the Sesame client on a computer in the warehouse that we use to 'receive' incoming inventory.
I've been methodically sifting through the haystack in search of the needle, and tonight I finally got to it, I believe. I think the culprit is the REPORT_MODE_PRINT_ONLY_PREVIEW command in the following code. If I run this command in a print button, the record becomes locked to other Sesame clients. If I instead use REPORT_MODE_HTML_PREVIEW, then no lockup occurs.
vPONum = PONum
vRS5 = @XResultSetSearch(@FN, "Purch!POLines", SEARCH_MODE_AND, SEARCH_SYNTAX_QA, "!PONum=" + vPONum) If vRS5 > -1 { //vTot = @XResultSetTotal(vRS5) XResultSetSort(vRS5, "PODate:-1;PONum:-1") vRpt = @XResultSetPrintReport("Purch-PONum-Specific", vRS5, REPORT_MODE_HTML_PREVIEW) // REPORT_MODE_PRINT_ONLY_PREVIEW) //REPORT_MODE_HTML_PREVIEW) } XResultSetClose(vRS5)
********** UPDATE: apparently REPORT_MODE_PRINT_ONLY also locks the record, not just PREVIEW.
I changed the above code to the following, thinking I would view in a browser (instead of 'print preview'), and still give the option to print to a printer if desired. But I'm back to being stymied for method to printer print without locking the record ...
vRS5 = @XResultSetSearch(@FN, "Purch!POLines", SEARCH_MODE_AND, SEARCH_SYNTAX_QA, "!PONum=" + vPONum) If vRS5 > -1 { //vTot = @XResultSetTotal(vRS5) XResultSetSort(vRS5, "PODate:-1;PONum:-1")
vQuestion1 = @PromptForUserInput("To view this report onscreen, enter 'V' and click <OK>; To print to the printer, enter 'P' and click <OK>","") If vQuestion1 = "V" { vRpt = @XResultSetPrintReport("Purch-PONum-Specific", vRS5, REPORT_MODE_HTML_PREVIEW) // REPORT_MODE_PRINT_ONLY_PREVIEW) //REPORT_MODE_HTML_PREVIEW) } else if vQuestion1 = "P" { If @UserID = "wcdede" { AlternateDefaultPrinter("wcLaserDeDe") vRpt = @XResultSetPrintReport("Purch-PONum-Specific", vRS5, REPORT_MODE_PRINT_ONLY) RestoreDefaultPrinter() } else if @UserID <> "wcdede" { vRpt = @XResultSetPrintReport("Purch-PONum-Specific", vRS5, REPORT_MODE_PRINT_ONLY) } } else if (vQuestion1 <> "V") and (vQuestion1 <> "P") { Writeln("You entered a " + vQuestion1 + ", which is an invalid choice.") vQuestion1 = "" } } XResultSetClose(vRS5)
********************** ********************** Update
tried printing from the report menu bar, instead of the command button. Whenever I printed that report, the record was locked to other users. However, if I selected/printed a different report with that same result set, then no lockup. So that pointed the finger at that specific report, not the command. So when I got to poking around the report, I found an 'on print' contingency that pulled a vendor address via XResultSetSearch, and I HAD OMITTED THE XRESULTSETCLOSE statement (idiot mio). So Ray was correct 100% in his suspicion. However, adding in the CLOSE stmt and updating didn't eliminate the issue - the record still locks up now, so I don't have a solution yet
|