Describes UDFs, describes some uses for them, and then provides a simplistic guide to setting them up and accessing them.
UDF stands for User Defined Field. This is a piece of code the user can add to Cyrious to capture information not available in CFL. With UDFs you can do things like capture information about a Customer providing guidelines about product parameters. For example, a UDF to flag that a customer requires “Blind Shipments” can be integrated with a shipping product and even have the product look to a customer UDF to determine the preferred carrier and the ship code to be billed to that customer. Other uses might be to flag certain conditions for Work Orders and Estimates which control they way Crystal prints a work order or what is on it. For example, we have a section at the top of our work orders which shows initials of all the production centers required to complete the order which is done by setting Transaction UDFs to True when certain products are selected – routing, engraving, printing, etc. This is also used to provide schedules for each of those centers. The more you understand UDFs, in fact, the more applications you find for them.
For transaction UDF's, these must be set in the advanced tab of the Product Pricing page. Open the Advanced Tab and, depending on whether you want the macro executed in an Order or Estimate, select either “Order/Recurring Order Save Formulas” or “Estimate Save Formulas”. In each of those tabs you can select where to put the CFL to set the UDF, depending on when you want them set. Below is an example of Code set in the Order/Recurring Order Save Formulas/On Order Edit page. For these settings, you can create a list of conditions each ended with a semi-colon (;) and CFL will execute them all. Note that for settings dependent on selections within the “Product”, we have found it a good idea to create code to reverse the UDF setting if the transaction is altered with later edits. In other words for the example below, the UDF will always be set if the product has been selected. The“ Check PMS Colors” UDF will be set only if those selections are made on the Pricing Form. To unset the “Has Digital Printing” UDF, we set the UDF to False in the “On Line Item Deleted” CFL page. Be sure to test all code carefully. If the UDF name in these formulas does not match exactly, the formula will not work. Even a space will prevent CFL from finding the UDF –E.G. in the example below SetTransactionUDF(“ Check PMS Colors”) will fail because of the space between the quotation marks and the “C”.
SetTransactionUDF(“Has Digital Printing”, TRUE);
CASE IS
DTS_CheckPMSColors THEN SetTransactionUDF("Check PMS Colors",TRUE)
DTS_ColorsToMatch "" THEN SetTransactionUDF("Check PMS Colors",TRUE)
DTS_NumberOfColorsToMatch 0 THEN SetTransactionUDF("Check PMS Colors",TRUE)
ELSE SETTRANSACTIONUDF(“Check PMS Colors”,FALSE)
ENDCASE
Below is a screen shot showing the UDF Setup Page with a new Transaction UDF being created: Note the checkboxes providing options for where you want this UDF to be available – For Orders, Estimates, etc. Other extremely useful options allow you to clear the UDF when cloned or when an Estimate is converted to an Order.
Transaction UDFs: TransactionUDF(“Architects”)
PartUDF(“Height”)
CustomerUDF(“Blind Ship”)
The following are some examples which are in the Formula Builder.
COMPANYUDF(
CONTACTUDF(
COURSEUDF(
DECREMENTCOMPANYUDF(
DECREMENTCONTACTUDF(
DECREMENTTRANSACTIONUDF(
INCREMENTCOMPANYUDF(
INCREMENTCONTACTUDF(
INCREMENTTRANSACTIONUDF(
PRODUCTUDF(
SETCOMPANYUDF(
SETCONTACTUDF(
SETTRANSACTIONUDF(
TRANSACTIONUDF(
Used in Yes/No Variable:
COMPANYUDF( “Always Use Customer Shipper”,0)
Used in Text Variable
COMPANYUDF( “CO CARRIER CODE”,“”)
Used in Text Variable
COMPANYUDF( “CO Shipper”,“”)
### Other UDFs have changed.
### A line item is added.
### The Transaction's customer has changed.
### Cloning an Order or an Estimate.
### A status change occurs.
### A payment is applied.
### Declare X := TransactionUDFObject(“Shipment Date”);
### X.OrderNumber;
Contributor: Steve Gillispie, Acorn Sign Graphics
Date: 02/05/2010
Version: Control 4.3