Create Lead from API

Hi Forum,

I tried to create lead from API and built the following piece of code looking at some samples from ERPNEXT. I get webclient import error message. Where exactly this webclient is available and where should I put this file to create the lead from API.

***********************************************************************************************************************************************
from webclient import *

server = "http://IP/server.py"
user = "admin"
password = "admin"

login()

#customer = get_doc("Customer", customer_name)

# make customer if required
#if not customer:
#    response = insert([{
#        "doctype":"Customer",
#       "customer_name": customer_name,
#        "customer_type": "Company",
#        "customer_group": "Standard Group",
#        "territory": "Default",
#        "customer_details": "some unique info",
#        "company": "Alpha"
#    }])

# make invoice
response = insert([
 {
  "creation": "2013-04-10 11:45:37", 
  "docstatus": 0, 
  "modified": "2013-04-10 11:49:11", 
  "modified_by": "Administrator", 
  "owner": "Administrator"
 }, 
 {
  "autoname": "naming_series:", 
  "doctype": "DocType", 
  "document_type": "Master", 
  "module": "Selling", 
  "name": "__common__", 
  "search_fields": "lead_name,lead_owner,status"
 }, 
 {
  "doctype": "DocField", 
  "name": "__common__", 
  "parent": "Lead", 
  "parentfield": "fields", 
  "parenttype": "DocType", 
  "permlevel": 0
 }, 
 {
  "amend": 0, 
  "create": 1, 
  "doctype": "DocPerm", 
  "name": "__common__", 
  "parent": "Lead", 
  "parentfield": "permissions", 
  "parenttype": "DocType", 
  "permlevel": 0, 
  "read": 1, 
  "report": 1, 
  "submit": 0, 
  "write": 1
 }, 
 {
  "doctype": "DocType", 
  "name": "Lead"
 }, 
 {
  "description": "To manage multiple series please go to Setup > Manage Series", 
  "doctype": "DocField", 
  "fieldname": "naming_series", 
  "fieldtype": "Select", 
  "label": "Naming Series", 
  "no_copy": 1, 
  "oldfieldname": "naming_series", 
  "oldfieldtype": "Select", 
  "options": "LEAD\nLEAD/10-11/\nLEAD/MUMBAI/", 
  "reqd": 0
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "lead_name", 
  "fieldtype": "Data", 
  "in_filter": 1, 
  "in_list_view": 1, 
  "label": "Contact Name", 
  "oldfieldname": "lead_name", 
  "oldfieldtype": "Data", 
  "reqd": 1, 
  "search_index": 1
 }, 
 {
  "description": "Name of organization from where lead has come", 
  "doctype": "DocField", 
  "fieldname": "company_name", 
  "fieldtype": "Data", 
  "in_filter": 1, 
  "in_list_view": 1, 
  "label": "Company Name", 
  "oldfieldname": "company_name", 
  "oldfieldtype": "Data", 
  "reqd": 0, 
  "search_index": 0
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "email_id", 
  "fieldtype": "Data", 
  "label": "Email Id", 
  "oldfieldname": "email_id", 
  "oldfieldtype": "Data", 
  "reqd": 0, 
  "search_index": 1
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "cb6", 
  "fieldtype": "Column Break"
 }, 
 {
  "default": "Open", 
  "doctype": "DocField", 
  "fieldname": "status", 
  "fieldtype": "Select", 
  "in_filter": 1, 
  "in_list_view": 1, 
  "label": "Status", 
  "no_copy": 1, 
  "oldfieldname": "status", 
  "oldfieldtype": "Select", 
  "options": "\nOpen\nReplied\nAttempted to Contact\nContact in Future\nContacted\nInterested\nNot interested\nLead Lost\nConverted", 
  "reqd": 1, 
  "search_index": 1
 }, 
 {
  "description": "Source of the lead. If via a campaign, select \"Campaign\"", 
  "doctype": "DocField", 
  "fieldname": "source", 
  "fieldtype": "Select", 
  "in_filter": 1, 
  "in_list_view": 1, 
  "label": "Source", 
  "no_copy": 1, 
  "oldfieldname": "source", 
  "oldfieldtype": "Select", 
  "options": "\nAdvertisement\nBlog Post\nCampaign\nCall\nCustomer\nExhibition\nSupplier\nWebsite\nEmail", 
  "reqd": 0, 
  "search_index": 0
 }, 
 {
  "depends_on": "eval:doc.source == 'Customer'", 
  "description": "Source of th", 
  "doctype": "DocField", 
  "fieldname": "customer", 
  "fieldtype": "Link", 
  "hidden": 0, 
  "label": "From Customer", 
  "oldfieldname": "customer", 
  "oldfieldtype": "Link", 
  "options": "Customer"
 }, 
 {
  "depends_on": "eval:doc.source == 'Campaign'", 
  "description": "Enter campaign name if the source of lead is campaign.", 
  "doctype": "DocField", 
  "fieldname": "campaign_name", 
  "fieldtype": "Link", 
  "hidden": 0, 
  "label": "Campaign Name", 
  "oldfieldname": "campaign_name", 
  "oldfieldtype": "Link", 
  "options": "Campaign"
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "communication_history", 
  "fieldtype": "Section Break"
 }, 
 {
  "allow_on_submit": 0, 
  "doctype": "DocField", 
  "fieldname": "communication_html", 
  "fieldtype": "HTML", 
  "label": "Communication HTML", 
  "oldfieldname": "follow_up", 
  "oldfieldtype": "Table"
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "contact_info", 
  "fieldtype": "Section Break", 
  "label": "Contact Info", 
  "oldfieldtype": "Column Break"
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "remark", 
  "fieldtype": "Small Text", 
  "label": "Remark", 
  "oldfieldname": "remark", 
  "oldfieldtype": "Text"
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "phone", 
  "fieldtype": "Data", 
  "label": "Phone", 
  "oldfieldname": "contact_no", 
  "oldfieldtype": "Data", 
  "reqd": 0
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "mobile_no", 
  "fieldtype": "Data", 
  "label": "Mobile No.", 
  "oldfieldname": "mobile_no", 
  "oldfieldtype": "Data"
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "fax", 
  "fieldtype": "Data", 
  "label": "Fax", 
  "oldfieldname": "fax", 
  "oldfieldtype": "Data"
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "website", 
  "fieldtype": "Data", 
  "label": "Website", 
  "oldfieldname": "website", 
  "oldfieldtype": "Data"
 }, 
 {
  "description": "<a href=\"#!Sales Browser/Territory\">To manage Territory, click here</a>", 
  "doctype": "DocField", 
  "fieldname": "territory", 
  "fieldtype": "Link", 
  "label": "Territory", 
  "oldfieldname": "territory", 
  "oldfieldtype": "Link", 
  "options": "Territory", 
  "print_hide": 1
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "column_break2", 
  "fieldtype": "Column Break"
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "address_line1", 
  "fieldtype": "Data", 
  "label": "Address Line 1", 
  "oldfieldname": "address_line1", 
  "oldfieldtype": "Data", 
  "print_hide": 1, 
  "reqd": 0
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "address_line2", 
  "fieldtype": "Data", 
  "label": "Address Line 2", 
  "oldfieldname": "address_line2", 
  "oldfieldtype": "Data", 
  "print_hide": 1
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "city", 
  "fieldtype": "Data", 
  "label": "City", 
  "oldfieldname": "city", 
  "oldfieldtype": "Select", 
  "print_hide": 1, 
  "reqd": 0
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "country", 
  "fieldtype": "Select", 
  "label": "Country", 
  "oldfieldname": "country", 
  "oldfieldtype": "Select", 
  "options": "link:Country", 
  "print_hide": 1, 
  "reqd": 0
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "state", 
  "fieldtype": "Data", 
  "label": "State", 
  "oldfieldname": "state", 
  "oldfieldtype": "Select", 
  "options": "Suggest", 
  "print_hide": 1
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "pincode", 
  "fieldtype": "Data", 
  "label": "Pin Code", 
  "oldfieldname": "pincode", 
  "oldfieldtype": "Data", 
  "print_hide": 1
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "more_info", 
  "fieldtype": "Section Break", 
  "label": "More Info", 
  "oldfieldtype": "Section Break"
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "type", 
  "fieldtype": "Select", 
  "in_filter": 1, 
  "label": "Lead Type", 
  "oldfieldname": "type", 
  "oldfieldtype": "Select", 
  "options": "\nClient\nChannel Partner\nConsultant"
 }, 
 {
  "default": "__user", 
  "doctype": "DocField", 
  "fieldname": "lead_owner", 
  "fieldtype": "Link", 
  "in_filter": 1, 
  "label": "Lead Owner", 
  "oldfieldname": "lead_owner", 
  "oldfieldtype": "Link", 
  "options": "Profile", 
  "search_index": 1
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "market_segment", 
  "fieldtype": "Select", 
  "hidden": 0, 
  "in_filter": 1, 
  "label": "Market Segment", 
  "oldfieldname": "market_segment", 
  "oldfieldtype": "Select", 
  "options": "\nLower Income\nMiddle Income\nUpper Income", 
  "reqd": 0, 
  "search_index": 0
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "industry", 
  "fieldtype": "Link", 
  "label": "Industry", 
  "oldfieldname": "industry", 
  "oldfieldtype": "Link", 
  "options": "Industry Type"
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "request_type", 
  "fieldtype": "Select", 
  "label": "Request Type", 
  "oldfieldname": "request_type", 
  "oldfieldtype": "Select", 
  "options": "\nProduct Enquiry\nRequest for Information\nSuggestions\nOther"
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "fiscal_year", 
  "fieldtype": "Select", 
  "hidden": 1, 
  "in_filter": 1, 
  "label": "Fiscal Year", 
  "oldfieldname": "fiscal_year", 
  "oldfieldtype": "Select", 
  "options": "link:Fiscal Year"
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "column_break3", 
  "fieldtype": "Column Break", 
  "oldfieldtype": "Column Break", 
  "width": "50%"
 }, 
 {
  "allow_on_submit": 0, 
  "depends_on": "eval:doc.status == 'Lead Lost'", 
  "doctype": "DocField", 
  "fieldname": "order_lost_reason", 
  "fieldtype": "Link", 
  "hidden": 0, 
  "label": "Lost Reason", 
  "oldfieldname": "order_lost_reason", 
  "oldfieldtype": "Link", 
  "options": "Quotation Lost Reason"
 }, 
 {
  "allow_on_submit": 0, 
  "description": "Your sales person who will contact the lead in future", 
  "doctype": "DocField", 
  "fieldname": "contact_by", 
  "fieldtype": "Link", 
  "hidden": 0, 
  "in_filter": 1, 
  "label": "Next Contact By", 
  "oldfieldname": "contact_by", 
  "oldfieldtype": "Link", 
  "options": "Profile", 
  "print_hide": 0, 
  "reqd": 0, 
  "width": "100px"
 }, 
 {
  "allow_on_submit": 0, 
  "description": "Your sales person will get a reminder on this date to contact the lead", 
  "doctype": "DocField", 
  "fieldname": "contact_date", 
  "fieldtype": "Date", 
  "in_filter": 1, 
  "label": "Next Contact Date", 
  "no_copy": 1, 
  "oldfieldname": "contact_date", 
  "oldfieldtype": "Date", 
  "reqd": 0, 
  "width": "100px"
 }, 
 {
  "depends_on": "eval:!doc.__islocal", 
  "description": "Date on which the lead was last contacted", 
  "doctype": "DocField", 
  "fieldname": "last_contact_date", 
  "fieldtype": "Date", 
  "label": "Last Contact Date", 
  "no_copy": 1, 
  "oldfieldname": "last_contact_date", 
  "oldfieldtype": "Date", 
  "print_hide": 1, 
  "read_only": 1
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "company", 
  "fieldtype": "Link", 
  "label": "Company", 
  "oldfieldname": "company", 
  "oldfieldtype": "Link", 
  "options": "Company", 
  "reqd": 0
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "trash_reason", 
  "fieldtype": "Small Text", 
  "label": "Trash Reason", 
  "no_copy": 1, 
  "oldfieldname": "trash_reason", 
  "oldfieldtype": "Small Text", 
  "print_hide": 1, 
  "read_only": 1
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "unsubscribed", 
  "fieldtype": "Check", 
  "label": "Unsubscribed"
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "blog_subscriber", 
  "fieldtype": "Check", 
  "label": "Blog Subscriber"
 }, 
 {
  "cancel": 1, 
  "doctype": "DocPerm", 
  "role": "Sales Manager"
 }, 
 {
  "cancel": 0, 
  "doctype": "DocPerm", 
  "role": "Sales User"
 }
])

***********************************************************************************************************************************************



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+un...@googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
https://github.com/webnotes/wn-client

On Monday, December 16, 2013 9:37:38 AM UTC+5:30, Senthil Basuva Raj wrote:
Hi Forum,

I tried to create lead from API and built the following piece of code looking at some samples from ERPNEXT. I get webclient import error message. Where exactly this webclient is available and where should I put this file to create the lead from API.

***********************************************************************************************************************************************
from webclient import *

user = "admin"
password = "admin"

login()

#customer = get_doc("Customer", customer_name)

# make customer if required
#if not customer:
#    response = insert([{
#        "doctype":"Customer",
#       "customer_name": customer_name,
#        "customer_type": "Company",
#        "customer_group": "Standard Group",
#        "territory": "Default",
#        "customer_details": "some unique info",
#        "company": "Alpha"
#    }])

# make invoice
response = insert([
 {
  "creation": "2013-04-10 11:45:37", 
  "docstatus": 0, 
  "modified": "2013-04-10 11:49:11", 
  "modified_by": "Administrator", 
  "owner": "Administrator"
 }, 
 {
  "autoname": "naming_series:", 
  "doctype": "DocType", 
  "document_type": "Master", 
  "module": "Selling", 
  "name": "__common__", 
  "search_fields": "lead_name,lead_owner,status"
 }, 
 {
  "doctype": "DocField", 
  "name": "__common__", 
  "parent": "Lead", 
  "parentfield": "fields", 
  "parenttype": "DocType", 
  "permlevel": 0
 }, 
 {
  "amend": 0, 
  "create": 1, 
  "doctype": "DocPerm", 
  "name": "__common__", 
  "parent": "Lead", 
  "parentfield": "permissions", 
  "parenttype": "DocType", 
  "permlevel": 0, 
  "read": 1, 
  "report": 1, 
  "submit": 0, 
  "write": 1
 }, 
 {
  "doctype": "DocType", 
  "name": "Lead"
 }, 
 {
  "description": "To manage multiple series please go to Setup > Manage Series", 
  "doctype": "DocField", 
  "fieldname": "naming_series", 
  "fieldtype": "Select", 
  "label": "Naming Series", 
  "no_copy": 1, 
  "oldfieldname": "naming_series", 
  "oldfieldtype": "Select", 
  "options": "LEAD\nLEAD/10-11/\nLEAD/MUMBAI/", 
  "reqd": 0
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "lead_name", 
  "fieldtype": "Data", 
  "in_filter": 1, 
  "in_list_view": 1, 
  "label": "Contact Name", 
  "oldfieldname": "lead_name", 
  "oldfieldtype": "Data", 
  "reqd": 1, 
  "search_index": 1
 }, 
 {
  "description": "Name of organization from where lead has come", 
  "doctype": "DocField", 
  "fieldname": "company_name", 
  "fieldtype": "Data", 
  "in_filter": 1, 
  "in_list_view": 1, 
  "label": "Company Name", 
  "oldfieldname": "company_name", 
  "oldfieldtype": "Data", 
  "reqd": 0, 
  "search_index": 0
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "email_id", 
  "fieldtype": "Data", 
  "label": "Email Id", 
  "oldfieldname": "email_id", 
  "oldfieldtype": "Data", 
  "reqd": 0, 
  "search_index": 1
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "cb6", 
  "fieldtype": "Column Break"
 }, 
 {
  "default": "Open", 
  "doctype": "DocField", 
  "fieldname": "status", 
  "fieldtype": "Select", 
  "in_filter": 1, 
  "in_list_view": 1, 
  "label": "Status", 
  "no_copy": 1, 
  "oldfieldname": "status", 
  "oldfieldtype": "Select", 
  "options": "\nOpen\nReplied\nAttempted to Contact\nContact in Future\nContacted\nInterested\nNot interested\nLead Lost\nConverted", 
  "reqd": 1, 
  "search_index": 1
 }, 
 {
  "description": "Source of the lead. If via a campaign, select \"Campaign\"", 
  "doctype": "DocField", 
  "fieldname": "source", 
  "fieldtype": "Select", 
  "in_filter": 1, 
  "in_list_view": 1, 
  "label": "Source", 
  "no_copy": 1, 
  "oldfieldname": "source", 
  "oldfieldtype": "Select", 
  "options": "\nAdvertisement\nBlog Post\nCampaign\nCall\nCustomer\nExhibition\nSupplier\nWebsite\nEmail", 
  "reqd": 0, 
  "search_index": 0
 }, 
 {
  "depends_on": "eval:doc.source == 'Customer'", 
  "description": "Source of th", 
  "doctype": "DocField", 
  "fieldname": "customer", 
  "fieldtype": "Link", 
  "hidden": 0, 
  "label": "From Customer", 
  "oldfieldname": "customer", 
  "oldfieldtype": "Link", 
  "options": "Customer"
 }, 
 {
  "depends_on": "eval:doc.source == 'Campaign'", 
  "description": "Enter campaign name if the source of lead is campaign.", 
  "doctype": "DocField", 
  "fieldname": "campaign_name", 
  "fieldtype": "Link", 
  "hidden": 0, 
  "label": "Campaign Name", 
  "oldfieldname": "campaign_name", 
  "oldfieldtype": "Link", 
  "options": "Campaign"
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "communication_history", 
  "fieldtype": "Section Break"
 }, 
 {
  "allow_on_submit": 0, 
  "doctype": "DocField", 
  "fieldname": "communication_html", 
  "fieldtype": "HTML", 
  "label": "Communication HTML", 
  "oldfieldname": "follow_up", 
  "oldfieldtype": "Table"
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "contact_info", 
  "fieldtype": "Section Break", 
  "label": "Contact Info", 
  "oldfieldtype": "Column Break"
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "remark", 
  "fieldtype": "Small Text", 
  "label": "Remark", 
  "oldfieldname": "remark", 
  "oldfieldtype": "Text"
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "phone", 
  "fieldtype": "Data", 
  "label": "Phone", 
  "oldfieldname": "contact_no", 
  "oldfieldtype": "Data", 
  "reqd": 0
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "mobile_no", 
  "fieldtype": "Data", 
  "label": "Mobile No.", 
  "oldfieldname": "mobile_no", 
  "oldfieldtype": "Data"
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "fax", 
  "fieldtype": "Data", 
  "label": "Fax", 
  "oldfieldname": "fax", 
  "oldfieldtype": "Data"
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "website", 
  "fieldtype": "Data", 
  "label": "Website", 
  "oldfieldname": "website", 
  "oldfieldtype": "Data"
 }, 
 {
  "description": "<a href=\"#!Sales Browser/Territory\">To manage Territory, click here</a>", 
  "doctype": "DocField", 
  "fieldname": "territory", 
  "fieldtype": "Link", 
  "label": "Territory", 
  "oldfieldname": "territory", 
  "oldfieldtype": "Link", 
  "options": "Territory", 
  "print_hide": 1
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "column_break2", 
  "fieldtype": "Column Break"
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "address_line1", 
  "fieldtype": "Data", 
  "label": "Address Line 1", 
  "oldfieldname": "address_line1", 
  "oldfieldtype": "Data", 
  "print_hide": 1, 
  "reqd": 0
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "address_line2", 
  "fieldtype": "Data", 
  "label": "Address Line 2", 
  "oldfieldname": "address_line2", 
  "oldfieldtype": "Data", 
  "print_hide": 1
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "city", 
  "fieldtype": "Data", 
  "label": "City", 
  "oldfieldname": "city", 
  "oldfieldtype": "Select", 
  "print_hide": 1, 
  "reqd": 0
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "country", 
  "fieldtype": "Select", 
  "label": "Country", 
  "oldfieldname": "country", 
  "oldfieldtype": "Select", 
  "options": "link:Country", 
  "print_hide": 1, 
  "reqd": 0
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "state", 
  "fieldtype": "Data", 
  "label": "State", 
  "oldfieldname": "state", 
  "oldfieldtype": "Select", 
  "options": "Suggest", 
  "print_hide": 1
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "pincode", 
  "fieldtype": "Data", 
  "label": "Pin Code", 
  "oldfieldname": "pincode", 
  "oldfieldtype": "Data", 
  "print_hide": 1
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "more_info", 
  "fieldtype": "Section Break", 
  "label": "More Info", 
  "oldfieldtype": "Section Break"
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "type", 
  "fieldtype": "Select", 
  "in_filter": 1, 
  "label": "Lead Type", 
  "oldfieldname": "type", 
  "oldfieldtype": "Select", 
  "options": "\nClient\nChannel Partner\nConsultant"
 }, 
 {
  "default": "__user", 
  "doctype": "DocField", 
  "fieldname": "lead_owner", 
  "fieldtype": "Link", 
  "in_filter": 1, 
  "label": "Lead Owner", 
  "oldfieldname": "lead_owner", 
  "oldfieldtype": "Link", 
  "options": "Profile", 
  "search_index": 1
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "market_segment", 
  "fieldtype": "Select", 
  "hidden": 0, 
  "in_filter": 1, 
  "label": "Market Segment", 
  "oldfieldname": "market_segment", 
  "oldfieldtype": "Select", 
  "options": "\nLower Income\nMiddle Income\nUpper Income", 
  "reqd": 0, 
  "search_index": 0
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "industry", 
  "fieldtype": "Link", 
  "label": "Industry", 
  "oldfieldname": "industry", 
  "oldfieldtype": "Link", 
  "options": "Industry Type"
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "request_type", 
  "fieldtype": "Select", 
  "label": "Request Type", 
  "oldfieldname": "request_type", 
  "oldfieldtype": "Select", 
  "options": "\nProduct Enquiry\nRequest for Information\nSuggestions\nOther"
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "fiscal_year", 
  "fieldtype": "Select", 
  "hidden": 1, 
  "in_filter": 1, 
  "label": "Fiscal Year", 
  "oldfieldname": "fiscal_year", 
  "oldfieldtype": "Select", 
  "options": "link:Fiscal Year"
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "column_break3", 
  "fieldtype": "Column Break", 
  "oldfieldtype": "Column Break", 
  "width": "50%"
 }, 
 {
  "allow_on_submit": 0, 
  "depends_on": "eval:doc.status == 'Lead Lost'", 
  "doctype": "DocField", 
  "fieldname": "order_lost_reason", 
  "fieldtype": "Link", 
  "hidden": 0, 
  "label": "Lost Reason", 
  "oldfieldname": "order_lost_reason", 
  "oldfieldtype": "Link", 
  "options": "Quotation Lost Reason"
 }, 
 {
  "allow_on_submit": 0, 
  "description": "Your sales person who will contact the lead in future", 
  "doctype": "DocField", 
  "fieldname": "contact_by", 
  "fieldtype": "Link", 
  "hidden": 0, 
  "in_filter": 1, 
  "label": "Next Contact By", 
  "oldfieldname": "contact_by", 
  "oldfieldtype": "Link", 
  "options": "Profile", 
  "print_hide": 0, 
  "reqd": 0, 
  "width": "100px"
 }, 
 {
  "allow_on_submit": 0, 
  "description": "Your sales person will get a reminder on this date to contact the lead", 
  "doctype": "DocField", 
  "fieldname": "contact_date", 
  "fieldtype": "Date", 
  "in_filter": 1, 
  "label": "Next Contact Date", 
  "no_copy": 1, 
  "oldfieldname": "contact_date", 
  "oldfieldtype": "Date", 
  "reqd": 0, 
  "width": "100px"
 }, 
 {
  "depends_on": "eval:!doc.__islocal", 
  "description": "Date on which the lead was last contacted", 
  "doctype": "DocField", 
  "fieldname": "last_contact_date", 
  "fieldtype": "Date", 
  "label": "Last Contact Date", 
  "no_copy": 1, 
  "oldfieldname": "last_contact_date", 
  "oldfieldtype": "Date", 
  "print_hide": 1, 
  "read_only": 1
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "company", 
  "fieldtype": "Link", 
  "label": "Company", 
  "oldfieldname": "company", 
  "oldfieldtype": "Link", 
  "options": "Company", 
  "reqd": 0
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "trash_reason", 
  "fieldtype": "Small Text", 
  "label": "Trash Reason", 
  "no_copy": 1, 
  "oldfieldname": "trash_reason", 
  "oldfieldtype": "Small Text", 
  "print_hide": 1, 
  "read_only": 1
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "unsubscribed", 
  "fieldtype": "Check", 
  "label": "Unsubscribed"
 }, 
 {
  "doctype": "DocField", 
  "fieldname": "blog_subscriber", 
  "fieldtype": "Check", 
  "label": "Blog Subscriber"
 }, 
 {
  "cancel": 1, 
  "doctype": "DocPerm", 
  "role": "Sales Manager"
 }, 
 {
  "cancel": 0, 
  "doctype": "DocPerm", 
  "role": "Sales User"
 }
])

***********************************************************************************************************************************************



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+un...@googlegroups.com.

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