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

Access BO from another BO

Hi all,

I have a script in the BeforeSave event under sales quote root.

I would like to pull some data from a contact related to the quote's account.

I can get the contact id from the buyer party, however, there is no other data in this section which can be helpful for me.

(mainly, I want to access some extension fields i created in KUT)

I guess I should link the BP BO to the Sales Quote BO in some way, but I don't know how.

any ideas?

Thanks,

Dror.

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Posted on Nov 16, 2015 at 12:11 PM

    Hi Dror,

    First you need to check the KUT fields you need to access from a contact, using .ref item

    Second you can use below query for buyer party or similar query to pull the data.

    var query2 = Customer.QueryByIdentification;

    var resultData2;

    var selectionParams2 = query2.CreateSelectionParams();

    selectionParams2.Add(query2.UUID.content, "I", "EQ", this.ToRoot.BuyerParty.PartyUUID.content);

    resultData2 = query2.Execute(selectionParams2);

    Regards,

    Ajith

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Nov 17, 2015 at 09:12 PM

    Hi Dror,

    You can access directly to the involved parties of the sales quote. There is a way to take the corresponding Customer by RoleCode.

    var BuyerParty = this.Party.Where(w=>w.RoleCode=="8").GetFirst().Party.Customer;

    if this is not the field, can you attach an Screenshot?

    Thx.

    Add a comment
    10|10000 characters needed characters exceeded

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.