cancel
Showing results for 
Search instead for 
Did you mean: 

Question about the BOOperation READ in the UI Designer

Former Member
0 Kudos

Hi,

I just noticed that the BOOperation Read in the UI Designer can use the NodeID, the KeyNavigation and the alternativeKey.

About the AlternativeKey I have no doubts... but what about the NodeID and the KeyNavigation? Can somebody explain me the differences between these keys?

Accepted Solutions (1)

Accepted Solutions (1)

Jens-Limbach
Advisor
Advisor

Hi Alessandro,

this depends which key is available in the outport (i.e. when you want to connect an embedded component).

Example:

- AlternativeKey - Use it when you got the InternalID of the customer BO in the outport

- KeyNavigation - Use this if you have only the UUID of the customer BO in the outport

- NodeID - Use this if you have the NodeID of the customer BO in the outport

Usually I only use the first 2 options. There are some standard screens that do not offer the AlternativeKey but only the UUID in the outport, then you need to use KeyNavigation.

Btw: KeyNavigation requires a data structure with a data field in your data model. But it works similar then with Alternative Key.

Cheers,
Jens

Former Member
0 Kudos

Thank you Jens!

Almost clear, just the last question: I don't understand so well what is the NodeID, can you explain me in details?

Jens-Limbach
Advisor
Advisor
0 Kudos

It is one of the 3 kinds of primary keys you can have for any instance of any business object. Basically it is in most cases the UUID of the node.

Example:

Sales Quote has this on root level, but also every item has a NodeID (which holds basically the UUID of the item). The line item id could never identify a node across many sales quotes because it is only unique for one specific sales quote. I believe that is the reason why there is also a NodeID. Technically the item node is just a table of all items in the system across all sales quotes.

: Correct me if I am wrong

Cheers,
Jens

Former Member
0 Kudos

So how to distinguish when to use the KeyNavigation and the NodeID if both are UUID?

Former Member
0 Kudos

NodeID is the UUID of the Node. It works even if you send in UUID in the Read operation.

Well, as far as keyNavigation is concerned, I see the situation more in this way.

The outport which is fired in the source screen will have the column called Key. It doesn't necessarily need to be UUID there. When you use Key there in first screen, you should use keyNavigation in the subsequent Inport of your second screen.

Former Member
0 Kudos

Thank you all guys

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Jens,

You're right.

Example:

SalesOrder 15 with Items 10 and 20

SalesOrder 26 with Items 10 and 11

For the later Item 10 you need the SalesOrder to identify it.

So, you use a compund Alternative Key (SalesOrder / Item = 26 / 11) or define a new one which identifies this Item node => That's the NodeID

Add. to Srivastava:

Yes, in most cases it is a UUID, but it must not be one.

HTH,

    Horst

Former Member
0 Kudos

That's interesting. Thanks for the clarification. Why aren't all these features not documented? Coz I am afraid that with all these undocumented features, we believe what we see. LOOOL.

Former Member
0 Kudos

Hi Horst,

could you please post an example of how to make it?

Thanks,

M.

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Marco,

Structured Alternative Keys are not supported by the Studio.

As workaround you can use some String data type and concatenate in an ABSL snippet all values you need for the Alternative Key.

HTH,

   Horst

Former Member
0 Kudos

That's not a good news for me...:(

So if i've a scenario like the follow:


Example:

CustomerQuote 15 with Items 10 and 20

CustomerQuote 26 with Items 10 and 11

For the later Item 10 you need the CustomerQuote to identify it.

So, you use a compund Alternative Key (CustomerQuote / Item = 26 / 11) or define a new one which identifies this Item node => That's the NodeID

how can i use the NodeID to access the item selected by the user?

I cant' understand how to do that inside a Custom BO (containing a AdvancedListPane) that i want to relate to a standard BO, in particular CustomerQuote.

HorstSchaude
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Marco,

First: You add an new

     element MyItemKey : LANGUAGEINDEPENDENT_Name;

to your node Item.

Second: You define an AfterModify ABSL snippet for the Item node like

if (MyItemKey.IsInitial() = True)

  MyItemKey = this.ToParent.ID.Concatenate( this.ItemID) );

Third: In the UIDesigner you bind the following elements from the Item node to your list

  • NodeID
  • MyItemKey
    plus
  • A structure with the elements Root-ID and Item-ItemID

Now you can use all 3 flavours for the outport mentuioned by Jens on April 4th.

HTH,

   Horst

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Alessandro,

you mentioned about AlternativeKey you have no doubts. Maybe you can explain it to me.

I have a Custom BO with 1:1 relation to Customer. Custom BO has an alternativeKey on CustomerID.

I bind my Embedded Component to the Customer-UI with the CustomerID and the eventHandler should make a BOOperation READ with alternativeKey CustomerID on my CustomBO.

For me that doesn't work. I put some code in the After-Modify and query my Custom BO and get the data I need. But it seems that the read in the eventHandler doesn't find anything.

Do you have an example on how to do that?

kind regards,

Frank

Former Member
0 Kudos

Can you send me some screenshots of your solution that is not working?

Former Member
0 Kudos

Hi Alessandro,

I created a custom BO:

businessobject StudioInformationHandler {
[AlternativeKey] element CustomerUUID : UUID;
element CustomerID : ID;
association ToCustomer to Customer;
association ToStudioInformation to StudioInformation;
}

That is an add-on to the customer.

I made an embedded component for the customer based on this BO. The EC has the CustomerUUID and CustomerID in the inport. In the event handler I try to read the BO instance with BOOperation.

When debugging my script in After-Modify I expect to have the persistent instance, but I have a new one. I can query my BO and get the persistent instance.

I think I make a mistake in the BOOperation but I don't know what's wrong. Another suggestion is that data binding in my EC is not as expected.

I attach a screenshot from my event handler and from the data model.

The CustomerID is not used at the moment. I tried it with the ID and UUID, but both didn't work for me.

I think there is something I didn't understand yet.

kind regards,

Frank

Former Member
0 Kudos

It seems all ok.

1) stupid question: have you created the instance of your custom Bo before trying to read it?

2) did you enable the two properties on the inbound plug 'autorefire' and the other one that at the moment I don't remember?

Former Member
0 Kudos

1) yes, I can see it with the query

2) yes, both

I tried with another Custom BO, but without associations. That works. Seems that it cannot handle associations.

But then I got other problems:

- the instance is loaded, but it seems that the systems wants to create a new instance with the same ID and that results in an error message

- if there is no instance to load (new entry), I get a message that nothing is loaded. Not usefull for the user.

So, I will go back to my ABSL coding. Seems that the READ operation is not intended to use in this way.

kind regards

Frank

Former Member
0 Kudos

Try to remove the bindings of the two fields

InportCustomerId

and

InportCustomerUUID

they should be filled via the inport and not with the binding. Maybe this is creating problems

Former Member
0 Kudos

Hi Alessandro,

I removed that binding and it works now.

For creation of a new instance I added a script to my event to fill the BO-fields with the Inport-Fields.

I'm not sure if that is the best solution but it seems to work.

Best regards,

Frank

Former Member
0 Kudos

It is better if you make the creation in the before save event because if another user try to lock the object at the same time you will get some problems.

Former Member
0 Kudos

In the HTML5 UI there is an edit button, that would be a good place for my script. But I didn't find any event for this button in the UI Designer. Do you know if it's possible to put an action (script) on it?

regards,

Frank

Former Member
0 Kudos

Try to see if in the UI designer there is an outport related to the button event.

I never did devs on html5 uis sorry