cancel
Showing results for 
Search instead for 
Did you mean: 

How to populate Buyer Responsible fields in BO Purchase Request by our own values (ByD)?

abelousov
Active Participant
0 Kudos

Dear experts,

We would like to have our own values in fields Buyer Responsible ID / Name of Purchase Request. There is some ByD standard functionality that populates these fields (during creating PR), but we want to use our own algorithm. Is that feasible (in principle) to implement via some development?

Thank you.

Accepted Solutions (1)

Accepted Solutions (1)

abelousov
Active Participant
0 Kudos

After all I created my own (extension) fields BuyerResponsibleID2 and BuyerResponsibleName2 to maintain the needed functionality.

Aleksei

Answers (4)

Answers (4)

abelousov
Active Participant
0 Kudos

Hello Lewis,

It does not suit.

We need to prevent creating a Purchase Order by anyone but who we set in the Purchase Request.

P.S. It seems some mess occurred with text types in BO extensions. I am totally confused.

What data type should I now use for Employee Name, for example?

Aleksei

former_member183363
Active Contributor
0 Kudos

Aleksei,

What about trying to change it on the purchase order itself, before it's released?

Lewis

abelousov
Active Participant
0 Kudos

Thank you Benny,

Yes, the elements look accessible to modify but

I tried to change the value of field Buyer Responsible ID in a Purchase Request via Root-Event-BeforeSave.absl:

import ABSL;

foreach ( var item in this.Item ) {
	if ( item.EmployeeResponsibleItemParty.IsSet() ) {
		item.EmployeeResponsibleItemParty.PartyKey.PartyID.content = "7000022";
	}
}


Unfortunately, without any effect. There were no changes in the Purchase Request after that.

I also tried changing via element item.ItemParty , or adding and deleting an instance of ItemParty collection, but all the same - no changes.

var itemPartyData : elementsof item.ItemParty;
itemPartyData.PartyKey.PartyID.content = "7000022";
var itemParty = item.ItemParty.Create ( itemPartyData );
//itemParty.PartyKey.PartyTypeCode = "147";

Element itemParty.PartyKey.PartyTypeCode appeared to be Read-Only at all.

former_member200995
Contributor
0 Kudos

Hi Aleksei,

I test your code, it is ok.

import ABSL;

foreach ( var item in this.Item ) {
	if ( item.EmployeeResponsibleItemParty.IsSet() ) {
		item.EmployeeResponsibleItemParty.PartyKey.PartyID.content = "7000022";
	}
}
abelousov
Active Participant
0 Kudos

Hi Benny,

There were no errors appeared, but the value does not change anyway.

Nevertheless we found some workaround for our goal.

Best wishes

Aleksei

former_member200995
Contributor
0 Kudos

Hi Aleksei,

I think it is possible.

The node EmployeeResponsibleItemParty is for the Buyer Responsible in PurchaseRequest.

It depends on your algorithm, and the follow up requirement.

Best Regards,

Benny Huang