cancel
Showing results for 
Search instead for 
Did you mean: 

update Purchase request when adding new internal request

tamir_moshe
Participant
0 Kudos

Hello,

once user enter an internal request (shopping cart), we need to track the related purchase request that was created from this shopping cart and update one of the fields in the PR created,

I wonder if this is possible to do via ABSL Code.

This is what i try to code to find the related PR (see screen shot)

Can someone give me a direction if this is possible, and what the correct way to do this ?

Accepted Solutions (0)

Answers (2)

Answers (2)

tamir_moshe
Participant
0 Kudos

Thanks for you reply, it was very helpful

Now i can catch the PR with BeforeSave and trace back the shopping cart as well !

the next step is to update then Planning group of the PR from an extension field from the shopping cart, How can i do this ?

I'm expecting something like :

foreach (var Line in this.Item )

{

Line.????? =ShppingCart.Item.GetByIndex(i).PlanningGroupID;

i=i+1;

}

former_member183363
Active Contributor
0 Kudos

Sort of --- you'll need to use both the ID and the item ID in the document references to match off the corresponding items, then you can filter and get the value of your extension field.

former_member183363
Active Contributor
0 Kudos

Tamir,

Using OnSave won't work as all the fields are read-only. What I suggest is having a script on either the AfterModify or BeforeSave of the purchase request which looks at the document references --- either the root or item node may well have a reference to the shopping cart that you can look up.

Lewis

tamir_moshe
Participant
0 Kudos

Thanks for you reply, it was very helpful

Now i can catch the PR with BeforeSave and trace back the shopping cart as well !

the next step is to update then Planning group of the PR from an extension field from the shopping cart, How can i do this ?

I'm expecting something like :

foreach (var Line in this.Item )

{

Line.????? =ShppingCart.Item.GetByIndex(i).PlanningGroupID;

i=i+1;

}