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

Input Form - <leave> xml tag is not working

andreac50638695
Level 2
Level 2

Hi All,

We created the following Input Form based in a custom Schema.

Form is correctly displayed, but when we try to display an error message using the tag <leave> in case the parameter "@scriptName" is empty, no error is displayed and the record is created also if scriptName value is empty.

Is there something wrong in the following xml?

<form _cs="Script (amp)" created="2017-05-03 10:12:24.149Z" createdBy-id="319510"

      entitySchema="xtk:form" img="xtk:form.png" label="Script" lastModified="2017-05-08 09:12:52.812Z"
      md5="36EB2AAA88A5A02EA5A042DB0825630A" modifiedBy-id="319510" name="script"
      namespace="amp" xtkschema="xtk:form">
  <createdBy _cs="Administrator (acorsi)"/>
  <container label="Script" name="script">
    <input required="true" xpath="@scriptName"/>
    <input xpath="@scriptDesc"/>
    <static colspan="2" label="Description" type="separator"/>
    <input nolabel="true" xpath="@scriptContent"/>
  </container>
  <leave>
    <check expr="@scriptName=''">
      <error>The name is not specified.</error>
    </check>
  </leave>
</form>

Thanks in advance for your support.

Andrea

 

Below also the "script" schema definition.

<srcSchema _cs="Script (amp)" created="2017-05-03 09:50:46.015Z" createdBy-id="0"
           entitySchema="xtk:srcSchema" img="xtk:schema.png" label="Script" lastModified="2017-05-04 10:45:34.352Z"
           mappingType="sql" md5="4FE18B7EA1A491A2DDE3F91EE2D40068" modifiedBy-id="0"
           name="script" namespace="amp" xtkschema="xtk:srcSchema">
  <createdBy _cs="Administrator (acorsi)"/>
  <modifiedBy _cs="Administrator (acorsi)"/>
  <element autopk="true" label="Script" labelSingular="Script" name="script">
    <key name="scriptName">
      <keyfield xpath="@scriptName"/>
    </key>
    <attribute label="Script Name" name="scriptName" required="true" type="string"/>
    <attribute label="Script Description" name="scriptDesc" type="string"/>
    <attribute label="Script Content" name="scriptContent" type="html"/>
    <attribute default="GetDate()" desc="Creation Date" label="Creation Date" name="created"
               type="datetime"/>
    <attribute label="Exported to CC" name="exportedCCFlg" type="boolean"/>

  </element>
</srcSchema>

1 Accepted Solution
Amit_Kumar
Correct answer by
Community Advisor
Community Advisor

Well! you are almost there use the following modification and this will work for you.

<leave> <check expr="@scriptName != ''"> <error>You must populate the 'Test' field!</error> </check> </leave>

Read more adobe form structure elements here.

Regards,

Amit

View solution in original post

2 Replies
Amit_Kumar
Correct answer by
Community Advisor
Community Advisor

Well! you are almost there use the following modification and this will work for you.

<leave> <check expr="@scriptName != ''"> <error>You must populate the 'Test' field!</error> </check> </leave>

Read more adobe form structure elements here.

Regards,

Amit

View solution in original post