If I need to store the most recent PO item rate per item in a custom item field (which is triggered by a PO creation or edit), what is likely the best script type to use? Is this a use case for a M/R?
r
raghav
04/22/2023, 8:52 AM
Userevent. Entry point after submit.
l
Luis
04/22/2023, 8:55 AM
Would it be a problem if there are a lot of items in the PO - sometimes up to 50?
r
raghav
04/22/2023, 8:58 AM
User event governance usage is 1000.
1000/ submit field api usage.
Or 1000/ load and save usage.
Depending upon how you are building your solution.
Post that you script will fail.
If 1000 governance usage is less for you.
Then you can put a check in place in the user event, if the linecount is more than x amount of lines, Then call a MR script through the user event using the task module.
b
battk
04/22/2023, 9:03 AM
the map/reduce is more sane performance wise
battk
04/22/2023, 9:03 AM
you dont want to modify 50 records in a user event script
battk
04/22/2023, 9:08 AM
in general the user event will also have to deal with concurrency issues if you have multiple purchase orders created at the same time, this is made worse if you do the hybrid route with the map/rerduce
r
raghav
04/22/2023, 9:13 AM
If you have only map reduce running let's say every 15 minutes based on some criteria.
Then you can have a bigger chance that your item record did not have the latest amount. And whatever business implementation you were trying to build with the custom rate field in the item record did not use the latest amount when you created a new transaction with that item.
All this will depend upon the frequency of the purchase order the system is creating.
And how many items the PO has on average.
And what you are trying to do with your custom rate field.
That is my opinion.
Going with a schedule MR will be more sane approach if POs are getting created too often so you don't hit concurrency issues