Skip to Content
0

Cardinality 1,1

Jul 06, 2017 at 01:01 PM

55

avatar image

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Best Answer
Horst Schaude
Jul 06, 2017 at 01:29 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Aleksei BELOUSOV Jul 06, 2017 at 08:55 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded