Hey guys,
So I created a new Doctype named Guests which has a simple form to fill in some information.
The Guests doctype is set as a table in Event doctype and is basically filled in from there. However, the table field “name” I would like to make it searchable to be able to create new names or search and select already existing ones.
In the guest doctype, there will be a field called “Name”. Set its type as “Link”. Then in Options, put in the name of the doctype you want the information from (search the names from).
That’s for basic links but I want to do something else.
In the Event doctype, the table is already a link to the Guests. The guests details are added when creating an event. The text field “name” appearing from Guests must be searchable … so the link must be from inside the event doctype
So I am thinking if there is a specific code to add to be able to link a specific field from an already linked table in a doctype.
I hope I make sense what I want to accomplish haha
The problem with creating another Name doctype is this:
The data is entered from within the Event doctype - the employees will never enter the data from within the Custom Doctype.
So if I make another name doctype, how do I link it inside the Event doctype as well ? Also, in the Event doctype I would like to automatically fetch specific fields related to that specific “name” record previously added
The problem is, if you have a returning guest who is already in the records, you cannot add him again. So you must search for the guest… that’s why I want the name field to be searchable.
You cannot add the same name if it’s already added some time before…
That’s because you have many-to-many relationship between Guest and Event. You have to create an additional linking table to model this relationship. Then, when you create a new Event you will be filling this new link table on the Event form with the Guest data you will be able to search for or create anew.
The problem will be your buisiness requirement that your employees shoud only be able to fill in the Guest data from the Event form. You will need to write custom logic, which will intercept the data you enter in the link table on the Event form and will handle creation of the new Guest entries without redirecting the user to the Guest entry form.