cancel
Showing results for 
Search instead for 
Did you mean: 

Access BO from another BO

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (2)

Answers (2)

pablo_daniel
Participant
0 Kudos

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.

A-J-S
Active Participant
0 Kudos

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