How to trigger <leave> in referenced container? | Community
Skip to main content
LukasPe1
Level 3
May 10, 2022
Question

How to trigger <leave> in referenced container?

  • May 10, 2022
  • 1 reply
  • 1194 views

I have a custom container which I am including in nms:delivery input form like this:

<container ref="cus:outboundPhone:outboundPhoneContainer" xpath="."/>

I am trying to add a validation-method, by adding a <leave>-tag in the container mentioned above but the only way I have got the leave-tag to trigger is by placing it in the nms:delivery input form itself.
It would be nice to have minimal adjustments to the OOB-schemas, which is why I would like the to place the leave-tag in the custom built input form.
Has anyone got a solution for this? 🙂

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

1 reply

CedricRey
Level 5
May 11, 2022

Hello @lukaspe1 

I had this problem long time ago. I remember having to put the &gt;leave> tag on directly in the parent form, but at the end, I managed to get it work.

Not sure but try to use sub &gt;container> into your custom built subform. I have working (and complex) subforms just right here so I think it works, but don't have any exact rules to give 😞

 

Cedric

 

LukasPe1
LukasPe1Author
Level 3
February 3, 2023

Thanks for pointing out that it should be possible. I gave up last time, spending too many hours to solve this.
So now that I have forgotten how frustrated I was last time, I decided to give it a new try.
However I am still struggling. I have managed to refer to my custom leave-tag, from the oob input form, explicitly in this way:

 

<leave ref="test:offer:leave"> <check expr="![category/env/@live]"> <error>You may not make changes to an offer in production.</error> </check> .... <leave/>

 

The problem is that everything inside the leave tag in the OOB input form is "overwritten" by my custom referenced leave tag. So for example, when referencing from the OOB nmsoffer input form, like the example above, I am able to edit offers in the live environment without error messages.

I have found a similar OOB example in the landingPageWiz.xml (./nl6/datakit/crm/eng/form/landingPageWiz.xml) where this type of reference is made (open leave-tag with reference along with other content), but I don't now how to test if that works or not:

<leave ref="crm:landingPage:leave"> <if expr="[/ignored/selectedFolder]=0"> <if expr="[/ignored/@folderId]!='' AND [/ignored/@folderId]!=0"> <set xpath="@folder-id" expr="[/ignored/@folderId]"/> </if> <if expr="[/ignored/@operationOrgUnitId]!='' AND [/ignored/@operationOrgUnitId]!=0"> <set xpath="@folder-id" expr="DefaultFolder('crmLandingPage', 0, [/ignored/@operationOrgUnitId])"/> </if> </if> </leave>