Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
0 Kudos

LAN Record Changes update....

Status: New
by Silver Contributor on ‎06-04-2013 06:34 AM
Still suffering from recording the changes in the ID values instead of the ID and Text for a lookup.....the RecordChanges property of a control should have a corresponding event handler that fires a) if the recordchanges property has been checked, and b) the data has changed from when it was read at databinding to now when it is being Saved. Not when it's cancelled and not saved.....and not when the user changes their mind 5 times prior to saving the database..... the event handler could even work on one to one tables that are off of the base table......when RecordChanges doesn't do a consistent job of (if at all). Really ugly stuff in the Journal Audit Trail for Ticket History....... I'm using a format of TextHumanValue: ID Value for writing the NewValue. So: "RJSAMP Wheaton IL: A2EK3456WX12" ''' RJ Samp June 3, 2013. ''' Alt: CreateTicketHistoryRecord ''' Alt: CreateJournalRecord ''' If you absolutely know there is going to be a change and it will be committed to a database: ''' Call [Master Ticket Support].CreateAuditTrailRecord (ByVal svField, ByVal svValue) ' DIM UNAME ' UNAME = "" & GetField("USERNAME", "USERINFO", "USERID = '" & lueApprovedBy.Text & "' " ) ' Call CreateAuditTrailRecord (txtTicketID.Text, "Approved By", UNAME & ": " & lueApprovedBy.Text ) ''' ''' If you are going to do this on the Ticket Detail..... ''' 1) capture the existing field value in a global on the AXSupportFormChange event handler. ''' 2) in the AXFormPost: ''' if gstrMasterNo <> txtMasterTicketNo.Text Then ''' Call [Master Ticket Support].CreateAuditTrailRecord (ByVal svField, ByVal svValue) ''' Call CreateAuditTrailRecord (txtTheTicketID.Text, "Master Ticket Number", txtMasterTicketNo.Text ) ''' Sub CreateAuditTrailRecord (ByVal strTicketId, ByVal svField, ByVal svValue) Dim objSLXDB, objRS, SQL Dim OldValue '' ADO Connection and Recordset instanciated. Set objSLXDB = New SLX_DB Set objRS = objSLXDB.GetNewRecordSet '' Get the old value for the same field [if available] in an ADO Recordset using SQL. SQL = " SELECT TOP 1 ISNULL(NEWVALUE,'') as TheNewValue " & _ " FROM TICKETHISTORY " & _ " WHERE TICKETID = '" & strTicketId & "' AND FIELDNAME = '" & svField & "' " & _ " ORDER BY MODIFYDATE DESC " ''' important, Last In Still Here: LISH. objRS.Open SQL, objSLXDB.Connection 'DNL OldValue = "" '' default value. If objRS.EOF Then Else OldValue = objRS.Fields(0).Value & "" End If '' create\insert the new Ticket History record. With objRS If .State = 1 Then .Close ''' AutoIncrement not always set to true for this abnormally named Primary Keyfield [TICKETHISID] table. .Open "SELECT * FROM TICKETHISTORY WHERE 1=2", objSLXDB.Connection 'DNL .AddNew .Fields("TICKETHISID").Value = Application.BasicFunctions.GetIDFor("TICKETHISTORY") 'DNL .Fields("TICKETID").Value = "" & strTicketID 'DNL .Fields("FIELDNAME").Value = svField 'DNL .Fields("NEWVALUE").Value = svValue 'DNL .Fields("OLDVALUE").Value = OldValue .Update .Close End With Set objRS = Nothing Set objSLXDB = Nothing End Sub

We want to hear your cool ideas for enhancing Saleslogix products and services. So add your own ideas or kudo (vote) on the ideas of others here! Watch the most valuable bubble to the top!

I have an idea! How do I get started?

One
Read our submission guidelines.

Two
Search for your idea. If you don't see it, submit a new one!

Three
Provide feedback on the ideas of others by voting with kudos and adding comments.
For more information about using ideas, read this thread.

Four
Track your ideas and those you like. Once you've posted or kudoed and idea, subscribe to be notified via email of the latest updates to the idea. From within the idea, click "Idea Options" which appears above the idea title and choose, "Subscribe to this idea".

Be sure to check back from time to time to see new ideas and status updates!

Here is a quick list of the recent ideas for speedy browsing!
Labels