Expand my Community achievements bar.

SOLVED

Leave element not working as expected | Adobe Campaign Classic v7 - Build 8936

Avatar

Level 2

Hey there,

 

I am trying to implement validation on empty fields on the operation form with an extended schema. Below are the details:

 

Schema (extended):

<srcSchema _cs="Campaigns (ybl)" created="2019-02-26 06:44:26.000Z" createdBy-id="0"
entitySchema="xtk:srcSchema" extendedSchema="nms:operation" img="nms:operation.png"
label="Campaigns" labelSingular="Campaign" lastModified="2020-08-26 08:12:57.000Z"
md5="4BE6FE980BD9CB9B07DAEC8809A6B3C1" modifiedBy-id="0" name="operation"
namespace="ybl" xtkschema="xtk:srcSchema">

<enumeration basetype="byte" name="programCode">
<value label="Yes First - YF" name="YF" value="0"/>
<value label="Yes Private - YPri" name="YPri" value="1"/>
<value label="Yes Premia - YPre" name="YPre" value="2"/>
<value label="Yes Prosperity - YPro" name="YPro" value="3"/>
<value label="Webpush/Website - WW" name="WW" value="4"/>
<value label="All Programmes - AP" name="AP" value="5"/>
</enumeration>

<enumeration basetype="byte" label="MultiWave" name="multiwave">
<value label="Yes" name="yes" value="1"/>
<value label="No" name="no" value="0"/>
</enumeration>

<enumeration basetype="byte" label="genieChannel" name="genieChannel">
<value label="SMS" name="sms" value="1"/>
<value label="Email" name="email" value="0"/>
</enumeration>

<enumeration basetype="byte" label="genieTrigger" name="genieTrigger">
<value label="Yes" name="yes" value="1"/>
<value label="No" name="no" value="0"/>
</enumeration>

<enumeration basetype="byte" label="genieDisplay" name="genieDisplay">
<value label="Yes" name="yes" value="1"/>
<value label="No" name="no" value="0"/>
</enumeration>

<enumeration basetype="byte" default="yes" name="multiWave">
<value label="No" name="no" value="0"/>
<value label="Yes" name="yes" value="1"/>
</enumeration>

<enumeration basetype="byte" name="campaignType">
<value label="Cross Sell" name="crossSell" value="crossSell"/>
<value label="Value Build Up" name="valueBuildUp" value="valueBuildUp"/>
<value label="Win Back" name="winBack" value="winBack"/>
<value label="Promo Offer" name="promoOffer" value="promoOffer"/>
<value label="Newsletter" name="newsletter" value="newsletter"/>
<value label="Service" name="service" value="service"/>
<value label="Event/Invite" name="event/invite" value="event/invite"/>
<value label="Regulatory" name="regulatory" value="regulatory"/>
<value label="Acquisition" name="acquisition" value="acquisition"/>
</enumeration>

<enumeration basetype="byte" name="productType">
<value label="Liabilities" name="liabilities" value="liabilities"/>
<value label="Retail Assets" name="assets" value="assets"/>
<value label="Cards" name="cards" value="cards"/>
<value label="Investments/Wealth Management" name="investments/wealthManagement"
value="investments/wealthManagement"/>
<value label="DB" name="DB" value="DB"/>
<value label="Remit" name="remit" value="remit"/>
<value label="Yes Foundation/Yes Community" name="yesFoundation/yesCommunity"
value="yesFoundation/yesCommunity"/>
<value label="Corporate MCC" name="corporateMCC" value="corporateMCC"/>
</enumeration>

<enumeration basetype="byte" name="campaignCategoryL1">
<value label="Onboarding" name="onboarding" value="onboarding"/>
<value label="Easy to Bank" name="easyToBank" value="easyToBank"/>
<value label="Take More" name="takeMore" value="takeMore"/>
<value label="Active Again" name="activeAgain" value="activeAgain"/>
<value label="Mandatory" name="mandatory" value="mandatory"/>
<value label="Acquisition NTB" name="acquisitionNTB" value="acquisitionNTB"/>
</enumeration>

<element img="nms:operation.png" label="Campaigns" labelSingular="Campaign" name="operation">
<attribute enum="programCode" label="Program Code" name="programCode" notNull="true"
type="string"/>
<attribute enum="campaignCategoryL1" label="Campaign Category L1" name="campaignCategoryL1"
notNull="true" type="string"/>
<attribute enum="campaignType" label="Campaign Type" name="campaignType" notNull="true"
type="string"/>
<attribute label="Product Type" name="campProductType" notNull="true" type="string"/>
<attribute label="Product" name="campProduct" notNull="true" type="string"/>
<attribute dbEnum="yblJourney" label="Journey" name="journey" notNull="true"
type="string"/>
<attribute enum="genieDisplay" label="Genie Display" name="geniedisplay" notNull="true"
type="string"/>
<attribute enum="genieTrigger" label="Genie Trigger" name="genietrigger" notNull="true"
type="string"/>
<attribute enum="genieChannel" label="Genie Channel" name="geniechannel" notNull="true"
type="string"/>
<attribute enum="multiWave" label="MultiWave" name="multiWave" notNull="true"
type="string"/>
<element label="product Type" name="campProductType" revLink="operation" target="ybl:campProductType"
type="link">
<join xpath-dst="@campProductType" xpath-src="@campProductType"/>
</element>
<element label="product" name="campProduct" revLink="operation" target="ybl:campProduct"
type="link">
<join xpath-dst="@campProduct" xpath-src="@campProduct"/>
</element>

</element>

</srcSchema>

 

--------------------------------------------------------------------------------------------------

 

Input Form (nms:operation):

<container colcount="2" img="xtk:properties.png" label="Properties">
<input label="Campaign Name" xpath="@label"/>
<input xpath="@internalName"/>
<input xpath="@nature"/>
<input required="true" xpath="@campaignType"/>
<input createMode="none" label="Product Type (L2)" noZoom="true" required="true" xpath="campProductType">
<orderBy>
<node expr="@campProductType"/>
</orderBy>
<enter name="onChange">
<set value="" xpath="../@campProductType"/>
<reset xpath="campProduct"/>
</enter>
</input>
<input createMode="none" label="Product Name" noZoom="true" notifyPathList="campProduct/@campProduct" required="true" xpath="campProduct">
<sysFilter>
<condition expr="@campProductType= $(@campProductType)"/>
</sysFilter>
<orderBy>
<node expr="@campProduct"/>
</orderBy>
</input>
<input required="true" xpath="@programCode"/>
<input label="Multi Wave" required="true" xpath="@multiWave"/>
<input label="Multi Channel" required="true" xpath="@geniechannel"/>
<input label="Genie Trigger" required="true" xpath="@genietrigger"/>
<input label="Genie Display" required="true" xpath="@geniedisplay">
</input>
<input label="Campaign Category L1" required="true" xpath="@campaignCategoryL1"/>
</container>

 

<leave>

</check>
<check expr="@campaignType != '' or @campProductType != '' or @campProduct != '' or @programCode != '' or @multiWave != '' or @geniechannel != '' or @genietrigger != '' or @geniedisplay != '' or @programCode != '' or @campaignCategoryL1 != ''">
<error>You must enter all the fields asked</error>
</check>

</leave>

 

--------------------------------------------------------------------------------------------------------

 

The adjoining checks in the leave element are working but the one mentioned here isn't. 

 

Can anyone please help me out here?

 

Thanks in advance,

Rahul Adwani

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hi @rahuladwani 

you should check:

  • if you updated database structure with your new schema extension
  • why you have one </check> tag more then it is needed in provided code (just after <leave>)
  • if form can access provided paths (@campaignType,@campProduct, etc...)
  • try with separate </check> tag for each field

Regards,
Milan

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hi @rahuladwani 

you should check:

  • if you updated database structure with your new schema extension
  • why you have one </check> tag more then it is needed in provided code (just after <leave>)
  • if form can access provided paths (@campaignType,@campProduct, etc...)
  • try with separate </check> tag for each field

Regards,
Milan

Avatar

Level 2

Hi @Milan_Vucetic, Hi @Milan_Vucetic,

 

Thanks for your help. The solution worked. Below are the details:

 

  • if you updated database structure with your new schema extension ---> Yes, did that.
  • why you have one </check> tag more then it is needed in provided code (just after <leave>) ----> This was a mistake while pasting the code here
  • if form can access provided paths (@campaignType,@campProduct, etc...) --> Yes, it can.
  • try with separate </check> tag for each field ---> Yes, tried this and this worked.

 

Thanks again.

 

Regards,

Rahul Adwani