How to link a DocType with Communication History

162 views
Skip to first unread message

Gowrav

unread,
Dec 25, 2012, 11:34:46 AM12/25/12
to erpnext-dev...@googlegroups.com
Hi
I am very near of my first (not best but okey) module in HR :: Job Applicants

Now I want to add a communication history in this module..

???? :: Which type leads to communication histroy for this applicant ...

What else we have to take care for communication link adding ...

Seen other modules but there is just HTML type for communication, so not understood ...

Rushabh Mehta

unread,
Dec 25, 2012, 11:36:50 AM12/25/12
to erpnext-dev...@googlegroups.com
Great,

Communication is embedded as a javascript object and not directly via DocType

see the cur_frm.refresh method in Lead to get a better idea


W: https://erpnext.com
T: @rushabh_mehta

--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To unsubscribe from this group, send email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/nRiI7UMcibAJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Anand Doshi

unread,
Dec 25, 2012, 11:40:35 AM12/25/12
to ERPNext Developer's Forum

Hi,

HTML field type allows you to render anything in HTML. You will need to see lead.js for an example on how to load communication thread in a given form.

(You might encounter wn.require(...) - it attaches another file's js code into current file.. sort of import in python)

Also, you will need to add a link field in Communication to be able to connect communication in your new DocType.

Thanks,
Anand.

--

Gowrav Vishwakarma

unread,
Dec 25, 2012, 11:55:06 AM12/25/12
to erpnext-dev...@googlegroups.com
Okey,
it will take a bit ...

in my module app/hr/job_applicants

created a file named
job_applicants.js

and pasted the code


cur_frm.cscript.refresh = function(doc, cdt, cdn) {
alert('Hi');
    cur_frm.cscript.refresh_custom_buttons(doc);
    erpnext.hide_naming_series();

    cur_frm.communication_view = new wn.views.CommunicationList({
        list: wn.model.get("Communication", {"lead": doc.name}),
        parent: cur_frm.fields_dict.communication_html.wrapper,
        doc: doc,
        recipients: doc.email_id
    })
}

but I don't think it is executing as a simple alert is also not getting executed ...
help is needed 
--
Regards

Gowrav Vishwakarma
Man of Affairs, Digital Vish, Xavoc International
http://www.digitlavish.com : +91 9783807100
http://www.xavoc.com

--------------------------------------------------------------------
Never Never Never Never Never Never Never Never Never Never Never Never Never Never Never  GIVE UP

Gowrav Vishwakarma

unread,
Dec 25, 2012, 11:58:10 AM12/25/12
to erpnext-dev...@googlegroups.com
And yes I did made a field with name 'communication_html' of type HTML in doctype

Rushabh Mehta

unread,
Dec 25, 2012, 12:02:38 PM12/25/12
to erpnext-dev...@googlegroups.com
You must do Tools -> Clear Cache & Refresh when you change client side code in DocTypes

Gowrav

unread,
Dec 25, 2012, 12:12:28 PM12/25/12
to erpnext-dev...@googlegroups.com
Done by removing the bold line


cur_frm.cscript.refresh = function(doc, cdt, cdn) {

    cur_frm.cscript.refresh_custom_buttons(doc); //deleted
    erpnext.hide_naming_series();

    cur_frm.communication_view = new wn.views.CommunicationList({
        list: wn.model.get("Communication", {"job_applicant": doc.name}), //changed

        parent: cur_frm.fields_dict.communication_html.wrapper,
        doc: doc,
        recipients: doc.email_id
    })
}

and made a link in communication for job_applicant

Now I want to get default Email of Applicant in Add Communication form ...

Gowrav

unread,
Dec 25, 2012, 12:18:18 PM12/25/12
to erpnext-dev...@googlegroups.com
Done

For Others here is description


cur_frm.cscript.refresh = function(doc, cdt, cdn) {
    cur_frm.communication_view = new wn.views.CommunicationList({
        list: wn.model.get("Communication", {"job_applicant": doc.name}),
        parent: cur_frm.fields_dict.communication_html.wrapper,
        doc: doc,
        recipients: doc.Your_forms_Email_Field_name
    })
}

Gowrav

unread,
Dec 25, 2012, 1:00:03 PM12/25/12
to erpnext-dev...@googlegroups.com
Now Another problem ...
I am able to send email too

but a few problems are getting me into frustration now

1) on communication done it saves LEAD link and APPLICANT link both in table while I am not sending Lead value
2) If I removes lead from database (set null) then communication is shown on applicatnts page
3) if i close and reopens all okey, but once refreshed page the communication is not shown any more
4) If i open communications in selling/comuunication and saves again it again start showing on applicants page till i refresh the page

I have updated at

git hub at http://github.com/xavocinternational/erpnext

If any one can see whats going wrong ... It will be fast for me to work/contribute

Aditya Duggal

unread,
Jul 22, 2013, 11:15:26 AM7/22/13
to erpnext-dev...@googlegroups.com
Hi Anand,

I would like to how to add a script to a button to create a new communication. Basically, I have added a new button in Customer Master and I would like to assign the script to add a new Communication. Could just explain me how to go about that?


On Tuesday, December 25, 2012 10:10:35 PM UTC+5:30, Anand Doshi wrote:

Hi,

HTML field type allows you to render anything in HTML. You will need to see lead.js for an example on how to load communication thread in a given form.

(You might encounter wn.require(...) - it attaches another file's js code into current file.. sort of import in python)

Also, you will need to add a link field in Communication to be able to connect communication in your new DocType.

Thanks,
Anand.

On Dec 25, 2012 10:04 PM, "Gowrav" <gowravvi...@gmail.com> wrote:
Hi
I am very near of my first (not best but okey) module in HR :: Job Applicants

Now I want to add a communication history in this module..

???? :: Which type leads to communication histroy for this applicant ...

What else we have to take care for communication link adding ...

Seen other modules but there is just HTML type for communication, so not understood ...

--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To unsubscribe from this group, send email to erpnext-developer-forum+unsub...@googlegroups.com.

Rushabh Mehta

unread,
Jul 24, 2013, 2:17:29 AM7/24/13
to erpnext-dev...@googlegroups.com
Do you want to add it automatically or open the Compose box and auto fill some reply?

Can you explain your use case a bit more?


T: @rushabh_mehta

--
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.

Aditya Duggal

unread,
Jul 24, 2013, 2:33:21 AM7/24/13
to erpnext-dev...@googlegroups.com
I am looking to add a button to Customer Master and later to the Lead Master to add a communication. Buttons like:
  • Add Phone Call: This button would open a new Communication with Customer taken from the master and the type of communication as Phone Call also the user creating it would fill the user fields of the communication.
Something similar to the Add Message button only but with a small difference as mentioned above.

Rushabh Mehta

unread,
Jul 24, 2013, 2:43:20 AM7/24/13
to erpnext-dev...@googlegroups.com
Maybe we can update the Communication Composer with this. Please raise feature request in GitHub.



T: @rushabh_mehta

Aditya Duggal

unread,
Jul 24, 2013, 2:49:36 AM7/24/13
to erpnext-dev...@googlegroups.com
I have raised a issue on Github https://github.com/webnotes/erpnext/issues/638

Aditya Duggal

unread,
Dec 12, 2013, 10:17:06 AM12/12/13
to erpnext-dev...@googlegroups.com
Hi Rushabh,

Just wanted to know that even though the issue 638 has been closed about 2 months ago but I still cannot find a button to create communication in the customer master
To unsubscribe from this group, send email to erpnext-developer-forum+unsubscr...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/nRiI7UMcibAJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
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.

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

--
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.

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

--
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.

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

--
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.

rushabh

unread,
Dec 14, 2013, 3:25:17 AM12/14/13
to erpnext-dev...@googlegroups.com
Aditya - Its there in the Contact master - you may have multiple contacts per customer...

Aditya Duggal

unread,
Dec 14, 2013, 3:40:40 AM12/14/13
to erpnext-dev...@googlegroups.com
Hi Rushabh,

Thanks for the info. The Add Message button is indeed there but I think this button is only for sending emails and communication can be anything from an email to a phone call. It would be great if clicking the add message button asks us whether we need to send an email or log a call details or a meeting detail otherwise this button is just not good except for emails.


To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.

rushabh

unread,
Dec 16, 2013, 2:44:53 AM12/16/13
to erpnext-dev...@googlegroups.com
If you uncheck the "Send As Email" button, you will have option to tag the communication as a phone call etc.

Aditya Duggal

unread,
Dec 16, 2013, 3:38:10 AM12/16/13
to erpnext-dev...@googlegroups.com
Thanks, I would check these options thoroughly and let you know if there is any deficiency.


Reply all
Reply to author
Forward
0 new messages