Skip to Content
author's profile photo Former Member
Former Member

How to get values of association?

Hi Team,

I would like to know how to get values of an association through ABSL in afterModify or in an action .

for example: In Activity BO this. returns only values in the root node and not the values of the associations. I would like to get the values of the ActivityParty association. Can someone let me know how we can achieve this?

I already tried to navigate through to the association. But then it does not return the value.

below is my code. My logic to get the association value is in red.

import ABSL;

import AP.FO.Activity.Global;

//this.TypeCode = "86";

//this.SendSMS = true;

//this.PhoneActivityCat = "value Test";

//this.Descp = "";

var Query = CustomTemplate.QueryByElements;

var selectionParams = Query.CreateSelectionParams();

selectionParams.Add(Query.templateID, "I", "EQ", this.Descp);

var Result = Query.Execute(selectionParams);

foreach (var template in Result){

var text = template.TemplateText;

var desc = template.TemaplateDecscription;

var PhQuery = Activity.QueryByElements;

var PhSelectionParams = PhQuery.CreateSelectionParams();

PhSelectionParams.Add(PhQuery.ID, "I", "EQ", this.ID);

var PhResult = PhQuery.Execute(PhSelectionParams);

if (this.ActivityParty.Party.BusinessPartner.Count() != 0){

var cont = this.ActivityParty.Party.Name;

}

text.Replace("#Customer#", "Paul");

}

Acivity.PNG (43.3 kB)
Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Sep 13, 2016 at 07:34 AM

    Hi Indrakumar Jayachandran,

    ActivityParty is a collection, so you have several instances. You could use a foreach loop to run through all instances, or you could use GetFirst or GetLast, or try to identify the party that you want, by role code, for eample.

    Best regards,

    Uwe

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Indra,

      I think you are using a FSI query in your code, means you have created the query at the BO with right-click create query.

      In this case, the query.Execute() will only give you root data. I have made the experience that you can access the association if you use the .ToParent of the items in your result.

      Best regards,

      Uwe

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.