I am new to custom scripting that’s why need some help.
Let me explain my problem,
What I want is to create a filter which can filter out customer email ID based on 5 parameters and add them to email group member doctype.
- Country (Address Doctype)
- City (Address Doctype)
- Intent (Session History Collection Doctype)
- Package (Session History Collection Doctype)
- From Date (Session History Collection Doctype)
- To Date (Session History Collection Doctype)
So there are 2 doctypes I want to filter out customer email from.
First is Address doctype.
From here City and Country will be used as filters.
And second is Session History Collection doctype which is a doctype I created.
From here Intent, Package/Service of interest and current date time will be used as filters.
Now, here is the Filter doctype.
I want to write a custom script or to know a way so that when I add these filters (Its not mandatory to fill all or any filters) and hit save It first runs through address doctype and session history collection doctype and get email ID which fulfill all the present filters.
I am thinking what we can do is first get the list of email ID from address doctype then get another list of email ID from session history collection doctype and then check whichever email ID is present in both list can be used as final email.
After then we will be having a list of email ID then as we also have mentioned email group it create that many email group member in email group member doctype.
Thank you for your time.
Any help is appreciated Thank you.