cancel
Showing results for 
Search instead for 
Did you mean: 

Reading data from Association / Updating

former_member226070
Participant
0 Kudos

Hi  Experts,

[1] - Small question ....

In my XBO component i want to read the Opportunity data for example OrganisationalUnit [CO_2101] - I can see it during debugging but how can i use it in a custom field.

It must be something like   var orgunit = OrgansUnit.ID;   but what I'm doing wrong pfffff  (some code examples would be useful).

[2] - What is the easiest way to Update - a field in a BO  (from an other Custom BO) - which is created by the KeyUserTool in the UI.

Regards,

Jeroen Cosijnse

Accepted Solutions (0)

Answers (4)

Answers (4)

victorsilva
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Jeroen,

1. You'd need to create a new element in your extension BO. Associations cannot be used on BO Extensions yet.

element {name} : {datatype};

2. You will need to create a "References to Customer-Specific fields", which you can include all KUT fields.

Note that when you select your KUT fields, it indicates also the node where it is located.

Best regards,

Victor Silva

Former Member
0 Kudos

Hello Jeroen,

1 - If you have the OrganizationUnit ID you can get its information using Retrive method. Import the correct namespace (i think is something like "import AP.FO.MOM.Global;") and type "OrganisationalUnit.Retrieve(params);". You also can use the available query "QueryByIDAndName" (see the BO documentation);

2- I think you can't access a field created in KUT in absl code;

Regards,

Alexandre.

former_member186648
Active Contributor
0 Kudos

In KUT you cannot create XBO, hence cannot have extension field.

But, In the BO events(AfterModify...) you can access other BO and then modify it.


Thanks, Pradeep.

Former Member
0 Kudos

Exactly, but in KUT you can create fields and these fields you can't access in absl code, right?

Alexandre.

astrid_burghart
Participant
0 Kudos

Hi Alexandre,

you can add a Customer Object References in the Studio once.

There you can select all Field which are created via KUT.

Then it is possible to access them also via Studio.

You will also need this, if you want to deploy a KUT Field to another Tenant, so you don't have to create them twice.

(This works for fields in XBOs. I didn't tried for fields from Custom BOs.)

Best regards,

Astrid

Former Member
0 Kudos

Hi Astrid!

Very interesting! I thought it was not possible. I've never seen this option..hehe

Thanks for the info. \o/

astrid_burghart
Participant
0 Kudos

Hi Jeroen,

the association to RootOrganisationalUnit is a 0 to n association.

When you want to read the data of the first object you can try:

     OrganisationUnit.GetFirst();

If you have more than one result, use foreach:

     foreach(var element in Orgunit)

I hope this helps.

Best regards,

Astrid

Former Member
0 Kudos

For the first question:

add a custom field in your xbo definition with the keyword:

element <fieldname> : <type>;

in your absl:

<fieldname> = OrgansUnit.ID;

For the second question I can't help you because I never used KUT to create BOs