Skip to Content
0

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

Feb 28 at 08:38 PM

77

avatar image

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.

000330.jpg (146.3 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

5 Answers

Best Answer
Aleksei BELOUSOV May 08 at 08:54 AM
0

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

Aleksei

Share
10 |10000 characters needed characters left characters exceeded
Benny Huang Mar 01 at 02:53 AM
0

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

Share
10 |10000 characters needed characters left characters exceeded
Aleksei BELOUSOV Mar 01 at 08:09 AM
0

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.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

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";
	}
}
0

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

0
Lewis Peters Mar 05 at 10:12 AM
0

Aleksei,

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

Lewis

Share
10 |10000 characters needed characters left characters exceeded
Aleksei BELOUSOV Mar 06 at 09:01 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded