Shows the modifications necessary to check that Part costs are current with Version 4.5 and higher which has made the code in the earlier How To for this subject obsolete. ( Cyrious has added a field which records the Last Modified Date as a part of the Part Table; so a separate UDF as we had in the earlier “How To” is no longer necessary.)

Look in the Parts record and find the last time the Part was modified. Assume that for an established part, modifications are for price changes. Note that the weakness of this approach is that any modification of the part will update this field – e.g. the description.

See note above that the Part may be modified for a reason other than a price change and this would reset the LastModifiedDate. So it is possible that a price has not been updated even though the LastModifiedDate is a recent date.

  1. You may create a variable to check on the Part status or insert the code directly into a Products Warning or Error Message pages. Additionally, you may use a Text field with a formula on the Pricing Form to display the last modified date of a Part or create a Variable for this information. Finally, you need to set the interval you wish to monitor – e.g. 60 days. For ease of further editing, we suggest creating a User Constant such as DayLastModified so that you can change the period you are monitoring with only one edit even though you may have the message in numerous pricing forms.
  2. Create the code to grab the Last Modified Date of the Part. From Version 4.5 you use the same code to access the Part by Variable Name or Part Name and append - .Part.LastModifiedDate, as shown below. [Note that Cyrious has 2 date fields in the Part record. The field “ModifiedDate” contains the date the Part was created or so we surmise. The field LastModifiedDate contains the date of the last change to the Part.] We use lists containing the same variable to draw most of our Parts; so we access the Part information with the PartByVariableName code. You may also use PartByPartName. In the box below we show the code including the User Constant set up with the interval days
Declare PartPriceModifiedInterval := Date() - DayLastModified;
//Substracts Days from Current Date to get Last Modified Date - Interval
// in User Constants/Parts
IF ISASSIGNED(PartByVariableName("SubstrateThickness")) THEN
IF (PartByVariableName("SubstrateThickness").Part.LastModifiedDate)
   > PartPriceModifiedInterval then "" Else
"The Part " + CHAR(13) + PartByVariableName("SubstrateThickness").PartCode +
CHAR(13)+ " has not been updated since " + CHAR(13) +
 + DISPLAYDATE(PartByVariableName("SubstrateThickness").Part.LastModifiedDate)
+ CHAR(13) + "It is recommended that you" + CHAR(13) +
"check the price."
Endif Else "" Endif
  1. Additional explanation of the code:
    1. The User Constant DayLastModified contains a number - in this case 60. The Declare statement will return a date 60 days prior to the current date.
    2. The Char(13) function inserts a hard return or line space in the message so that you do not have a continuous line.
    3. This code is inserted into a text variable which we then add to the Product Warning Page of the Products where we want to alert users they may be using outdated pricing. We use this warning in more than 10 products and with the convention of the User Constant and the Variable can change the triggers and the message in only 2 places to take effect in all products.

Contributor: Steve Gillispie, Acorn Sign Graphics

Date: 7/26/2010

Version: Control 4.5_

You could leave a comment if you were logged in.