Overview

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:

// 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



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:

  • Company – The customer or prospect for this order.
  • Contact – The account's contact for this order.
  • TransDetail – The line item being working on.
  • TransHeader – The Overall Transaction (Order or Estimate)
  • User - The logged-in user

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.NameData TypeDescription
IDAsStringString(read/only) Returns the objects database ID.
ClassTypeAsStringString(read/only) Returns the objects ClassTypeID.



Company Property References

Object.FieldName Data Type Description
Company.AccountingContactFullNameString
Company.AccountNumberNumber
Company.BillingAddressLinkAddress
Company.CompanyNameString
Company.ContactsContact Collection
Company.CreditApprovalDateDate
Company.CreditBalanceNumber
Company.CreditLimitNumber
Company.CreditNumberString
Company.CustomerNumberNumber
Company.DateCreatedDateTime
Company.DateImportedDateTime
Company.DepartmentString
Company.DiscountLevelNumber
Company.FlagsString
Company.HasCreditAccountBoolean
Company.HasParentCompanyBoolean
Company.HasServiceContractBoolean
Company.ImportBatchString
Company.IndustryNameString
Company.IsContractExpiredBoolean
Company.IsProspectBoolean
Company.IsTaxExemptBoolean
Company.KeywordsString
Company.MainFaxNumberPhone
Company.MainPhoneNumberPhone
Company.Marketing3NameString
Company.OriginNameString
Company.ParentCompanyNameString
Company.PaymentTermsNameString
Company.PONumberString
Company.PONumberRequiredBoolean
Company.PricingLevelNumber
Company.PricingLevelNameString
Company.PricingPlanTypeNameString
Company.PrimaryContactFullNameString
Company.PrimaryFormattedNumberString
Company.PrimaryNumberPhone
Company.PrimaryNumberTypeTextString
Company.PromotionNameString
Company.RegionNameString
Company.SecondaryFormattedNumberString
Company.SecondaryNumberPhone
Company.SecondaryNumberTypeTextString
Company.ServiceContractExpDateDate
Company.ServiceContractNotesString
Company.ServiceContractStartDateDate
Company.ShippingAddressLinkAddress
Company.TaxClassNameString
Company.TaxExemptExpDateDate
Company.TaxNumberString
Company.TaxNumberExpDateDate
Company.UseTaxClassLookupBoolean
Company.WebAddressString



Contact Property References

Object.FieldName Data Type Description
Contact.BillingAddressLinkAddress
Contact.BirthDateDate
Contact.BirthDateDayNumber
Contact.BirthDateMonthNumber
Contact.CCBillingAddressString
Contact.DefaultMaskedTrackingNumberString
Contact.DefaultPaymentAccountNameString
Contact.DefaultPaymentAccountTenderTypeTenderType
Contact.DefaultPaymentExpDateDate
Contact.DefaultPaymentNameOnCardString
Contact.DefaultPaymentTrackingNumberString
Contact.DefaultPaymentVCodeString
Contact.EmailAddressString
Contact.FirstNameString
Contact.FullNameString
Contact.IsAccountingContactBoolean
Contact.IsPrimaryContactBoolean
Contact.LastNameString
Contact.MainFaxNumberPhone
Contact.MainPhoneNumberPhone
Contact.PhoneNumbersPhone Collection
Contact.PositionString
Contact.PrimaryFormattedNumberString
Contact.PrimaryNumberPhone
Contact.PrimaryNumberTypeTextString
Contact.ProperNameString
Contact.SecondaryFormattedNumberString
Contact.SecondaryNumberPhone
Contact.SecondaryNumberTypeTextString
Contact.ShippingAddressLinkAddress



Order/Estimate Heading Property References

Object.FieldName Data Type Description
TransHeader.AccountAccount
TransHeader.ActiveVariationTransVariation
TransHeader.BalanceDueNumber
TransHeader.BasePriceNumber
TransHeader.BasePriceStrString
TransHeader.BuiltDateDateTime
TransHeader.ClosedDateDateTime
TransHeader.ContactContact
TransHeader.ContactNameString
TransHeader.ConvertedDateDateTime
TransHeader.CostSetCostSet
TransHeader.CreditMemoAmountNumber
TransHeader.CreditMemoOrderCustTransHeader
TransHeader.CustomerCustomer
TransHeader.CustomerContractTypeString
TransHeader.CustomerNameString
TransHeader.DepthNumber
TransHeader.DescriptionString
TransHeader.DiscountLevelNumber
TransHeader.DiscountLevelOverriddenBoolean
TransHeader.DiscountPriceNumber
TransHeader.DiscountPriceStrString
TransHeader.DispositionDisposition
TransHeader.DivisionIDOverriddenBoolean
TransHeader.DueDateDateTime
TransHeader.EnteredByEmployee
TransHeader.EstimateCreatedDateDateTime
TransHeader.EstimateGreetingString
TransHeader.EstimateGreetingTemplateString
TransHeader.EstimateNumberNumber
TransHeader.FinanceChargeAmountNumber
TransHeader.HTMLLongFormatString
TransHeader.HTMLShortFormatString
TransHeader.InternalNotesString
TransHeader.InternalNotesTemplateString
TransHeader.InvoiceAddressLinkAddress
TransHeader.InvoiceAddressOverriddenBoolean
TransHeader.InvoiceContactContact
TransHeader.InvoiceNumberNumber
TransHeader.InvoiceToTextString
TransHeader.IsFirmDueDateBoolean
TransHeader.IsTaxExemptBoolean
TransHeader.LastFinanceChargeDateDateTime
TransHeader.LostDateDateTime
TransHeader.ManuallyReOpenedBoolean
TransHeader.ModifierPriceNumber
TransHeader.ModifierPriceStrString
TransHeader.NextRefNumberNumber
TransHeader.OrderCreatedDateDateTime
TransHeader.OrderNotesString
TransHeader.OrderNotesTemplateString
TransHeader.OrderNumberNumber
TransHeader.OrderOriginNameString
TransHeader.ParentHeaderCreatedBoolean
TransHeader.PartGLListPartGLEntry Collection
TransHeader.PaymentTermsPaymentTerms
TransHeader.PaymentTermsNameString
TransHeader.PaymentTotalNumber
TransHeader.PONumberString
TransHeader.PriceSetPriceSet
TransHeader.PricingLevelNumber
TransHeader.PricingLevelNameString
TransHeader.PricingLevelOverriddenBoolean
TransHeader.PricingLevelPlanPricingLevel
TransHeader.PromotionPromotion
TransHeader.PromotionNameString
TransHeader.ProofDateDateTime
TransHeader.SaleDateDateTime
TransHeader.SalesDispositionDisposition
TransHeader.SalesPerson1Employee
TransHeader.SalesPerson2Employee
TransHeader.SalesPerson3Employee
TransHeader.ServiceTicketNumberNumber
TransHeader.ShippingCountNumberThis field indicates how many Shipments are on the order.
TransHeader.ShippingItems[x]Array of ShippingItemThis field provides access to the individual shipments on an order.
TransHeader.ShippingAddressLinkAddress
TransHeader.ShippingAddressOverriddenBoolean
TransHeader.ShippingCompanyOverriddenBoolean
TransHeader.ShippingContactOverriddenBoolean
TransHeader.ShipToTextString
TransHeader.ShippingTrackingNumbersStringThis pulls all the tracking numbers for all the shipment items into one comma delimited string.
TransHeader.ShowFlagBoolean
TransHeader.StatusFlagShownBoolean
TransHeader.StatusIDTransStatus
TransHeader.StatusNameString
TransHeader.SubTotalPriceNumber
TransHeader.SubTotalPriceStrString
TransHeader.TaxClassTaxClass
TransHeader.TaxClassNameString
TransHeader.TaxClassOverriddenBoolean
TransHeader.TaxNumberString
TransHeader.TemplateNumberNumber
TransHeader.TransactionTypeTransactionType
TransHeader.UseTaxClassLookupBoolean
TransHeader.VersionNumber
TransHeader.VoidedDateDateTime
TransHeader.WriteOffAmountNumber



Order/Estimate Line Item Property References

Object.FieldName Data Type Description
TransDetail.AccountAccount
TransDetail.BasePriceNumber
TransDetail.BasePriceStrString
TransDetail.ChildItemsTransDetail Collection
TransDetail.CostSetCostSet
TransDetail.DepthNumber
TransDetail.DescriptionString
TransDetail.DetailImageGraphic
TransDetail.DiscountLevelNumber
TransDetail.DiscountLevelOverriddenBoolean
TransDetail.DiscountPriceNumber
TransDetail.DiscountPriceStrString
TransDetail.GoodsItemGoodsItem
TransDetail.GoodsItemCodeString
TransDetail.HasWorkAssignmentBoolean
TransDetail.HTMLLongFormatString
TransDetail.HTMLShortFormatString
TransDetail.InternalNotesString
TransDetail.IsCompleteBoolean
TransDetail.LineItemIndexNumber
TransDetail.LineItemNumberString
TransDetail.LongImageGraphic
TransDetail.ModifierCodeString
TransDetail.ModifierCostSetCostSet
TransDetail.ModifierPriceNumber
TransDetail.ModifierPriceStrString
TransDetail.ModifiersTransMod Collection
TransDetail.ParametersTransDetailParam Collection
TransDetail.ParentHeaderCreatedBoolean
TransDetail.PriceSetPriceSet
TransDetail.PricingLevelNumber
TransDetail.PricingLevelOverriddenBoolean
TransDetail.PriorityNameString
TransDetail.ProductCodeString
TransDetail.ProductNameOnEstimateString
TransDetail.QuantityNumber
TransDetail.SaleAccountNameString
TransDetail.SaleAccountOverriddenBoolean
TransDetail.ServiceTicketItemNumberNumber
TransDetail.ShippingAddressLinkAddress
TransDetail.ShippingAddressOverriddenBoolean
TransDetail.ShippingCompanyOverriddenBoolean
TransDetail.ShippingContactOverriddenBoolean
TransDetail.ShipToTextString
TransDetail.ShowFlagBoolean
TransDetail.StageStage
TransDetail.StageNameString
TransDetail.StatusFlagShownBoolean
TransDetail.SubTotalPriceNumber
TransDetail.SubTotalPriceStrString
TransDetail.TaxClassTaxClass
TransDetail.TaxClassNameString
TransDetail.TaxClassOverriddenBoolean
TransDetail.TicketTypeNameString
TransDetail.TransactionTypeTransactionType
TransDetail.TransHeaderNumberNumber
TransDetail.UnitPriceVariableNameString
TransDetail.UnitPriceVariableValueNumber
TransDetail.UseTaxClassLookupBoolean
SonssubtotalpriceNumberReturns the total of all child items



Part Property References

Part Property to CaptureCFL CodeDescription
Part CategoryParts[x].Part.PartCategoryNamestring
Part NameParts[x]string
PriceParts[x].SuggestedPricenumber
Cost (Price Before Multiplier)Parts[x].EstimatedCostnumber
Quantity (Estimated Usage)Parts[x].EstimatedQuantitynumber
Part Unit CostParts[x].Part.InventoryUnitCost
MultiplierParts[x].Part.CostMultiplierReturns 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.BarCodeString
Product.CustNotesStringReturns the Customer (Invoice) Notes from the product
Product.DescriptionString
Product.ExcludeFromPromotionsBoolean
Product.FlagsString
Product.HelpTextString
Product.ImageGraphic
Product.InternalNotesString
Product.IsChildByDefaultBoolean
Product.IsTaxExemptBoolean
Product.ItemNameString
Product.NameOnEstimateString
Product.PricingPlansPricingPlanCollection
Product.PrintAsString
Product.ProductCodeString
Product.ProductionTimeNumber
Product.ReCalcTransHeaderBoolean
Product.TaxabilityCodeNameString
Product.VariablesVariables 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.BarCodeString
Modifier.DefaultEntryOptionModEntryOption
Modifier.DefaultLimitToListBoolean
Modifier.DefaultPart2ConsumptionFormulaString
Modifier.DefaultPartConsumptionFormulaString
Modifier.DefaultSelectionListIDIDRecord
Modifier.DescriptionString
Modifier.ModifierCodeString
Modifier.PrintAsString
Modifier.QuestionString
Modifier.SaveTransRecordBoolean
Modifier.SortOrderInteger



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.GLDepartmentNameString
PricingPlan.InvoiceTemplateNameString
PricingPlan.NotesString
PricingPlan.PricingPlanTypeNameString
PricingPlan.ScreenTemplateNameString
PricingPlan.UnitPriceVariableNameString
PricingPlan.UnitPriceVariableUnitTextString
PricingPlan.WorkOrderTemplateNameString
PricingPlan.IncomeAccountNameString
PricingPlan.FamilyNameString



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:

Do not use Address.FormattedAddress ,
Instead, use TransHeader.ShippingAddressLink.FormattedAddress



Address Property References

Object.FieldName Data Type Description
Address.CityString
Address.CountryString
Address.CountyString
Address.CSZString
Address.FormattedAddressString
Address.PostalCodeString
Address.StateString
Address.StreetAddress1String
Address.StreetAddress2String
Address.TaxClassNameString



Object.FieldName Data Type Description
AddressLink.AddressTypeNameString
Address.AddressName (future)String



Phone Number Property References

Object.FieldName Data Type Description
Phone.AreaCodeString
Phone.CountryCodeString
Phone.DefaultAreaCodeString
Phone.DefaultCountryCodeString
Phone.ExtensionString
Phone.FormattedNumberString
Phone.PhoneNumberString
Phone.PhoneNumberIndexNumber
Phone.PhoneNumberTypeTextString
Phone.RawNumberString



Employee Property References

Object.FieldName Data Type Description
Employee.BirthdateDate
Employee.CityString
Employee.CountryString
Employee.CountyString
Employee.DepartmentString
Employee.DiscountLevelNumber
Employee.EmailAddressString
Employee.EmergencyContactsContact Collection
Employee.EmployeeStatusEmployeeStatus
Employee.FirstNameString
Employee.FullNameString
Employee.GroupEmployeeGroup
Employee.GroupNameString
Employee.HireDateDate
Employee.IsClockedInBoolean
Employee.IsLoggedInBoolean
Employee.IsSalespersonBoolean
Employee.IsWorkerResourceBoolean
Employee.LastNameString
Employee.MailCityString
Employee.MailCountryString
Employee.MailCountyString
Employee.MailPostalCodeString
Employee.MailStateString
Employee.MailStreetAddress1String
Employee.MailStreetAddress2String
Employee.MainFaxNumberPhone
Employee.MainPhoneNumberPhone
Employee.PerImageGraphic
Employee.PhoneNumbersPhone Collection
Employee.PositionString
Employee.PostalCodeString
Employee.PricingLevelNumber
Employee.PricingLevelNameString
Employee.PricingLevelPlanPricingLevel
Employee.PrimaryFormattedNumberString
Employee.PrimaryNumberPhone
Employee.PrimaryNumberTypeTextString
Employee.ProperNameString
Employee.ReportMenuTemplateNameString
Employee.ReportsToNameString
Employee.SecondaryFormattedNumberString
Employee.SecondaryNumberPhone
Employee.SecondaryNumberTypeTextString
Employee.ShowOnActivityManagerBoolean
Employee.ShowOnLineItemsBoolean
Employee.ShowOnTimeClockBoolean
Employee.SignatureGraphic
Employee.StateString
Employee.StreetAddress1String
Employee.StreetAddress2String
Employee.TaxNumberString
Employee.TerminationDateDate
Employee.TimeClockStatusString
Employee.TitleString



Shipping Items Property References

Object.FieldNameData TypeDescription
ShippingItem.ActualCostDouble
ShippingItem.CarrierNameString
ShippingItem.CarrierServiceString
ShippingItem.EstimatedCostDouble
ShippingItem.ShipDateDate
ShippingItem.ShipToAddressTextString
ShippingItem.ShipToAddressAddressThe Address the Shipment is being shipped to
ShippingItem.TrackingNumberString



Sample Use

DECLARE isNotContig := FALSE;
 
IF (TransHeader.ShippingCount > 0) THEN
        DECLARE isUS;
 
        isUS := ((TransHeader.ShippingItems[0].ShipToAddress.Country = "US") 
                              OR (TransHeader.ShippingItems[0].ShipToAddress.Country = "USA"));
 
        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;



Part Property References

You can access the part that is assigned to the line item using functions such as

PartByName("Grommet", 1)
PartByVariableName("Accessory1", 1)



The following properties are available for you to access information about the part using the reference notation

ObjectData TypeDescription
art.GetInternalNotesstring;
Part.ActualCostDouble
Part.ActualQuantityDouble
Part.CalculatedCostDouble
Part.CalculatedQuantityDouble
Part.CostMultiplierstring
Part.CostMultiplierTypeTCostMultiplierType
Part.Descriptionstring
Part.EstimatedCostDouble
Part.EstimatedCostOverriddenBoolean
Part.EstimatedOverriddenBoolean
Part.EstimatedQuantityDouble
Part.FixedCostMultiplierstring
Part.HelpTextstring
Part.IncludeBoolean
Part.IncludeCalculatedBoolean
Part.IncludeOverriddenBoolean
Part.InternalNotesstring
Part.IsAttachedToVendorTransactionBoolean
Part.IsAutomaticBoolean
Part.IsPart2Boolean
Part.PartCodestring
Part.PartDescriptionstring
Part.PartIDTIDRecord
Part.PartLinkIDTIDRecord
Part.PartTypeTPartType
Part.PartTypeNamestring
Part.PreDiscountTypeTPreDiscountType
Part.QuantityAvailableDouble
Part.QuantityExpectedDouble
Part.QuantityOnHandDouble
Part.QuantityOnOrderDouble
Part.QuantityReservedDouble
Part.RedNotificationPointDouble
Part.ReferenceNumberInteger
Part.SKUstring
Part.SortOrderInteger
Part.StationOVBoolean
Part.SuggestedPriceDoubleThis 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.SuggestedMultiplierDoubleThis is the “suggested” multiplier as set up in the part. However, the Product may overrride this value and not use this multiplier.
Part.TrackInventoryBoolean
Part.TransDetailIDTIDRecord
Part.UnitAbbrevstring
Part.UnitIDTIDRecord
Part.UnitTextstring
Part.VariableIDTIDRecord
Part.Vendorstring
Part.VendorPartNumberstring
Part.YellowNotificationPointDouble



User Property References

ObjectData TypeDescription
User.FirstNamestring
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



You could leave a comment if you were logged in.