Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

SOLVED

Default values in Dropdown-lists

Frank_Ueffing
Level 2
Level 2

Hi,

I've got a question concerning default-values in Dropdown-Lists.

When I am open a new marketing campaign form I can choose a main channel. By default "(Non-specified)" is selected. By reason that about 90%+ of my campaigns are in the main channel "E-Mail", I would like to chose "E-Mail" as the default value.

I analyzed that the form refers to the schema "nms:operation", which is a factory-configured object. In fact of this information I have to create an extension object.

The XML of the extension object is given below:

<srcSchema _cs="Campaigns (fue)" created="2014-09-02 13:51:00.947Z" createdBy-id="0"

           desc="Extension Schema by FUe" entitySchema="xtk:srcSchema" extendedSchema="nms:operation"

           img="nms:operation.png" label="Campaigns" labelSingular="Campaign" lastModified="2014-09-02 14:52:05.857Z"

           mappingType="sql" md5="A66FD32F668697F9E1B9E09B5EA920CE" modifiedBy-id="0"

           name="operation" namespace="fue" xtkschema="xtk:srcSchema">

  <createdBy _cs="Frank Ueffing (Frank.Ueffing)"/>

  <modifiedBy _cs="Frank Ueffing (Frank.Ueffing)"/>

  <enumeration default="mail" name="messageType" template="nms:delivery:messageType"/>

  <element desc="Extension Schema by FUe" img="nms:operation.png" label="Campaigns"

           labelSingular="Campaign" name="operation"/>

</srcSchema>

But it did not work. The default is still "(Non-specified)". 😞

I also tried to add values to the enumeration, like "PoS" (Point of Sale). Look at the XML:

  <enumeration default="mail" name="messageType" template="nms:delivery:messageType">

    <value label="pos" name="pos" value="999"/>

  </enumeration>

Curiosly the appendix works, but the default-value fails.

In my opinion the extension-schema is right. But what is the failure concerning the default-value?

I am looking forward to your support. Thanks!

Best regards,

Frank

1 Accepted Solution
Linda_Stinson
Correct answer by
Employee
Employee

Hi Frank,

Your approach to adding messageTypes by extending the Campaign schema (nms:operation) is correct. As to the default, you have done this correctly as well, but aren't seeing it when you create a new campaign because of the following.

When you create a Campaign, you are actually making a copy of a Campaign template. (Campaign templates are instances of nms:operation, distinguished from actual campaigns by the isModel="true" flag.) The default value for the drop-down list is set in the Campaign template. To see this, go to the Resources > Templates > Campaign templates folder, open a template as if for editing, and Ctrl-F4 to edit the XML. Search for messageType. Compare the definition of the opEmpty Campaign template to that of the opEmail Campaign template, which actually does what you wanted:

CampaignTemplateXml.jpg

  In fact if you create a new Campaign template from scratch instead of duplicating an existing one, you will see that the messageType does default to frank.

Linda

View solution in original post

4 Replies
Linda_Stinson
Correct answer by
Employee
Employee

Hi Frank,

Your approach to adding messageTypes by extending the Campaign schema (nms:operation) is correct. As to the default, you have done this correctly as well, but aren't seeing it when you create a new campaign because of the following.

When you create a Campaign, you are actually making a copy of a Campaign template. (Campaign templates are instances of nms:operation, distinguished from actual campaigns by the isModel="true" flag.) The default value for the drop-down list is set in the Campaign template. To see this, go to the Resources > Templates > Campaign templates folder, open a template as if for editing, and Ctrl-F4 to edit the XML. Search for messageType. Compare the definition of the opEmpty Campaign template to that of the opEmail Campaign template, which actually does what you wanted:

CampaignTemplateXml.jpg

  In fact if you create a new Campaign template from scratch instead of duplicating an existing one, you will see that the messageType does default to frank.

Linda

View solution in original post

Linda_Stinson
Employee
Employee

For anyone attempting the same thing, here is the definition, containing two additional messageType values and the "frank" default.

messageTypes.jpg

Frank_Ueffing
Level 2
Level 2

Hi Linda,

thanks for your answer.

The solution works for the templates "New campaign" and "Recurring campaign", but not for the template "Periodic campaign". If I change the messageType value from "127" to "0" (E-Mail) this error message occurs:

"You must specify a program."

What do I have to do?

There is also another question concerning this topic. When I change the messageType from "127" to "0", furthermore there is the value "(non specified)". This value is defined in a factory-configured object. How can I delete this item (in an extension schema)?

Best regards,

Frank

Linda_Stinson
Employee
Employee

Hi Frank,

  I will look at this issue when I can, but hopefully you are duplicating the templates before modifying them. If not, that is okay, but a best practice is not to modify the out of the box templates - they are the ones in bold. This is because if you upgrade your environment you will lose your changes and also because if you break them there is not a backup.

Linda