Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Thursday, June 19, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Architect Forums - SalesLogix Scripting & Customization
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: How to track changes to a database field (RecordChanges)
Ina Nortje
Posts: 57
 
How to track changes to a database field (RecordChanges)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Aug 07 7:09 AM
Good day,

My client wants tracking on a number of their database fields, which can normally be achieved quite easily using the RecordChanges property of the field in Architect. However, I have an interesting twist....

I have to put QA data on opportunity product lines. The way I did that was to add another right-click option to the Opportunity Product table, and to launch a form from there that contains the QA data. Now I need to track any changes made to these fields. Normally I can just select the "RecordChanges" property, and all would work wonderfully. However, in this case no history is recorded for these fields.

I thought the reason for my troubles may be because the data is in a custom table. The base table for the form is OPPORTUNITY_PRODUCT, and the database table in which the data is that I need to track is a one-to-one link with OPPORTUNITY_PRODUCT called C_OPPORTUNITY_PRODUCT_EXT. However, I was able to successfully track changes to data in a table called C_ACCOUNT_EXT which has a one-to-one link with the ACCOUNT table.

It does look like my form is a data form (however, I do not know how to check if it is a data form or manage form after the fact - I created it quite some time ago.)

Could it be that there is once again something sinister that we need to know about opportunity product, or am I missing something else?

Regards

Ina

[Reply][Quote]
Michael Rogers
Posts: 70
 
Re: How to track changes to a database field (RecordChanges)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Aug 07 8:55 AM
Ina, I can help you with the Data form vs Manage form: use the bound property of a control to look at the name of the bound table. If you click the button next to the Text property of a control and the table name is not blank, the form is either an Account, Contact, Opportunity, or Data form. Data vs Account, etc not as easy to tell, but this is a very quick test for manage forms.

Michael
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: How to track changes to a database field (RecordChanges)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 06 Aug 07 9:16 AM
On many forms, and many fields, clicking True to RecordChanges on an SLX control won't generate a History record. And for userID fields, it's formatted incorrectly (Display's the ID, not the User Name, so it's not readable by humans.....

We provide a shadow control that stores the initial value of the data field when the form is 'OnChange'......then compare the value in the field to the shadow value at Validate time and write our own history record, TYPE = 262156, for many of these controls.....especially on custom tables and one:many:many tables that SLX doesn't always record changes on.

We also write to a custom Sarbanes-Oxley kind of table that includes the Reason for the change, etc. (use the same table for Delete Requests)......

RJ Samp
[Reply][Quote]
Ina Nortje
Posts: 57
 
Re: How to track changes to a database field (RecordChanges)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Aug 07 9:29 AM
Hi Michael,

Thanks - this is quite handy to know.

Regards

Ina
[Reply][Quote]
Ina Nortje
Posts: 57
 
Re: How to track changes to a database field (RecordChanges)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Aug 07 9:31 AM
Hi RJ,

Any possibility you can post the code you use so I don't have to re-create it?

Thanks

Ina
[Reply][Quote]
Don Farber
Posts: 12
 
Re: How to track changes to a database field (RecordChanges)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Aug 07 9:53 AM
Hello, Ina:

Another option you can explore is to use Sage KnowledgeSync to track changes to the field's value. With KnowledgeSync, you can track changes to any field in the SLX database, trigger alerts that contain both the old and new field values, and trigger the creation of history records that track these changes. This does not require any programming. Let me know if you want any more details.

Don Farber
[Reply][Quote]
Ina Nortje
Posts: 57
 
Re: How to track changes to a database field (RecordChanges)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 07 Aug 07 10:12 AM
Hi Don,

Thanks a lot. I have worked wiht KnowledgeSync before and I must admit it is quite nice, but the client is on a budget and we did not sell them KnowledgeSync.

Looks like I will just have to spend a bit of time coding this. If I do, I will post the code for future reference.

Thanks

Ina
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: How to track changes to a database field (RecordChanges)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 08 Aug 07 8:43 AM
Don't have it handy.....here's a simple store of a history record:


FUNCTION Insert_HISTORY_Rec()
DIM whateveryourconnectionis
whateveryourconnectionis = application.GetNewConnection
IF anhType = "" THEN anhTYPE = "262148" ''''NOTE
IF anhCategory = "" THEN anhCategory = "Note"
IF anhPriority = "" THEN anhPriority = "Medium"
IF anhDescription ="" THEN anhDescription = "Note History"
IF anhUSERID = "" THEN anhUSERID = application.basicfunctions.CurrentUserID
IF anhResult = "" THEN anhResult = "Completed"
IF anhResultCode = "" THEN anhResultCode = "C"

IF anhDateTime = "" THEN anhDateTime = NOW()
anhSQL = "SELECT * FROM HISTORY WHERE 2 = 1 "
rsANH.Open anhSQL, whateveryourconnectionis
WITH rsANH
IF .EOF THEN
.ADDNEW
G_intUpdateFields = G_intUpdateFields + 1

anhHISTORYID = application.basicfunctions.GetIDFor("HISTORY")
.Fields("HISTORYID").VALUE = anhHISTORYID
.Fields("ACTIVITYID").VALUE = anhHISTORYID
.Fields("TYPE").VALUE = anhTYPE
.Fields("CATEGORY").VALUE = anhCategory
.Fields("DESCRIPTION").VALUE = anhDescription
.Fields("RESULT").VALUE = anhResult
.Fields("RESULTCODE").VALUE = anhResultCode
.Fields("DURATION").VALUE = anhDuration

.Fields("ACCOUNTID").VALUE = g_strACCOUNTID
.Fields("ACCOUNTNAME").VALUE = strACCOUNTNAME
.Fields("CONTACTID").VALUE = g_strCONTACTID
.Fields("CONTACTNAME").VALUE = strCONTACTNAME
.Fields("OPPORTUNITYID").VALUE = g_strOPPORTUNITYID
.Fields("OPPORTUNITYNAME").VALUE = strOPPORTUNITYNAME
.Fields("USERID").VALUE = anhUSERID
.Fields("USERNAME").VALUE = anhUSERNAME

.Fields("ATTACHMENT").VALUE = "F"
.Fields("PRIORITY").VALUE = "Medium"
.Fields("RECURRING").VALUE = "F"
.Fields("TIMELESS").VALUE = "F"

.Fields("PROCESSID").VALUE = anhProcessID
.Fields("PROCESSNODE").VALUE = anhProcessNode

.Fields("COMPLETEDUSER").VALUE = anhUSERID
.Fields("COMPLETEDDATE").VALUE = NOW()
.Fields("ORIGINALDATE").VALUE = NOW()
.Fields("STARTDATE").VALUE = NOW()

.Fields("NOTES").VALUE = TRIM(LEFT(anhNOTES,255))
.Fields("LONGNOTES").VALUE = anhNOTES
END IF
END WITH
'Store ModifyUSer, CreateUser, ModifyDate, CreateDate HERE!!!

rsANH.UPDATE
rsANH.CLOSE
cnANH.close
set cnANH = nothing
END FUNCTION
[Reply][Quote]
Bob (RJ)Ledger
Posts: 1103
Top 10 forum poster: 1103 posts
 
Re: How to track changes to a database field (RecordChanges)Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 09 Aug 07 6:33 AM
Quote:
Originally posted by Ina Nortje

....
Looks like I will just have to spend a bit of time coding this. If I do, I will post the code for future reference.

Thanks

Ina


It sometimes is difficult as to which direction to go sometimes:
A- Build it all yourself
B - Purchase a "framework" and add your value.

I tend to favor the "B" approach because:
1 - It saves a lot of time
2 - provides more value to the client (which generates more business!)

I'd use TaskCentre and plugin the code RJSamp posted. If you take a hard look at it you will find it saves the client money.
--
rjl
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 6/19/2025 4:49:18 PM