CreatePhones
The CreatePhones is an attached business rule that provieds the facility to insert phone records to existing clients or existing addresses and can be overriden at client level transaction.
CreatePhone Attribute and Elements
Element/Tag | Attribute | Definition | Element/Attribute Value and Description |
---|---|---|---|
<CreatePhones> |
|
Opening tag for CreatePhones business rule. |
|
<PhoneRecords> |
Required and repeatable element: Opening tag to contain all the details of a phone records. |
||
<ENTITY> |
Required element: Values can be Address | Client | Variable Address: A phone number gets attached to the address of a client when address is selected. Client: A phone number gets attached to the client if Client is selected. Variable: Accepts a client or address through a math variable. |
Values can be Address/Client/Variable | |
<ENTITYGUID> |
Required element: Value for this element can be a ClientGuid or AddressGuid. |
||
<Tests> |
Optional element: Opening tag for tests. |
||
<Test> | Tag to contain test conditions. | ||
<Fields> |
Required element: Opening tag for field details. |
||
<Field> |
Required element: Opening tag for field. |
||
<FromCollection> |
Required and repeatable element: A collection of key/value pairs for the target fields. Indices must be (unique) phone numbers.
|
<From> and <FromCollection> should not be used together. | |
<To> |
Required element: Can be used to map a From field to a AsPhone field. |
Required Fields for a phone record are PhoneType, CallingCode, PhoneNumber, Preferred Optional Field for a Phone record is Extension. |
|
<Phone> |
Optional and repeatable element: Opening tag to capture single phone details. |
||
<Tests> |
Optional element: Opening tag to define test conditions. |
||
<Test> | Tag to contain test conditions. | ||
<From> |
Optional element: Can be used to capture a single phone detail. |
Math variable collection of index/values. <From> and <FromCollection> should not be used together. |
|
<To> |
Required element: The target named field in phone screen. |
||
<ReversalProcessing> |
Optional element: Opening tag to define action need to be taken on reversal. |
||
<ShadowOnReversal> |
Optional element: Defines the conditions under which the Client record(s) created from this attached BR should be Shadowed. |
||
<Tests> |
Optional element: Opening tag for test expressions. |
||
<Test> | Required element: |
Standard <Tests> element configuration All Activity Fields and logged Activity Math variables can be used in Expressions under this Tests element. |
|
<DeleteonReversal> |
Optional element: Defines the conditions under which the Client record(s) created from this attached BR should be deleted. |
||
<Tests> |
Optional element: Opening tag for test expressions. |
|
|
<Test> | Required element: |
Standard <Test> element configuration All Activity Fields and logged Activity Math variables can be used in Expressions under this Tests element. |
XML Schema
<CreatePhones> <PhoneRecords ENTITY="[Address|Client|Variable]" ENTITYGUID="[variable]"> <Tests> <Test></Test> </Tests> <Fields> <Field> <FromCollection></FromCollection> <To></To> </Field> </Fields> <Phone> <Tests> <Test></Test> </Tests> <Fields> <Field> <From></From> <To></To> </Field> </Fields> </Phone> </PhoneRecords> <ReversalProcessing> <ShadowOnReversal> <Tests> <Test></Test> </Tests> </ShadowOnReversal> <DeleteOnReversal> <Tests> <Test> </Test> </Tests> </DeleteOnReversal> </Reversalprocessing> </CreatePhones>
XML Example
<CreatePhone> <CreatePhones> <PhoneRecords ENTITY="Client" ENTITYGUID="0F20809F-EEED-406F-B4AA-B7D679D931C6"> <Fields> <Field> <FromCollection>PhoneNumberCollectionMV</FromCollection> <To>PhoneNumber</To> </Field> <Field> <FromCollection>CountryCodeCollectionMV</FromCollection> <To>CountryCode</To> </Field> <Field> <FromCollection>PhoneTypeCodeCollectionMV</FromCollection> <To>PhoneTypeCode</To> </Field> <Field> <FromCollection>PhoneExtensionCollectionMV</FromCollection> <To>Extension</To> </Field> <Field> <FromCollection>PreferredPhoneCollectionMV</FromCollection> <To>Preferred</To> </Field> </Fields> </PhoneRecords> </CreatePhones> <MultiFields> <MultiField> <Name>MultiField-PhonesCreate</Name> <Title>MultiField-PhonesCreate</Title> <ComboDisplay>MultiField-PhonesCreate</ComboDisplay> <Start>1</Start> <End>5</End> <Fields> <Field> <Name>PhoneNumber</Name> <Display>Phone Number</Display> <DataType>Text</DataType> </Field> <Field> <Name>Extension</Name> <Display>Phone Extension</Display> <DataType>Text</DataType> </Field> <Field> <Name>PhoneType</Name> <Display>Phone Type</Display> <DataType>Combo</DataType> <Query TYPE="SQL">SELECT CodeValue, ShortDescription FROM AsCode WHERE CodeName = 'AsCodePhoneType'</Query> </Field> <Field> <Name>CountryCode</Name> <Display>Country Code</Display> <DataType>Combo</DataType> <Query TYPE="SQL">select CountryCode,CountryCode from ascountry</Query> </Field> <Field> <Name>Preferred</Name> <Display>Preferred_Y/N</Display> <DataType>Text</DataType> </Field> </Fields> </MultiField> </MultiFields>Transaction xml
<Transaction> <EffectiveDate STATUS="Enabled" TYPE="SYSTEM"/> <MultiFields RULE="MultiField-PhonesCreate">Yes</MultiFields> <Math> <MathVariables> <XMLComment> <!--Definition of fields for multifield business rule--> </XMLComment> <MathVariable VARIABLENAME="ActivityGuidMV" TYPE="FIELD" DATATYPE="TEXT">Activity:ActivityGUID</MathVariable> <XMLComment> <!--Collections definition--> </XMLComment> <MathVariable VARIABLENAME="PhoneNumberCollectionMV" TYPE="COLLECTION" OPERATION="CREATE" DATATYPE="MAP"/> <MathVariable VARIABLENAME="CountryCodeCollectionMV" TYPE="COLLECTION" OPERATION="CREATE" DATATYPE="MAP"/> <MathVariable VARIABLENAME="PhoneTypeCodeCollectionMV" TYPE="COLLECTION" OPERATION="CREATE" DATATYPE="MAP"/> <MathVariable VARIABLENAME="PhoneExtensionCollectionMV" TYPE="COLLECTION" OPERATION="CREATE" DATATYPE="MAP"/> <MathVariable VARIABLENAME="PreferredPhoneCollectionMV" TYPE="COLLECTION" OPERATION="CREATE" DATATYPE="MAP"/> <MathVariable VARIABLENAME="MultiFieldsIndexArray" TYPE="INTEGERARRAY" OPERATION="FILLBY-SQL" DATATYPE="INTEGER">SELECT DISTINCT(FieldIndex) FROM AsActivityMultivalueField WHERE ActivityGUID = '[ActivityGuidMV]' ORDER BY FIELDINDEX ASC;</MathVariable> <MathVariable VARIABLENAME="CountOfMultiFieldMV" TYPE="AGGREGATEFUNCTION" METHOD="COUNT" DATATYPE="INTEGER">MultiFieldsIndexArray</MathVariable> <MathLoop VARIABLENAME="MultiFieldLoopMV" TYPE="FOR" ITERATIONS="CountOfMultiFieldMV"> <MathVariable VARIABLENAME="MultiFieldLoopIndexMV" TYPE="LOOPINDEX" SOURCEARRAY="MultiFieldLoopMV" DATATYPE="INTEGER"/> <MathVariable VARIABLENAME="PhoneNumberCollectionMV" TYPE="COLLECTION" OPERATION="FILLBY-SQL" KEY="MultiFieldLoopIndexMV" DATATYPE="TEXT">SELECT fieldindex, textvalue FROM ASACTIVITYMULTIVALUEFIELD a WHERE activityguid = '[ActivityGuidMV]' AND fieldname = 'PhoneNumber'</MathVariable> <MathVariable VARIABLENAME="CountryCodeCollectionMV" TYPE="COLLECTION" OPERATION="FILLBY-SQL" KEY="MultiFieldLoopIndexMV" DATATYPE="TEXT">SELECT fieldindex, textvalue FROM ASACTIVITYMULTIVALUEFIELD a WHERE activityguid = '[ActivityGuidMV]' AND fieldname = 'CountryCode'</MathVariable> <MathVariable VARIABLENAME="PhoneTypeCodeCollectionMV" TYPE="COLLECTION" OPERATION="FILLBY-SQL" KEY="MultiFieldLoopIndexMV" DATATYPE="TEXT">SELECT fieldindex, textvalue FROM ASACTIVITYMULTIVALUEFIELD a WHERE activityguid = '[ActivityGuidMV]' AND fieldname = 'PhoneType'</MathVariable> <MathVariable VARIABLENAME="PhoneExtensionCollectionMV" TYPE="COLLECTION" OPERATION="FILLBY-SQL" KEY="MultiFieldLoopIndexMV" DATATYPE="TEXT">SELECT fieldindex, textvalue FROM ASACTIVITYMULTIVALUEFIELD a WHERE activityguid = '[ActivityGuidMV]' AND fieldname = 'Extension'</MathVariable> <MathVariable VARIABLENAME="PreferredPhoneCollectionMV" TYPE="COLLECTION" OPERATION="FILLBY-SQL" KEY="MultiFieldLoopIndexMV" DATATYPE="TEXT">SELECT fieldindex, textvalue FROM ASACTIVITYMULTIVALUEFIELD a WHERE activityguid = '[ActivityGuidMV]' AND fieldname = 'Preferred'</MathVariable> </MathLoop> </MathVariables> </Math> </Transaction>