{$page}

CFL is a language used for pricing calculations. As such, CFL is commonly used when working on an order - specifically, for calculating (or recalculating) a line item within that order. Using CFL, it is possible to reach into other parts of the order, customer, contact, and employee and pull information that may need to be used or displayed. Property references are used for these purposes. Here are several formulas used to call property references:

code_formatpascal

Example 1: Declare SignatureLine : “Thanks Again, {p}” + TransHeader.Salesperson1.FullName ; Declare ToLine : Contact.FullName ; IF TransDetail.ShippingAddressOverridden THEN “Special Shipping for this Line” ELSE “Bundle with Order” ENDIF ; Example 2:

IF ShipByUPS Then

    if Transheader.SalesStation.Text  "Shipped"
    THEN "Shipping Disposition does not match this selection" ENDIF

ENDIF

code

Cyrious applications use objects to model the real world. What this means is that the programs create an “Order Object” for the order, an “Account Object” for the customer, a “Contact Object” for the customer contact, and so forth. From within CFL, it is possible to access the information about a customer by referencing properties of the account object. This is what is meant by “property references”. They are powerful tools that give the user unprecedented access to information surrounding an order. For example. “text” is a property name which can be used with objects to retrieve values as in Transheader.SalesStation.text which returns the Station at Sale setting for an Order (See Coded example above).

Usage

The objects available by directly referencing them in the CFL are:

Other indirect or supporting object references (such as employees, addresses, and phone numbers) are only available from within one of the direct objects. That is, a phone number cannot be referenced without first giving a direct reference to the object whose phone number is needed. There is more information about these supporting object references in the next section.

Common Property References

These properties are available on all objects in CFL:

~ Object.Field.Name ~ Data Type ~ Description
IDAsString String (read/only) Returns the objects database ID.
ClassTypeAsString String (read/only) Returns the objects ClassTypeID.

Company Property References
||~ Object.Field.Name ||~ Data Type ||~ Description ||

Company.AccountingContactFullName String
Company.AccountNumber Number
Company.BillingAddressLink Address
Company.CompanyName String
Company.Contacts Contact Collection
Company.CreditApprovalDate Date
Company.CreditBalance Number
Company.CreditLimit Number
Company.CreditNumber String
Company.CustomerNumber Number
Company.DateCreated DateTime
Company.DateImported DateTime
Company.Department String
Company.DiscountLevel Number
Company.Flags String
Company.HasCreditAccount Boolean
Company.HasParentCompany Boolean
Company.HasServiceContract Boolean
Company.ImportBatch String
Company.IndustryName String
Company.IsContractExpired Boolean
Company.IsProspect Boolean
Company.IsTaxExempt Boolean
Company.Keywords String
Company.MainFaxNumber Phone
Company.MainPhoneNumber Phone
Company.Marketing3Name String
Company.OriginName String
Company.ParentCompanyName String
Company.PaymentTermsName String
Company.PONumber String
Company.PONumberRequired Boolean
Company.PricingLevel Number
Company.PricingLevelName String
Company.PricingPlanTypeName String
Company.PrimaryContactFullName String
Company.PrimaryFormattedNumber String
Company.PrimaryNumber Phone
Company.PrimaryNumberTypeText String
Company.PromotionName String
Company.RegionName String
Company.SecondaryFormattedNumber String
Company.SecondaryNumber Phone
Company.SecondaryNumberTypeText String
Company.ServiceContractExpDate Date
Company.ServiceContractNotes String
Company.ServiceContractStartDate Date
Company.ShippingAddressLink Address
Company.TaxClassName String
Company.TaxExemptExpDate Date
Company.TaxNumber String
Company.TaxNumberExpDate Date
Company.UseTaxClassLookup Boolean
Company.WebAddress String

Contact Property References
|| Object.FieldName || Data Type || Description ||

Contact.BillingAddressLink Address
Contact.BirthDate Date
Contact.BirthDateDay Number
Contact.BirthDateMonth Number
Contact.CCBillingAddress String
Contact.DefaultMaskedTrackingNumber String
Contact.DefaultPaymentAccountName String
Contact.DefaultPaymentAccountTenderType TenderType
Contact.DefaultPaymentExpDate Date
Contact.DefaultPaymentNameOnCard String
Contact.DefaultPaymentTrackingNumber String
Contact.DefaultPaymentVCode String
Contact.EmailAddress String
Contact.FirstName String
Contact.FullName String
Contact.IsAccountingContact Boolean
Contact.IsPrimaryContact Boolean
Contact.LastName String
Contact.MainFaxNumber Phone
Contact.MainPhoneNumber Phone
Contact.PhoneNumbers Phone Collection
Contact.Position String
Contact.PrimaryFormattedNumber String
Contact.PrimaryNumber Phone
Contact.PrimaryNumberTypeText String
Contact.ProperName String
Contact.SecondaryFormattedNumber String
Contact.SecondaryNumber Phone
Contact.SecondaryNumberTypeText String
Contact.ShippingAddressLink Address

Order/Estimate Heading Property References
|| Object.FieldName || Data Type || Description ||

TransHeader.Account Account
TransHeader.ActiveVariation TransVariation
TransHeader.BalanceDue Number
TransHeader.BasePrice Number
TransHeader.BasePriceStr String
TransHeader.BuiltDate DateTime
TransHeader.ClosedDate DateTime
TransHeader.Contact Contact
TransHeader.ContactName String
TransHeader.ConvertedDate DateTime
TransHeader.CostSet CostSet
TransHeader.CreditMemoAmount Number
TransHeader.CreditMemoOrder CustTransHeader
TransHeader.Customer Customer
TransHeader.CustomerContractType String
TransHeader.CustomerName String
TransHeader.Depth Number
TransHeader.Description String
TransHeader.DiscountLevel Number
TransHeader.DiscountLevelOverridden Boolean
TransHeader.DiscountPrice Number
TransHeader.DiscountPriceStr String
TransHeader.Disposition Disposition
TransHeader.DivisionIDOverridden Boolean
TransHeader.DueDate DateTime
TransHeader.EnteredBy Employee
TransHeader.EstimateCreatedDate DateTime
TransHeader.EstimateGreeting String
TransHeader.EstimateGreetingTemplate String
TransHeader.EstimateNumber Number
TransHeader.FinanceChargeAmount Number
TransHeader.HTMLLongFormat String
TransHeader.HTMLShortFormat String
TransHeader.InternalNotes String
TransHeader.InternalNotesTemplate String
TransHeader.InvoiceAddressLink Address
TransHeader.InvoiceAddressOverridden Boolean
TransHeader.InvoiceContact Contact
TransHeader.InvoiceNumber Number
TransHeader.InvoiceToText String
TransHeader.IsFirmDueDate Boolean
TransHeader.IsTaxExempt Boolean
TransHeader.LastFinanceChargeDate DateTime
TransHeader.LostDate DateTime
TransHeader.ManuallyReOpened Boolean
TransHeader.ModifierPrice Number
TransHeader.ModifierPriceStr String
TransHeader.NextRefNumber Number
TransHeader.OrderCreatedDate DateTime
TransHeader.OrderNotes String
TransHeader.OrderNotesTemplate String
TransHeader.OrderNumber Number
TransHeader.OrderOriginName String
TransHeader.ParentHeaderCreated Boolean
TransHeader.PartGLList PartGLEntry Collection
TransHeader.PaymentTerms PaymentTerms
TransHeader.PaymentTermsName String
TransHeader.PaymentTotal Number
TransHeader.PONumber String
TransHeader.PriceSet PriceSet
TransHeader.PricingLevel Number
TransHeader.PricingLevelName String
TransHeader.PricingLevelOverridden Boolean
TransHeader.PricingLevelPlan PricingLevel
TransHeader.Promotion Promotion
TransHeader.PromotionName String
TransHeader.ProofDate DateTime
TransHeader.SaleDate DateTime
TransHeader.SalesDisposition Disposition
TransHeader.SalesPerson1 Employee
TransHeader.SalesPerson2 Employee
TransHeader.SalesPerson3 Employee
TransHeader.ServiceTicketNumber Number
TransHeader.ShippingCount Number This field indicates how many Shipments are on the order.
TransHeader.ShippingItems[x] Array of ShippingItem This field provides access to the individual shipments on an order.
TransHeader.ShippingAddressLink Address
TransHeader.ShippingAddressOverridden Boolean
TransHeader.ShippingCompanyOverridden Boolean
TransHeader.ShippingContactOverridden Boolean
TransHeader.ShipToText String
TransHeader.ShippingTrackingNumbers String This pulls all the tracking numbers for all the shipment items into one comma delimited string.
TransHeader.ShowFlag Boolean
TransHeader.StatusFlagShown Boolean
TransHeader.StatusID TransStatus
TransHeader.StatusName String
TransHeader.SubTotalPrice Number
TransHeader.SubTotalPriceStr String
TransHeader.TaxClass TaxClass
TransHeader.TaxClassName String
TransHeader.TaxClassOverridden Boolean
TransHeader.TaxNumber String
TransHeader.TemplateNumber Number
TransHeader.TransactionType TransactionType
TransHeader.UseTaxClassLookup Boolean
TransHeader.Version Number
TransHeader.VoidedDate DateTime
TransHeader.WriteOffAmount Number

Order/Estimate Line Item Property References
|| Object.FieldName || Data Type || Description ||

TransDetail.Account Account
TransDetail.BasePrice Number
TransDetail.BasePriceStr String
TransDetail.ChildItems TransDetail Collection
TransDetail.CostSet CostSet
TransDetail.Depth Number
TransDetail.Description String
TransDetail.DetailImage Graphic
TransDetail.DiscountLevel Number
TransDetail.DiscountLevelOverridden Boolean
TransDetail.DiscountPrice Number
TransDetail.DiscountPriceStr String
TransDetail.GoodsItem GoodsItem
TransDetail.GoodsItemCode String
TransDetail.HasWorkAssignment Boolean
TransDetail.HTMLLongFormat String
TransDetail.HTMLShortFormat String
TransDetail.InternalNotes String
TransDetail.IsComplete Boolean
TransDetail.LineItemIndex Number
TransDetail.LineItemNumber String
TransDetail.LongImage Graphic
TransDetail.ModifierCode String
TransDetail.ModifierCostSet CostSet
TransDetail.ModifierPrice Number
TransDetail.ModifierPriceStr String
TransDetail.Modifiers TransMod Collection
TransDetail.Parameters TransDetailParam Collection
TransDetail.ParentHeaderCreated Boolean
TransDetail.PriceSet PriceSet
TransDetail.PricingLevel Number
TransDetail.PricingLevelOverridden Boolean
TransDetail.PriorityName String
TransDetail.ProductCode String
TransDetail.ProductNameOnEstimate String
TransDetail.Quantity Number
TransDetail.SaleAccountName String
TransDetail.SaleAccountOverridden Boolean
TransDetail.ServiceTicketItemNumber Number
TransDetail.ShippingAddressLink Address
TransDetail.ShippingAddressOverridden Boolean
TransDetail.ShippingCompanyOverridden Boolean
TransDetail.ShippingContactOverridden Boolean
TransDetail.ShipToText String
TransDetail.ShowFlag Boolean
TransDetail.Stage Stage
TransDetail.StageName String
TransDetail.StatusFlagShown Boolean
TransDetail.SubTotalPrice Number
TransDetail.SubTotalPriceStr String
TransDetail.TaxClass TaxClass
TransDetail.TaxClassName String
TransDetail.TaxClassOverridden Boolean
TransDetail.TicketTypeName String
TransDetail.TransactionType TransactionType
TransDetail.TransHeaderNumber Number
TransDetail.UnitPriceVariableName String
TransDetail.UnitPriceVariableValue Number
TransDetail.UseTaxClassLookup Boolean
Sonssubtotalprice Number Returns the total of all child items

Part Property References
|| || Part Property To Capture || CFL CODE || || || ||

Part Category Parts[x].Part.PartCategoryName string
Part Name Parts[x] string
Price Parts[x].SuggestedPrice number
Cost (Price Before Multiplier) Parts[x].EstimatedCost number
Quantity (Estimated Usage) Parts[x].EstimatedQuantity number
Part Unit Cost Parts[x].Part.InventoryUnitCost
Multiplier Parts[x].Part.CostMultiplier Returns a string of the contents of the multiplier field of the part–
E.g. if a formula, returns the formula and not the results
Actual Multiplier (Returns %) (1-(Parts[counter].part.inventoryunitcost)/
(Parts[counter].SuggestedPrice/Parts[counter].EstimatedQuantity))*100

Product Property References
|| Object.FieldName || Data Type || Description ||

Product.BarCode String
Product.CustNotes String Returns the Customer (Invoice) Notes from the product
Product.Description String
Product.ExcludeFromPromotions Boolean
Product.Flags String
Product.HelpText String
Product.Image Graphic
Product.InternalNotes String
Product.IsChildByDefault Boolean
Product.IsTaxExempt Boolean
Product.ItemName String
Product.NameOnEstimate String
Product.PricingPlans PricingPlanCollection
Product.PrintAs String
Product.ProductCode String
Product.ProductionTime Number
Product.ReCalcTransHeader Boolean
Product.TaxabilityCodeName String
Product.Variables Variables Collection

Modifier Property References
These references are only valid for CFL being evaluated inside of pricing for a modifier.
|| Object.FieldName || Data Type || Description ||

Modifier.BarCode String
Modifier.DefaultEntryOption ModEntryOption
Modifier.DefaultLimitToList Boolean
Modifier.DefaultPart2ConsumptionFormula String
Modifier.DefaultPartConsumptionFormula String
Modifier.DefaultSelectionListID IDRecord
Modifier.Description String
Modifier.ModifierCode String
Modifier.PrintAs String
Modifier.Question String
Modifier.SaveTransRecord Boolean
Modifier.SortOrder Integer

Pricing Plan Property References
These references are only valid for CFL being evaluated inside of pricing for a modifier.
|| Object.FieldName || Data Type || Description ||

PricingPlan.GLDepartmentName String
PricingPlan.InvoiceTemplateName String
PricingPlan.Notes String
PricingPlan.PricingPlanTypeName String
PricingPlan.ScreenTemplateName String
PricingPlan.UnitPriceVariableName String
PricingPlan.UnitPriceVariableUnitText String
PricingPlan.WorkOrderTemplateName String
PricingPlan.IncomeAccountName String
PricingPlan.FamilyName String

Supporting Object References
Supporting object references are only available from within one of the direct objects. That is, a phone number cannot be referenced without first giving a Direct Reference to the object whose phone number is needed.
In the following property references, the user would replace the object name (like “Address”) with the appropriate direct reference, as in the example below:
code
Do not use Address.FormattedAddress ,
Instead, use TransHeader.ShippingAddressLink.FormattedAddress
code
Address Property References
|| Object.FieldName || Data Type || Description ||

Address.City String
Address.Country String
Address.County String
Address.CSZ String
Address.FormattedAddress String
Address.PostalCode String
Address.State String
Address.StreetAddress1 String
Address.StreetAddress2 String
Address.TaxClassName String

Address Link Property References
|| Object.FieldName || Data Type || Description ||

AddressLink.AddressTypeName String
Address.AddressName (future) String

Phone Number Property References
|| Object.FieldName || Data Type || Description ||

Phone.AreaCode String
Phone.CountryCode String
Phone.DefaultAreaCode String
Phone.DefaultCountryCode String
Phone.Extension String
Phone.FormattedNumber String
Phone.PhoneNumber String
Phone.PhoneNumberIndex Number
Phone.PhoneNumberTypeText String
Phone.RawNumber String

Employee Property References
|| Object.FieldName || Data Type || Description ||

Employee.Birthdate Date
Employee.City String
Employee.Country String
Employee.County String
Employee.Department String
Employee.DiscountLevel Number
Employee.EmailAddress String
Employee.EmergencyContacts Contact Collection
Employee.EmployeeStatus EmployeeStatus
Employee.FirstName String
Employee.FullName String
Employee.Group EmployeeGroup
Employee.GroupName String
Employee.HireDate Date
Employee.IsClockedIn Boolean
Employee.IsLoggedIn Boolean
Employee.IsSalesperson Boolean
Employee.IsWorkerResource Boolean
Employee.LastName String
Employee.MailCity String
Employee.MailCountry String
Employee.MailCounty String
Employee.MailPostalCode String
Employee.MailState String
Employee.MailStreetAddress1 String
Employee.MailStreetAddress2 String
Employee.MainFaxNumber Phone
Employee.MainPhoneNumber Phone
Employee.PerImage Graphic
Employee.PhoneNumbers Phone Collection
Employee.Position String
Employee.PostalCode String
Employee.PricingLevel Number
Employee.PricingLevelName String
Employee.PricingLevelPlan PricingLevel
Employee.PrimaryFormattedNumber String
Employee.PrimaryNumber Phone
Employee.PrimaryNumberTypeText String
Employee.ProperName String
Employee.ReportMenuTemplateName String
Employee.ReportsToName String
Employee.SecondaryFormattedNumber String
Employee.SecondaryNumber Phone
Employee.SecondaryNumberTypeText String
Employee.ShowOnActivityManager Boolean
Employee.ShowOnLineItems Boolean
Employee.ShowOnTimeClock Boolean
Employee.Signature Graphic
Employee.State String
Employee.StreetAddress1 String
Employee.StreetAddress2 String
Employee.TaxNumber String
Employee.TerminationDate Date
Employee.TimeClockStatus String
Employee.Title String

Shipping Items Property References
|| Object.FieldName || Data Type || Description ||

ShippingItem.ActualCost Double
ShippingItem.CarrierName String
ShippingItem.CarrierService String
ShippingItem.EstimatedCost Double
ShippingItem.ShipDate Date
ShippingItem.ShipToAddressText String
ShippingItem.ShipToAddress Address The Address the Shipment is being shipped to
ShippingItem.TrackingNumber String

Sample Use
code_formatpascal
DECLARE isNotContig : FALSE;
IF (TransHeader.ShippingCount > 0) THEN
DECLARE isUS;
isUS : 1);
IF (isUS) THEN
Set Is Not Contiguous if the State is in the non-contiguous list
IsNotContig : (POS(“AK;HI;AS;FM;GU;MH;MP;PW;PR;VI;AA;AE;AP”
, TransHeader.ShippingItems[0].ShipToAddress.State) > 0);
ENDIF;
ENDIF;
Now Return If Non-Contigous
IsNotContig;
code

Part Property References
You can access the part that is assigned to the line item using functions such as ||

||~ Object ||~ Data Type ||~ Description ||

Part.GetInternalNotes string;
Part.ActualCost Double
Part.ActualQuantity Double
Part.CalculatedCost Double
Part.CalculatedQuantity Double
Part.CostMultiplier string
Part.CostMultiplierType TCostMultiplierType
Part.Description string
Part.EstimatedCost Double
Part.EstimatedCostOverridden Boolean
Part.EstimatedOverridden Boolean
Part.EstimatedQuantity Double
Part.FixedCostMultiplier string
Part.HelpText string
Part.Include Boolean
Part.IncludeCalculated Boolean
Part.IncludeOverridden Boolean
Part.InternalNotes string
Part.IsAttachedToVendorTransaction Boolean
Part.IsAutomatic Boolean
Part.IsPart2 Boolean
Part.PartCode string
Part.PartDescription string
Part.PartID TIDRecord
Part.PartLinkID TIDRecord
Part.PartType TPartType
Part.PartTypeName string
Part.PreDiscountType TPreDiscountType
Part.QuantityAvailable Double
Part.QuantityExpected Double
Part.QuantityOnHand Double
Part.QuantityOnOrder Double
Part.QuantityReserved Double
Part.RedNotificationPoint Double
Part.ReferenceNumber Integer
Part.SKU string
Part.SortOrder Integer
Part.StationOV Boolean
Part.SuggestedPrice Double This is the “suggested” price for this part ( Cost * SuggestedMultiplier). However, the Product may or may not use this value in the calculation of the products price.
Part.SuggestedMultiplier Double This is the “suggested” multiplier as set up in the part. However, the Product may overrride this value and not use this multiplier.
Part.TrackInventory Boolean
Part.TransDetailID TIDRecord
Part.UnitAbbrev string
Part.UnitID TIDRecord
Part.UnitText string
Part.VariableID TIDRecord
Part.Vendor string
Part.VendorPartNumber string
Part.YellowNotificationPoint Double

User Property References
|| User.FirstName || string || ||

User.FullName string
User.LastName string
User.LastWebAccess DateTime
User.LoginName string
User.DomainUser string
User.LoginToControl Boolean
User.LoginToWebPro Boolean
User.SecurityTemplateName string
User.WebProSecurityTemplateName string

See Also

1)
TransHeader.ShippingItems[0].ShipToAddress.Country “US”)
OR (TransHeader.ShippingItems[0].ShipToAddress.Country “USA”