Production Planing reference in material request?

Hi Everyone.

We are Planing to use Production planning to handle our manufacturing process, but it seems like there is not reference for the Production planning document in the material request document.

How to link that so we can know that material request for which production plan?

It is under Material Request Item Table (Child table)

Yes, But it is not showing in the main document which is from my point of view weird, specially that we are using a production planing tool to create this material request.

It is not weird. The purpose to add the reference in the table is that you can create a Material Request from multiple Production Plans. Each line item will have its own reference link.

In your case, you can simply create a custom field for reference and copy the production plan value from the table into it using a custom script if you’re likely to have a 1:1 relationship.

1 Like

Here’s a custom script to achieve this.
Assuming that you have created a custom field “Prod Plan Reference” on material request form, the script will get the Production Plan value from the items table’s first row and set it in the reference field.
Note : This script has to be added “BEFORE INSERT”

Get the value of the Production Plan field.

production_plan_name = doc.items[0].production_plan

set the value of the Prod Plan Reference field.

doc.prod_plan_reference= production_plan_name

Additional note : dont set the custom field name as “Production Plan”. the script will still work, but when you will use the connection on the production plan form to go to Material Request, it will not filter properly.

Hope this helps.