guys i am problem where i have two doctypes “Supplier” and another called “Event” we have option to create event when creating a new supplier and we can also create event directly.
What I need is to detect if new Event form was initiated by Supplier doctype or was directly triggered by using url.
If initiated from Supplier doctype , I want to make changes in new Event form field, like adding filters in dropdown field and marking a checkbox field. I tried changing client script of Event doctype onload but I dont have any method to track if new event form was initiated by Supplier doctype.
Pretty sure there must be a reference document or a field referencing the supplier somewhere in the events document.
You need to write a server script that checks if the event is created by (or for?) the supplier and automatically check the check boxes.
As for the dynamic options, client script should do the trick. (Using the same conditions as the server script).
1 Like
hi thanks for answering just to give you more clarity , see the image
this event reference field is linked with Event Doctype it fetches all existing events and you also get option to even create a new event . And when a new event is created like this from reference field, I want to mark the checkbox and apply filter on committee field . So how to implement this ,
A better design would be to create events via custom button triggers, that way you can set up whatever fields you need to be populated from the previous document.
The options for the committee field would anyhow have to be placed in an events.js (via hooks).
I’m not sure if we can modify the “create new event” trigger from the link field to auto fetch certain fields to the new form.
1 Like