Skip to content

👉 Join our Discord community.

Add action button to the form view
626 views

Add action button to the form view

View favourites

Have you ever wondered how to add new button with custom functionality to form view. I will show you step by step how to do it.

In my example I will create signatures used in email campaigns, which will be dependent on the recipient’s profile information such as language, country etc. The way how I have designed the solution for this problem is following:

  • we will use custom table schema that will hold all the signature rules and the signature content.
  • we will create synchronization button on the form view that will run JavaScript code to recreate personalization block with all the active rules found in the database.

You can achieve similar result with attaching the table to the delivery in the personalization tab

JavaScript library

Add JavaScript library that will contain all custom methods for your schema or schemas if you want to have all methods from all schemas under one library. All the functions inside the library have to follow naming convention

<namespace>_<schema>_<method_name>
var cus_myCusSchema_myNewMethod = function(arg){
//do something
}

Save the library and keep the name for to use later. In our example we called this library cus:myNewMethodsLibrary

Database schema with method

Create new or extend schema to add new methods in respective place.

<srcSchema name="myCusSchema" namespace="cus" xtkschema="xtk:srcSchema">
	<element>
             ...
             ...
   	</element>
  	<methods>
      <method library="cus:myNewMethodsLibrary" name="myNewMethod" static="true">
        <parameters>
          <param desc="Argument for function" inout="in" name="argIn" type="<valid_type>"/>
          <param desc="Parameter returned by function" inout="out" name="argOut" type="<valid_type>"/>
          <param desc="Parameter returned by function" inout="out" name="argOut2" type="<valid_type>"/>
        </parameters>
      </method>
  	</methods>
</srcSchema>

Buttons with custom functionality are called commands in adobe campaign and to add them in the view you need to amend the navigation tree structure. First we extend the nms:core navigation tree. Also you can skim this through to find more useful information what else you can do with the navigation tree.

We add under the <model name=”root” following

<nodeModel img="nms:survey/radiolist.png" label="My custom schema action button" name="myCusNavTreeButton">
        <command desc="Custom button function caller" img="nl:runtask.png" label="Do something"
                 name="myCusNavTreeButtonMethod" promptLabel="Really want me to do something?"
                 rights="">
          <soapCall name="myNewMethod" service="cus:myCusSchema">
            <param type="string" xpath="@dummy-value"/>
          </soapCall>
        </command>
        <view name="listdet" schema="cus:myCusSchema" type="listdet">
          <columns>
            <node xpath="@someField"/>
            ...
            <node xpath="@someOtherField"/>
          </columns>
        </view>
      </nodeModel>

That is it we have created new functionality inside adobe campaign classic.
The newly created schema methods are also exposed to the SOAP and can be called from another system just as any other default method described in the WSDL and also should be available in there upon creation.

Oh hi there đź‘‹
I have a SSJS skill for you.

Sign up now to get an SSJS skill that can be used with your AI companion

We don’t spam! Read our privacy policy for more info.

Share With Others

The author
Marcel Szimonisz Platinum

Marcel Szimonisz

Marketing Automation Consultant

I specialize in solving marketing technology challenges, automating processes, and turning ideas into practical solutions with Salesforce Marketing Cloud and Adobe Campaign. Through MarTechNotes, I share technical guides and insights that make complex topics easier to understand

Latest badges
Weekend Regular Weekend Regular Profile Complete Profile Complete Simple Start Simple Start 5 Day Streak 5 Day Streak First Comment First Comment

Your email address will not be published. Required fields are marked *

Get exclusive tips, scripts and news

Choose your topics

We don’t spam! Read our privacy policy for more info.

Similar posts

Add to this article

Share your experience

Your contribution

Article history

What changed