Input Form - <leave> xml tag is not working

andreac50638695

08-05-2017

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>

Accepted Solutions (1)

Accepted Solutions (1)

Amit_Kumar

MVP

09-05-2017

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