Sage 100

 View Only
  • 1.  I have an old button script that reads from the AR

    Posted 05-21-2012 19:56
    I have an old button script that reads from the AR_CustomerMemo table for a customer and get all the memos and puts them into a UDF. This was a way that the client could see all of the customer memos at one time in a notes type field. In the old code, I used ODBC with a SELECT statement to read from the file. I specified an ""ORDER BY MemoDate DESC"" as they want the newer stuff to show up at the top. They just upgraded to 4.50, and I was trying to convert this over to a UDS so that the UDF field would be automatically populated. The problem I'm running into is, how do I do a descending date read from the file with a UDS? Any ideas? (P.S. Reading from the file, storing the keys, sorting the keys by descending date, and re-reading the records in sort order is the place I do not want to go to.)


  • 2.  RE: I have an old button script that reads from the AR

    Posted 05-21-2012 21:05
    Since that's not a keyed field your only solution is to continue your ODBC approach. At least it can be automatically populated now.


  • 3.  RE: I have an old button script that reads from the AR

    Posted 05-21-2012 23:35
    Due to your P.S. disclaimer, continue ODBC. If you're using MAS 200, since the UDS will execute on the server, just make sure you have a SOTAMAS90 DSN on the server itself (assuming DSN=SOTAMAS90 is what you used in the connection string).


  • 4.  RE: I have an old button script that reads from the AR

    Posted 05-22-2012 05:28
    I'm using this: Set objShell = CreateObject(""WScript.Shell"") RegLocate = ""HKEY_CURRENT_USER\SOFTWARE\ODBC\ODBC.INI\SOTAMAS90\"" objShell.RegWrite RegLocate & ""UID"",""usert"" objShell.RegWrite RegLocate & ""PWD"",""password"" objShell.RegWrite RegLocate & ""COMPANY"",oSession.CompanyCode Set objConn = CreateObject(""ADODB.Connection"") Set objRS = CreateObject(""ADODB.Recordset"") objConn.Open ""DSN=SOTAMAS90


  • 5.  RE: I have an old button script that reads from the AR

    Posted 05-22-2012 13:35
    Are you implying that you have it working in the UDS now?


  • 6.  RE: I have an old button script that reads from the AR

    Posted 05-22-2012 18:52
    Well, it's a hybrid. I am using the Post Read event on the AR_Customer, but I am reading from the AR_CustomerMemo file using the above ODBC connection because of the sort order issue. I then assign the value to the UDF via oBusObj.SetValue.


  • 7.  RE: I have an old button script that reads from the AR

    Posted 05-23-2012 03:49
    So I was able to get rid of the button at least, even though I couldn't do the whole script in UDS.