Expand my Community achievements bar.

How can I move xml inside enter-tag from one delivery input form to an another extension input form?

Avatar

Level 2

Hi!


I have some code inside the enter-tag in a delivery input form (nms:delivery) that I want to move over to a new "extension" input form (let's call it abc:delivery) and use reference from this.

This is mostly just to avoid having too much code clutter in nms:delivery.

 

I managed to move the container from nms:delivery to abc:delivery, with adding a name in abc:delivery, and reference it with ref="" in the nms:delivery input form, and this worked fine.


But I have quite a lot of code (if, set expr..) inside the enter tag (and leave tag) in nms:delivery that I would like to move there aswell, and use reference instead, like the container. 

 

I think the problem is that my container is shown in the first and main window when opening a delivery, so I only get my enter-code to work if it exists in the top most <enter> directly under the main form-tag. And if I reference my enter-tag above the original enter, it just ignores the original one, so it does not seem like I can have two enter-tags after eachother. And I can't find a way to reference anything from inside the original enter-tag either.

 

abc:delivery: This is currently how the extension input form (abc:delivery) looks (simplified and just x'ed out some id's etc):

 

 

<form _cs="Delivery extension (abc)" created="2020-04-19 17:59:22.975Z" createdBy-id="xxxxxxxx"
      entitySchema="xtk:form" img="xtk:form.png" label="Delivery extension"
      lastModified="2020-05-26 11:20:00.893Z" md5="XXXXX"
      modifiedBy-id="xxxxxxxxxx" name="delivery" namespace="abc"
      xtkschema="xtk:form">

  <enter name="testEnter">
    <set value="Setting fieldOne value" xpath="@fieldOne"/>
  </enter>
  
  <container label="Parameters" name="parameters" type="frame">
    <value label="Showing fieldOne value" xpath="@fieldOne"/>
    <value label="Showing fieldTwo value" xpath="@fieldTwo"/>
  </container>

  <leave name="testLeave">
    <set value="Setting fieldTwo value" xpath="@fieldTwo"/>
  </leave>

</form>

 

 

 

nms:delivery: This is currently how the main input form (nms:delivery) looks (super simplified and x'ed out some id's etc):

 

 

<form _cs="Delivery (nms)" created="2017-03-08 10:09:18.605Z" createdBy-id="x" editionMode="dialog"
      entity-schema="nms:delivery" entitySchema="xtk:form" img="xtk:form.png" label="Delivery"
      lastModified="2020-05-25 13:39:22.742Z" maxLabelWidth="50" md5="XXXXX"
      modifiedBy-id="xxxxxxxxx" name="delivery" namespace="nms" readOnlyExpr="[/tmp/@readOnly]"
     xtkschema="xtk:form">

   <enter>
      <!-- OTHER EXISTING ORIGINAL NMS ENTER CODE -->
      ...

      <!-- My code is now here, but I want to only reference this from abc -->
      <set value="Setting fieldOne value" xpath="@fieldOne"/>
   </enter>

   <!-- ... Lots of other nms containers ... -->

   <!-- My referenced container (that works!) -->
   <container label="Parameters" ref="abc:delivery:parameters" type="frame"/>

   <!-- ... Lots of other nms containers ... -->

   <leave>
      <!-- OTHER EXISTING ORIGINAL NMS LEAVE CODE... -->
      ...

      <!-- My code is now here, but I want to only reference this from abc -->
      <set value="Setting fieldTwo value" xpath="@fieldTwo"/>
   </leave>

</form>

 

 

 

I'm relatively new to Adobe Campaign, so would really appreciate some help, still lots that I find confusing

6 Replies

Avatar

Community Advisor

Hi,

 

Move the <enter/> event into the <container/>:

 

<form ...>
  <container label="Parameters" ref="abc:delivery:parameters" type="frame"/>
</form>

 

Thanks,

-Jon

Avatar

Level 2

Than you so much for the reply @Jonathon_wodnicki  !

So something like this?

In nms:delivery (keeping only the ref of the container):

 

 

 

 

<form ...>

  <container label="Parameters" ref="abc:delivery:parameters" type="frame"/>

</form>

 

 

 

 

 

In abc:delivery (adding enter tag inside the container that is referenced in nms:delivery?):

 

 

 

 

<form ...>

  <container label="Parameters" name="parameters" type="frame">
    <enter>
      <set value="Testing" xpath="smsParameters/@sourceAddress"/>
    </enter>
    <value label="Address" xpath="parameters/@sourceAddress"/>
    ....
  </container>

</form>

 

 

 

 

 
This does not work for me though... It's still like it does not read it at all. So am I doing it incorrecly, or is there just something else that's wrong here?:)

Avatar

Level 2

I manage to reference enter tag, but only directly under first <form/>. But this REPLACES the already existing enter, not adding to it..

In nms:delivery:

 

 

 

<form ...>
   <enter ref="abc:delivery:testEnter"/>
   <enter>
      <!-- Original NMS enter code -->
      ...
   </enter>
</form>

 

 

 

 

So back to square one, still only being able to add my code directly inside the enter in nms.. 

 

Avatar

Level 2

@Jonathon_wodnicki 

I replied you, but as a comment under your answer, but guess that's not very visible

I thought I fixed it by referencing the enter-tag above the already existing one. But that seemed to just ignore the original one, so I added the code back inside the original enter-tag in nms:delivery and I've had that for a while now. But now I'd love to try again.

 

(And I've also rewritten my question a bit, to hopefully make it more clear.)

 

I think the problem is that my container is shown in the first and main window when opening a delivery, so I only get my enter-code to work if it exists inside the top most enter-tag directly under the first/main form-tag. And if I reference my enter-tag above the original enter, it just ignores the original one, so it does not seem like I can have two enter-tags after eachother. And I can't find a way to reference anything from inside the original enter-tag either.

 

About your suggestion, "Move the <enter/> event into the <container/>". I'm not sure exactly what you meant, but I tried these two:

 

I have tried (in nms:delivery):

<form name="delivery" namespace="nms" ... >

   <enter>
      ...
   </enter>

   <container label="Parameters" ref="abc:delivery:parameters" type="frame">
      <!-- TRIED THIS, DOES NOT SEEM TO WORK -->
      <enter ref="abc:delivery:testEnter"/>
   </container>


   <leave>
      ...
   </leave>

</form>

 

And (in abc:delivery):

<form name="delivery" namespace="abc" ... >

  <enter name="testEnter">
    <set value="Setting fieldOne value" xpath="@fieldOne"/>
  </enter>
  
  <container label="Parameters" name="parameters" type="frame">
    <!-- TRIED THIS, DOES NOT SEEM TO WORK -->
    <enter ref="abc:delivery:testEnter"/> 

    <value label="Showing fieldOne value" xpath="@fieldOne"/>
    <value label="Showing fieldTwo value" xpath="@fieldTwo"/>
  </container>

  <leave name="testLeave">
    <set value="Setting fieldTwo value" xpath="@fieldTwo"/>
  </leave>

</form>

 

Was one of these what you suggested? Which one (if any) should have worked?