Email alert on Maintenance Schedule Detail

Hi

I am setting up email alert for the doc maintenance schedule detail (based on the schedule date). I need to use some details like customer details from the doc Maintenance Schedule. How do i do that?

Thanks
Rasika



You received this message because you are subscribed to the Google Groups “ERPNext User’s Forum” group.

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+un…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-user-forum/0e33a05d-5b1e-4323-b408-3da97dd311ea%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



On 17-Sep-2014, at 10:58 am, Rasika Dhingra <ra...@gmail.com> wrote:

Hi

I am setting up email alert for the doc maintenance schedule detail (based on the schedule date). I need to use some details like customer details from the doc Maintenance Schedule. How do i do that?

You can customize using Jinja Templating 

What do you want specifically?


Thanks
Rasika



You received this message because you are subscribed to the Google Groups “ERPNext User’s Forum” group.

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+un…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-user-forum/0e33a05d-5b1e-4323-b408-3da97dd311ea%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.




You received this message because you are subscribed to the Google Groups “ERPNext User’s Forum” group.

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+un…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-user-forum/756942AA-E662-4102-A661-CCB1CE978D10%40gmail.com.

For more options, visit https://groups.google.com/d/optout.

Using the email alert feature, I am creating an email alert on the Document Type "Maintenance Schedule Detail" for maintenance visit due.

This is what I have written in the message for the email alert

***
{{ doc.item_name }} is scheduled on {{ doc.scheduled_date }}

The details are as below:

Customer - {{ doc.customer }}
Contact Person - {{ doc.contact_person }}

Please take relevant action.

***
However, the fields Customer and Contact Person are a part of the Form "Maintenance Schedule" and not "Maintenance Schedule Detail".

So my query is, whether I can use the customer details from the "Maintenance Schedule" form while creating alert on the "Maintenance Schedule Detail" 

Hope I have been able to clarify it.

Thanks
Rasika

On Wednesday, September 17, 2014 10:58:18 AM UTC+5:30, Rasika Dhingra wrote:
Hi

I am setting up email alert for the doc maintenance schedule detail (based on the schedule date). I need to use some details like customer details from the doc Maintenance Schedule. How do i do that?

Thanks
Rasika



You received this message because you are subscribed to the Google Groups “ERPNext User’s Forum” group.

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+un…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-user-forum/28f03470-2d3c-4409-ae0e-e9e7553a62a2%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

you will have to do this:

```
{% set maintenance_schedule = frappe.get_doc("Maintenance Schedule", doc.parent %}

{{ maintenance_schedule.customer }}
```

try if this works!


On 17-Sep-2014, at 11:51 am, Rasika Dhingra <ra...@gmail.com> wrote:

Using the email alert feature, I am creating an email alert on the Document Type "Maintenance Schedule Detail" for maintenance visit due.

This is what I have written in the message for the email alert

***
{{ doc.item_name }} is scheduled on {{ doc.scheduled_date }}

The details are as below:

Customer - {{ doc.customer }}
Contact Person - {{ doc.contact_person }}

Please take relevant action.

***
However, the fields Customer and Contact Person are a part of the Form "Maintenance Schedule" and not "Maintenance Schedule Detail".

So my query is, whether I can use the customer details from the "Maintenance Schedule" form while creating alert on the "Maintenance Schedule Detail" 

Hope I have been able to clarify it.

Thanks
Rasika

On Wednesday, September 17, 2014 10:58:18 AM UTC+5:30, Rasika Dhingra wrote:
Hi

I am setting up email alert for the doc maintenance schedule detail (based on the schedule date). I need to use some details like customer details from the doc Maintenance Schedule. How do i do that?

Thanks
Rasika



You received this message because you are subscribed to the Google Groups “ERPNext User’s Forum” group.

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+un…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-user-forum/28f03470-2d3c-4409-ae0e-e9e7553a62a2%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.




You received this message because you are subscribed to the Google Groups “ERPNext User’s Forum” group.

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+un…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-user-forum/49C58716-187E-4A4C-BBC9-F93B2EA2ABE0%40gmail.com.

For more options, visit https://groups.google.com/d/optout.

I tried this..it is not working.

There seems to be some syntax error, one parenthesis is missing in the first line.

On Wednesday, September 17, 2014 12:21:18 PM UTC+5:30, Rushabh Mehta wrote:
you will have to do this:

```
{% set maintenance_schedule = frappe.get_doc("Maintenance Schedule", doc.parent %}

{{ maintenance_schedule.customer }}
```

try if this works!


On 17-Sep-2014, at 11:51 am, Rasika Dhingra <ra...@gmail.com> wrote:

Using the email alert feature, I am creating an email alert on the Document Type "Maintenance Schedule Detail" for maintenance visit due.

This is what I have written in the message for the email alert

***
{{ doc.item_name }} is scheduled on {{ doc.scheduled_date }}

The details are as below:

Customer - {{ doc.customer }}
Contact Person - {{ doc.contact_person }}

Please take relevant action.

***
However, the fields Customer and Contact Person are a part of the Form "Maintenance Schedule" and not "Maintenance Schedule Detail".

So my query is, whether I can use the customer details from the "Maintenance Schedule" form while creating alert on the "Maintenance Schedule Detail" 

Hope I have been able to clarify it.

Thanks
Rasika

On Wednesday, September 17, 2014 10:58:18 AM UTC+5:30, Rasika Dhingra wrote:
Hi

I am setting up email alert for the doc maintenance schedule detail (based on the schedule date). I need to use some details like customer details from the doc Maintenance Schedule. How do i do that?

Thanks
Rasika



You received this message because you are subscribed to the Google Groups “ERPNext User’s Forum” group.

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+un…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-user-forum/28f03470-2d3c-4409-ae0e-e9e7553a62a2%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.



  1. Please be kind and don't send large attachments
  2. For issues, features requests use https://github.com/frappe/erpnext/issues



    You received this message because you are subscribed to the Google Groups “ERPNext User’s Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-user-forum/33c86fb6-4b13-4da9-a607-cf3590d2b9e1%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
```
{% set maintenance_schedule = frappe.get_doc("Maintenance Schedule", doc.parent) %}

{{ maintenance_schedule.customer }}
```



@rushabh_mehta

On 28-Sep-2014, at 7:05 pm, Rasika Dhingra <ra...@gmail.com> wrote:

I tried this..it is not working.

There seems to be some syntax error, one parenthesis is missing in the first line.

On Wednesday, September 17, 2014 12:21:18 PM UTC+5:30, Rushabh Mehta wrote:
you will have to do this:

```
{% set maintenance_schedule = frappe.get_doc("Maintenance Schedule", doc.parent %}

{{ maintenance_schedule.customer }}
```

try if this works!


On 17-Sep-2014, at 11:51 am, Rasika Dhingra <rasik...@gmail.com> wrote:

Using the email alert feature, I am creating an email alert on the Document Type "Maintenance Schedule Detail" for maintenance visit due.

This is what I have written in the message for the email alert

***
{{ doc.item_name }} is scheduled on {{ doc.scheduled_date }}

The details are as below:

Customer - {{ doc.customer }}
Contact Person - {{ doc.contact_person }}

Please take relevant action.

***
However, the fields Customer and Contact Person are a part of the Form "Maintenance Schedule" and not "Maintenance Schedule Detail".

So my query is, whether I can use the customer details from the "Maintenance Schedule" form while creating alert on the "Maintenance Schedule Detail" 

Hope I have been able to clarify it.

Thanks
Rasika

On Wednesday, September 17, 2014 10:58:18 AM UTC+5:30, Rasika Dhingra wrote:
Hi

I am setting up email alert for the doc maintenance schedule detail (based on the schedule date). I need to use some details like customer details from the doc Maintenance Schedule. How do i do that?

Thanks
Rasika

-- 
You received this message because you are subscribed to the Google Groups "ERPNext User's Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email toerpnext-user-forum+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-user-forum/28f03470-2d3c-4409-ae0e-e9e7553a62a2%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


-- 
1. Please be kind and don't send large attachments
2. For issues, features requests use https://github.com/frappe/erpnext/issues
--- 
You received this message because you are subscribed to the Google Groups "ERPNext User's Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email toerpnext-user-forum+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-user-forum/33c86fb6-4b13-4da9-a607-cf3590d2b9e1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


  1. Please be kind and don't send large attachments
  2. For issues, features requests use https://github.com/frappe/erpnext/issues



    You received this message because you are subscribed to the Google Groups “ERPNext User’s Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-user-forum/DD17BA17-E12D-4C20-8BD7-C2ECCF26695E%40gmail.com.

    For more options, visit https://groups.google.com/d/optout.

I have tried this, it is not working.

I received the following scheduler error.

Scheduler Errors
LARAON Engineers & Consultants Pvt. Ltd.
03-10-2014


System
Scheduler Failed Events (max 10):

URL: http://laraon.frappecloud.com


Time: 2014-10-03 00:08:47.789870

Method: frappe.core.doctype.email_alert.email_alert.trigger_daily_alerts
Method: daily, Handler: frappe.core.doctype.emailalert.emailalert.triggerdailyalerts Traceback (innermost last): File “/home/frappe/press/benches/1409261320/apps/frappe/frappe/tasks.py”, line 77, in schedulertask frappe.getattr(handler)() File “/home/frappe/press/benches/1409261320/apps/frappe/frappe/core/doctype/emailalert/emailalert.py”, line 23, in triggerdailyalerts triggeremailalerts(None, “Date Change”) File “/home/frappe/press/benches/1409261320/apps/frappe/frappe/core/doctype/emailalert/emailalert.py”, line 41, in triggeremailalerts alert, “Date Change”) File “/home/frappe/press/benches/1409261320/apps/frappe/frappe/core/doctype/emailalert/emailalert.py”, line 95, in evaluatealert message= frappe.rendertemplate(template, {“doc”: doc, “alert”:alert}), File “/home/frappe/press/benches/1409261320/apps/frappe/frappe/utils/jinja.py”, line 28, in rendertemplate return template.render(**context) File “/home/frappe/press/benches/1409261320/env/lib/python2.7/site-packages/jinja2/environment.py”, line 969, in render return self.environment.handleexception(excinfo, True) File “/home/frappe/press/benches/1409261320/env/lib/python2.7/site-packages/jinja2/environment.py”, line 742, in handleexception reraise(exctype, excvalue, tb) File “”, line 5, in top-level template code File “/home/frappe/press/benches/1409261320/env/lib/python2.7/site-packages/jinja2/environment.py”, line 397, in getattr return getattr(obj, attribute) UndefinedError: ‘frappe’ is undefined

Please suggest.

Thanks
Rasika

@rasika25021 thanks for reporting - seems like an issue. Can you post this to GitHub?

This issue has been solved.

Thanks for your help.

Rasika