Making Projects Field Mandatory in Material Request Item (child Table) based on Material Request Type selected on Material Request form (Parent Table)

Hi,

I want to make Project Field Mandatory at Material Request Item (Child Table) if Material_Request_Type is selected as ‘Material Issue’ on Material Request (Parent Form).

Thanks in Advance,
Syed Mustafa Arshad

You a to make a custom server script on validate/beforeSubmit event
https://frappe.io/frappejs/docs/models/controllers.md

There is no easy way to do it from front end? Like using DEPENDENT ON condition functionality? I can make it dependent if value is within same table, cant I do it across parent table?

I’m not sure if it’s possible with “Depend On”.
But you can create a custom script from front end in Customization->Client Script ‘https://yourerpnexturl/app/client-script

you can use js expression like below, the check is triggered when click submit button.

eval:parent.material_request_type ==="Purchase"

image

1 Like

Shall I use it in dependent field of Project field?