feat: also store form id in lead
This commit is contained in:
parent
176c7c73bb
commit
1b87635d3d
@ -57,7 +57,9 @@
|
|||||||
"log_tab",
|
"log_tab",
|
||||||
"status_change_log",
|
"status_change_log",
|
||||||
"syncing_tab",
|
"syncing_tab",
|
||||||
"facebook_lead_id"
|
"facebook_lead_id",
|
||||||
|
"column_break_ixmu",
|
||||||
|
"facebook_form_id"
|
||||||
],
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
@ -338,13 +340,22 @@
|
|||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"label": "Facebook Lead ID",
|
"label": "Facebook Lead ID",
|
||||||
"unique": 1
|
"unique": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "column_break_ixmu",
|
||||||
|
"fieldtype": "Column Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "facebook_form_id",
|
||||||
|
"fieldtype": "Data",
|
||||||
|
"label": "Facebook Form ID"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"grid_page_length": 50,
|
"grid_page_length": 50,
|
||||||
"image_field": "image",
|
"image_field": "image",
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2025-09-29 19:21:49.483883",
|
"modified": "2025-10-19 18:36:24.683076",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "FCRM",
|
"module": "FCRM",
|
||||||
"name": "CRM Lead",
|
"name": "CRM Lead",
|
||||||
|
|||||||
@ -28,6 +28,7 @@ class CRMLead(Document):
|
|||||||
communication_status: DF.Link | None
|
communication_status: DF.Link | None
|
||||||
converted: DF.Check
|
converted: DF.Check
|
||||||
email: DF.Data | None
|
email: DF.Data | None
|
||||||
|
facebook_form_id: DF.Data | None
|
||||||
facebook_lead_id: DF.Data | None
|
facebook_lead_id: DF.Data | None
|
||||||
first_name: DF.Data
|
first_name: DF.Data
|
||||||
first_responded_on: DF.Datetime | None
|
first_responded_on: DF.Datetime | None
|
||||||
|
|||||||
@ -37,6 +37,7 @@ class FacebookSyncSource:
|
|||||||
}
|
}
|
||||||
crm_lead_data["source"] = "Facebook"
|
crm_lead_data["source"] = "Facebook"
|
||||||
crm_lead_data["facebook_lead_id"] = lead["id"]
|
crm_lead_data["facebook_lead_id"] = lead["id"]
|
||||||
|
crm_lead_data["facebook_form_id"] = self.form_id
|
||||||
|
|
||||||
try:
|
try:
|
||||||
frappe.get_doc(
|
frappe.get_doc(
|
||||||
@ -198,8 +199,3 @@ def get_pages_with_forms() -> list[dict]:
|
|||||||
forms = frappe.db.get_all("Facebook Lead Form", filters={"page": page["id"]}, fields=["id", "name"])
|
forms = frappe.db.get_all("Facebook Lead Form", filters={"page": page["id"]}, fields=["id", "name"])
|
||||||
page["forms"] = forms
|
page["forms"] = forms
|
||||||
return pages
|
return pages
|
||||||
|
|
||||||
|
|
||||||
def validate_duplicate(lead: dict, field_mapping: dict):
|
|
||||||
# if a lead exists with
|
|
||||||
pass
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user