Expand my Community achievements bar.

Announcing the launch of new sub-community for Campaign Web UI to cater specifically to the needs of Campaign Web UI users!
SOLVED

How to populate drop down based on custom srcSchema

Avatar

Level 2

Hi, we are struggling with drop down functionality in Campaign Classic:

 

Requirements:
1. We want to use a custom srcSchema to populate a drop down, (not system enumeration or db enumeration).

2. The displayed value in the drop down list should be a specified field in the srcSchema, not the primary key.
3. The displayed value in the drop down list should be a specified field in the srcSchema, not the primary key also after saving and reopening the offer.

 

These are the solutions we have tried so far:

1. Input form: input type="enum" schema="cus:customSchema".
    SrcSchema (cus:customSchema): <compute-string expr="@nonPrimaryKey"/>.
    After saving the form/entity, primary key is displayed in the drop down, instead of the desired computed string.

2. SrcSchema: Creating a link to the cus:customSchema from an offer extension schema.
   Input form: input type="linkList" xpath="linkXpath" and displaying the nonPrimaryKey column with a child input element.
   We are struggling to get the linkList shown as a normal drop down. We only se the chosen/linked value.

 

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @_lukas_,

I always look how out-of-the-box fields are done. Your example is exactly the same as country field in nms:recipient. Except that the state link (conditional select based on previous selection) in your case is not needed.

 

See the schema nms:recipient

 <element externalJoin="true" label="Country/Region" name="country" revIntegrity="normal"
             revLink="recipient" target="nms:country" type="link">
      <join xpath-dst="@isoA2" xpath-src="location/@countryCode"/>
    </element>
    <element desc="State/Province" externalJoin="true" label="State" name="stateLink"
             revLink="recipient" target="nms:state" type="link">
      <join xpath-dst="@code" xpath-src="location/@stateCode"/>
      <join xpath-dst="@countryCode" xpath-src="location/@countryCode"/>
    </element>

See the input form nms:recipient

    <input choiceButton="true" createMode="none" extraColumns="@isoA2,@isoA3" noZoom="true"
           xpath="../country">
      <orderBy>
        <node expr="@label"/>
      </orderBy>
      <enter name="onChange">
        <set value="" xpath="../location/@stateCode"/>
        <reset xpath="../stateLink"/>
      </enter>
    </input>
    <input choiceButton="true" createMode="none" extraColumns="@code,@countryCode"
           noZoom="true" notifyPathList="country/@label|../country/@_cs,@countryCode|../location/@countryCode,country|../country"
           xpath="../stateLink">

      <sysFilter>
        <condition expr="@countryCode = $(../location/@countryCode)"/>
      </sysFilter>
      <orderBy>
        <node expr="@label"/>
      </orderBy>
    </input>

This also applies for all the custom objects you want to create, it is good to look at the ootb objects apart from the documentation

 

Marcel

View solution in original post

2 Replies

Avatar

Correct answer by
Community Advisor

Hello @_lukas_,

I always look how out-of-the-box fields are done. Your example is exactly the same as country field in nms:recipient. Except that the state link (conditional select based on previous selection) in your case is not needed.

 

See the schema nms:recipient

 <element externalJoin="true" label="Country/Region" name="country" revIntegrity="normal"
             revLink="recipient" target="nms:country" type="link">
      <join xpath-dst="@isoA2" xpath-src="location/@countryCode"/>
    </element>
    <element desc="State/Province" externalJoin="true" label="State" name="stateLink"
             revLink="recipient" target="nms:state" type="link">
      <join xpath-dst="@code" xpath-src="location/@stateCode"/>
      <join xpath-dst="@countryCode" xpath-src="location/@countryCode"/>
    </element>

See the input form nms:recipient

    <input choiceButton="true" createMode="none" extraColumns="@isoA2,@isoA3" noZoom="true"
           xpath="../country">
      <orderBy>
        <node expr="@label"/>
      </orderBy>
      <enter name="onChange">
        <set value="" xpath="../location/@stateCode"/>
        <reset xpath="../stateLink"/>
      </enter>
    </input>
    <input choiceButton="true" createMode="none" extraColumns="@code,@countryCode"
           noZoom="true" notifyPathList="country/@label|../country/@_cs,@countryCode|../location/@countryCode,country|../country"
           xpath="../stateLink">

      <sysFilter>
        <condition expr="@countryCode = $(../location/@countryCode)"/>
      </sysFilter>
      <orderBy>
        <node expr="@label"/>
      </orderBy>
    </input>

This also applies for all the custom objects you want to create, it is good to look at the ootb objects apart from the documentation

 

Marcel