Aditya, I can’t understand if you can get the communication or the content of the communication
But in the same cases you should be use a SQL Query, like as bellow.
SELECT
`content`
FROM `tabCommunication`
WHERE
`communication_date`=MAX(`communication_date`)
AND `parent`="%s" AND `parentname`="%s"
you shoul pass the Doctype (Lead or Customer) and the Name of doctype as parameters to the SQL and run it with webnotes.conn.sql
--
Note:
If you are posting an issue,
1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/1c3d9fdc-35cf-41df-83db-fec61e3cea0f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/1c3d9fdc-35cf-41df-83db-fec61e3cea0f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Aditya, parentname
is wrong the correct name of the field is parent
, and the correct logic for the parent is parenttype
eg:
SQL = """
SELECT `content` FROM `tabCommunication` WHERE `communication_date` = MAX ( ` communication_date` ) AND `parenttype` = "%s" AND `parentname` = "%s
""""
for row in data:
last = webnotes.conn.sql(SQL, ( filters["doctype"], row['name']), as_dict=True)
row["your_field_name"] = last["content"]
About the default fields, you can view it here: https://github.com/webnotes/wnframework/blob/develop/webnotes/model/db_schema.py#L36
Below one reference about each fieldname:
parenttype (ref): The type of the parent eg: for the Sales Order Item the parent type is Sales Order
(ref): These fields are used for Table
fields.
About the format of the field_content I think that the content is stored “as it is”, it isn’t a good way, because formatation problems, and interface compatibility, if you don’t have a problem with raw formats, I recommended to you the use of markdown to show the content
as raw text, and use a popup to show the content formated to user on report only when the user click on the field.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/af0da68a-d57c-4b54-8019-e2abdaf9ae3e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsubscr...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/1c3d9fdc-35cf-41df-83db-fec61e3cea0f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
Note:
If you are posting an issue,
1. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
3. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
End of Note
---
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/af0da68a-d57c-4b54-8019-e2abdaf9ae3e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.