Class SY_ZipCode_bus

Properties

LOCAL cCanPostValidChars$="ABCEGHJKLMNPRSTVWXYZ"  

string of alphabetic characters used in Canadian Postal Codes, D,F,I,O,Q or U are not used.

LOCAL cMainTable$="SY_ZipCode"  
LOCAL cIsSysDB=isTRUE  

Methods

FUNCTION GetCountryCode(tmpZipCode$, tmpCountryCode$)  

Get Country Code for a ZIP/Postal Code

ParameterDescription
tmpZipCode$ [input, string] ZIP/Postal Code to get the Country Code for
tmpCountryCode$ [output, string] Country Code for the ZIP/Postal Code if a record is on-file
Returns [boolean] SUCCESS if the ZIP/Postal Code exists in one record, FAILURE if it doesn't exist or has multiple records
FUNCTION GetZipCodeKey$(value$)  

Get Zip Code Key, either the stripped Canadian Postal Code value (CAN) or the 5-digit US value (USA)

Returns [string] if value is a valid Canadian Postal Code returns formatted key value else returns first five characters of original value
FUNCTION SetCurrentKey(key$)  
FUNCTION ValidateCountryCode(value$)  

Validation logic for Country Code

ParameterDescription
value$ [input, string] Country code to be validated
Returns SUCCESS if CountryCode is valid, FAILURE if CountryCode is not valid
FUNCTION ValidateStateCode(value$)  

Validation logic for State Code, allows state to be null if StateCodeRequired = N in Country table

ParameterDescription
value$ [input, string] State code to be validated
Returns SUCCESS if StateCode is valid, FAILURE if StateCode is not valid
FUNCTION ValidateZipCode(ZipCode$)  
FUNCTION WRITE()  

Properties inherited from: SY_Maint

cActionWrite, cActionDelete, cActivityLogFilePrefix$, DocDateWarnDisplayed, DocDateWarnStatus, EditState, RecordChanged, FirstFailure$, DocumentTotal, ReadOnlyReason$, UDTValidation$, ViewOnly, CurrentPrecision, DocDateWarnForceOff, DocDateWarnObject, ScriptObject, ImportTest, SkipNullCheck$, AFSRequiredFields$

Methods inherited from: CI_Country_val

ClassValidateCountry()

Methods inherited from: CI_State_val

ClassValidateState()

Methods inherited from: SY_Maint

ChangedRecordCompare(), ChangedRecordInfo(), Clear(), ClearRecord(), ConfirmDelete(), CopyFrom(), ExportToCSV(), GetColumnInfo(), GetColumnProperties$(), GetDefaults(), GetOrigRecord$(), GetPropertyValue(), GetValidationGroups$(), ResetDocDateWarnState(), SetCopyKeyValue(), SetDocDateWarnDisplayed(), SetDocDateWarnOff(), SetKey(), SetKeyValue(), SetPartialRecord(), SetRecord(), SetToReadOnly(), SetValue(), SetValues(), Write(), ActivityLogCreateFile(), ActivityLogPrepare(), ActivityLogSetMessage$(), ActivityLogWrite(), CallScript(), CheckForAdvancedFieldSettings(), CheckForScripts(), CheckNullRequiredField(), PERFORM ChildValidate(), ClassValidateDate(), ClassValidateTelephoneNo(), ClearSetFiles(), ColInfoInitAll(), ColInfoInitDefaults(), CommitRow(), GetPropertyCommon(), InitColInfo(), InitScriptEngine(), InitSearchForUpdate(), InitWorkTable(), IsColInIOList(), IsValid(), LoadColInfo(), OpenMainTable(), ParseExtField(), PreWriteScripts(), RemoveColToSkip(), ResetRow(), RetrieveColInfo(), SetDefaults(), SetFilter(), SetMode(), SetParentHandle(), SetValueNoValidate(), StoreColToSkip(), ValidateAll(), ValidateAllRecord(), ValidateColInfo(), ValidateRule()