Skip to Content

Cardinality 1,1

Hi,

I need the detail (internal) node has strictly one instance in the master (root) node.

A list on my screen must contain an only row.

So, I have used cardinality [1,1] meaning during creating an instance of the BO will automatically be created one instance of the detail node.

node SetUpCosts [1,1] {

element Operation: LANGUAGEINDEPENDENT_MEDIUM_Name = "Setup";

element MainResource: LANGUAGEINDEPENDENT_MEDIUM_Name;

}

However, it works in some other way.

Is it possible to create the node automatically while a BO instance is creating?

Thank you.

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Best Answer
    Jul 06, 2017 at 01:29 PM

    Hello Aleksei,

    If you spend some ABSL code on the Root node: Yes.
    But you need to do it by your own. Theres is no automatism here.

    Sorry,
    . Horst

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 06, 2017 at 08:55 PM

    Thank you, Horst

    I found the code

    For [1,1] it can be such:

    in Root: Event-AfterModify

    import ABSL;
    if ( !this.SetUpCosts.IsSet() ) {
      this.SetUpCosts.Create();
    }
    return;

    For [0,n] (what can be more practical) it also works with a small change:

    import ABSL;
    if ( this.SetUpCosts.Count() == 0 ) {
      this.SetUpCosts.Create();
    }
    return;

    Best regards,

    Aleksei

    Add comment
    10|10000 characters needed characters exceeded