patrickjust3k

offer accepted

May 17th, 2023
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 22.22 KB | None | 0 0
  1. //------attached to stage in Seller Blueprint, "Under Contract"
  2. deal_details = zoho.crm.getRecordById("Deals",deal_id);
  3. //search for any recurring tasks and delete them
  4. related_tasks = zoho.crm.getRelatedRecords("Tasks","Deals",deal_id);
  5. delete_list = list();
  6. for each task in related_tasks
  7. {
  8. recurring = task.getJSON("Recurring_Activity");
  9. if(!recurring.isNull())
  10. {
  11. task_id = task.get("id");
  12. delete_list.add(task_id);
  13. }
  14. }
  15. if(!delete_list.isEmpty())
  16. {
  17. response = invokeurl
  18. [
  19. url :"https://www.zohoapis.com/crm/v3/Tasks?ids=" + delete_list
  20. type :DELETE
  21. connection:"crm_all"
  22. ];
  23. info response;
  24. }
  25. //gather deal details
  26. deal_owner_id = deal_details.get("Owner").get("id");
  27. HOA = deal_details.get("HOA");
  28. year_built = deal_details.get("Year_Built");
  29. solar = deal_details.get("Solar");
  30. septic = deal_details.get("Septic");
  31. contract_date = ifNull(deal_details.get("Contract_Date"),zoho.currentdate);
  32. closing_date = ifNull(deal_details.get("Closing_Date"),contract_date.addDay(30));
  33. inspection_over = ifNull(deal_details.get("Inspection_Period_over"),contract_date.addDay(10));
  34. earnest_money = deal_details.get("Earnest_Money");
  35. contract_price = deal_details.get("Contract_Price");
  36. seller_concessions_yn = deal_details.get("Seller_Concessions");
  37. seller_concessions_amt = deal_details.get("Seller_Concessions3");
  38. accepted_offer_id = deal_details.get("Accepted_Offer").get("id");
  39. //syncing offer module with the deal module
  40. offer_Details = zoho.crm.getRecordById("Offers",accepted_offer_id);
  41. //info "offer details: " + offer_Details;
  42. //collecting offer information
  43. Buyer_Name = offer_Details.get("Name");
  44. Seller_Name = offer_Details.get("Seller_Name");
  45. Assessor_Number = offer_Details.get("Parcel_Number");
  46. Contract_Price = ifNull(contract_price,offer_Details.get("Contract_Price"));
  47. Earnest_Money_Amount = ifNull(earnest_money,offer_Details.get("Earnest_Money_Amount"));
  48. Down_Payment = offer_Details.get("Down_payment");
  49. Financed_amt = ifNull(offer_Details.get("Financed_Amount"),"");
  50. Financing_Type = offer_Details.get("Financing");
  51. Pre_qual_amt = ifNull(offer_Details.get("Pre_Qual_Amount"),"");
  52. Closing_Date = ifNull(closing_date,offer_Details.get("Closing_Date"));
  53. Possession_Date = offer_Details.get("Possession_Date");
  54. Addendums_inc = offer_Details.get("Addendums_Incorporated");
  55. if(!Addendums_inc.isNull())
  56. {
  57. other_addendums = offer_Details.get("Other_Addendums");
  58. }
  59. contingent_yn = offer_Details.get("Contingent_Offer");
  60. if(contingent_yn == "Yes")
  61. {
  62. contingent_address = offer_Details.get("Contingency_Address");
  63. }
  64. else
  65. {
  66. contingent_address = "";
  67. }
  68. Personal_Property = offer_Details.get("Personal_property_included_in_sale");
  69. //info "Addendums: " + Addendums_inc;
  70. Seller_Concessions = ifNull(seller_concessions_yn,offer_Details.get("Seller_Concessions2"));
  71. if(Seller_Concessions == "Yes")
  72. {
  73. Seller_Concessions_Amount = ifNull(seller_concessions_amt,offer_Details.get("Seller_Concessions_amt"));
  74. }
  75. else
  76. {
  77. Seller_Concessions_amt = "0";
  78. }
  79. appraisal_paid_by = ifNull("Appraisal_Cost_paid_by","");
  80. Inspection_Days = offer_Details.get("Inspection_Days");
  81. escrow_id = offer_Details.getJSON("Title_Escrow").get("id");
  82. Home_Waranty = offer_Details.get("Home_Waranty");
  83. Home_warranty_ordered_by = ifNull(offer_Details.get("Home_Warraty_Ordered_By"),"");
  84. Home_Warranty_Cost = ifNull(offer_Details.get("Home_Warranty_Cost"),"");
  85. Home_Warranty_Paid_By = ifNull(offer_Details.get("Home_Warranty_Paid_By"),"");
  86. Home_Warranty_Coverage = ifNull(offer_Details.get("Home_Warranty_Coverage"),"");
  87. Additional_Terms = offer_Details.get("Additional_Terms");
  88. Response_time = offer_Details.get("Response_Time");
  89. // get buyer agents info
  90. Buyer_Agent_1 = offer_Details.get("Buyer_Agent_1");
  91. if(!Buyer_Agent_1.isNull())
  92. {
  93. Buyer_Agent_1_id = offer_Details.get("Buyer_Agent_1").get("id");
  94. Buyer_Agent_1_id = Buyer_Agent_1_id.toLong();
  95. // get buyer agent 2 info
  96. Buyer_Agent_2 = offer_Details.get("Buyer_Agent_2");
  97. if(!Buyer_Agent_2.isNull())
  98. {
  99. Buyer_Agent_2_id = offer_Details.get("Buyer_Agent_2").get("id");
  100. Buyer_Agent_2_id = Buyer_Agent_2_id.toLong();
  101. }
  102. }
  103. //get listing agents info
  104. Listing_Agent_1 = offer_Details.get("Seller_Agent_1");
  105. if(!Listing_Agent_1.isNull())
  106. {
  107. Listing_Agent_1_id = offer_Details.get("Seller_Agent_1").get("id");
  108. Listing_Agent_1_id = Listing_Agent_1_id.toLong();
  109. Listing_Agent_2 = offer_Details.get("Seller_Agent_2");
  110. if(!Listing_Agent_2.isNull())
  111. {
  112. Listing_Agent_2_id = offer_Details.get("Seller_Agent_2").get("id");
  113. Listing_Agent_2_id = Listing_Agent_2_id.toLong();
  114. }
  115. }
  116. //get lender info
  117. if(!Financing_Type == "Cash")
  118. {
  119. lender_info = offer_Details.get("Lender");
  120. if(!lender_info.isNull())
  121. {
  122. lender_id = lender_info.get("id");
  123. }
  124. }
  125. // input all values into map
  126. deal_map = Map();
  127. deal_map.put("Buyer_Name",Buyer_Name);
  128. deal_map.put("Seller_Name",Seller_Name);
  129. deal_map.put("Assessor_Number",Assessor_Number);
  130. deal_map.put("Contract_Price",Contract_Price);
  131. deal_map.put("Earnest_Money",Earnest_Money_Amount);
  132. deal_map.put("Down_Payment",Down_Payment);
  133. deal_map.put("Financed_Amount",Financed_amt);
  134. deal_map.put("Financing_Type",Financing_Type);
  135. deal_map.put("Closing_Date",Closing_Date);
  136. deal_map.put("Pre_Qualifcation_amount",Pre_qual_amt);
  137. deal_map.put("Possession_Date",Possession_Date);
  138. deal_map.put("Addenda_Incorporated",Addendums_inc);
  139. deal_map.put("Contingent",contingent_yn);
  140. deal_map.put("Contingency_Address",contingent_address);
  141. deal_map.put("Personal_Property_Included",Personal_Property);
  142. deal_map.put("Seller_Concessions",Seller_Concessions);
  143. deal_map.put("Seller_Concessions3",Seller_Concessions_Amount);
  144. deal_map.put("Appraisal_paid_by",appraisal_paid_by);
  145. deal_map.put("Inspection_Days",Inspection_Days);
  146. deal_map.put("Home_Warranty_Y_N",Home_Waranty);
  147. deal_map.put("Home_Warranty_Ordered_By",Home_warranty_ordered_by);
  148. deal_map.put("Home_Warranty_Cost",Home_Warranty_Cost);
  149. deal_map.put("Home_Warranty_paid_by",Home_Warranty_Paid_By);
  150. deal_map.put("Home_Warranty_Coverage",Home_Warranty_Coverage);
  151. deal_map.put("Additional_Terms",Additional_Terms);
  152. deal_map.put("Listing_Agent_1",Listing_Agent_1_id);
  153. deal_map.put("Listing_Agent_2",Listing_Agent_2_id);
  154. deal_map.put("Buyer_Agent_1",Buyer_Agent_1_id);
  155. deal_map.put("Buyer_Agent_2",Buyer_Agent_2_id);
  156. deal_map.put("Lender",lender_id);
  157. deal_map.put("Title_Escrow",escrow_id);
  158. //update the deal with the map
  159. if(!accepted_offer_id.isNull())
  160. {
  161. updt_deal = zoho.crm.updateRecord("Deals",deal_id,deal_map);
  162. info "updated deal: " + updt_deal;
  163. }
  164. //-----------------------------OpeningTasks--------------------------------------------------------
  165. //create general task map
  166. task_map = Map();
  167. task_map.put("What_Id",{"id":deal_id});
  168. task_map.put("$se_module","Deals");
  169. task_map.put("Priority","Normal");
  170. task_map.put("Task_Type","Contract");
  171. task_map.put("Status","Not Completed");
  172. task_map.put("Owner",{"id":deal_owner_id});
  173. task_map.put("Due_Date",zoho.currentdate);
  174. task_map.put("task_mod","opening");
  175. //Change MLS Status (immediately)(contract task)
  176. task_map.put("Subject","Change MLS Status, input closing date 7 days after contract date");
  177. task_map.put("Description","Change the MLS status and enter all pertinent info into the MLS. Extend the closing date by at least 7 days that way it won't accidentally close early on you.");
  178. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  179. //Upload contract docs (immediately)(contract task)
  180. task_map.put("Subject","Upload purchase contract, all counter offers, addendums, and other files");
  181. task_map.put("Description","Check the paperwork tab and note all documents that are due. Use the Agent Upload Button to upload unexpected documents such as counter offers, addendums, or any other document that the buyer and seller both sign");
  182. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  183. //Send SPDS, LBP or clue to other agent (immediately)(contract task)
  184. task_map.put("Subject","Send SPDS, LBP, CLUE to buyers agent");
  185. task_map.put("Description","Send the SPDS and Lead based paint addendum (if built before 1978) as well as loss history. If you don't have it filled out by the seller yet, you only have 3 days to give it to the buyer. Get the buyer to sign it and return it to the files after signed");
  186. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  187. //create social media post (immediately)(social media)
  188. task_map.put("Type","Social Media");
  189. task_map.put("Subject","Create Under contract post in Listreports and upload to social media");
  190. task_map.put("Description","Create some kind of social media post and post it on your social media accounts because you're awesome");
  191. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  192. //Email signed docs to seller (1 business day)(contract task)
  193. task_map.put("Task_Type","Contract Task");
  194. task_map.put("Due_Date",zoho.currentdate.addBusinessDay(1));
  195. task_map.put("Subject","Email all signed docs to seller");
  196. task_map.put("Description","Gather all contract documents after broker review and email them to the seller");
  197. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  198. //Email seller info to title (1 business day)(contract task)
  199. task_map.put("Subject","Email seller info and commission split to title");
  200. task_map.put("Description","Email the seller contact information to title and request they send all necessary documents directly to the seller for signatures/filling out");
  201. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  202. //-----------------------------------BINSR tasks------------------
  203. //Inspection period over tasks (1 day before inspection period is over)(contract task)
  204. task_map.put("task_mod","binsr");
  205. task_map.put("Due_Date",inspection_over.subDay(1));
  206. task_map.put("Subject","Make sure BINSR is received");
  207. task_map.put("Description","The BINSR is due tomorrow. If the buyer does not turn it in, they are moving forward without repairs");
  208. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  209. //Check again BINSR is due by buyer TODAY (inspection period over)(contract task)
  210. task_map.put("Due_Date",inspection_over);
  211. task_map.put("Subject","BINSR is due TODAY");
  212. task_map.put("Description","The BINSR is due today. Once BINSR is received, click the \"Through Inspections\" Transition at the top of this page");
  213. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  214. //Help seller organize repairs (contract task)(1 day after inspection is over)
  215. task_map.put("Due Date",inspection_over.addDay(1));
  216. task_map.put("Subject","Help Seller organize repairs");
  217. task_map.put("Description","Make sure sellers understand the ROC requirement for contractors over $1000 and help them fix things in contractual acceptable way");
  218. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  219. //Order LSU (1 day after inspection period is over)(contract task)
  220. task_map.put("Due_Date",inspection_over.addDay(1));
  221. task_map.put("Subject","Order LSU from lender");
  222. task_map.put("Description","If lender is out of state, you can provide them with blank LSU found in \"Blank Docs\"");
  223. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  224. //Order another LSU (10 days before closing)(contract task)
  225. task_map.put("Due_Date",closing_date.subDay(10));
  226. task_map.put("Subject","Order LSU from Lender to verify nearly complete");
  227. task_map.put("Description","");
  228. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  229. //-----------------------------------------Closing tasks---------------
  230. task_map.put("task_mod","closing");
  231. //ask for estimated settlement statement (7 days before closing)(closing task)
  232. daysmod = "7";
  233. task_map.put("daysmod",daysmod);
  234. task_map.put("Subject","Ask for estimated settlement statement from title/escrow officer");
  235. task_map.put("Due_Date",closing_date.subDay(daysmod));
  236. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  237. //Go over settlement statement with seller (5 days before closing)(closing task)
  238. daysmod = "5";
  239. task_map.put("daysmod",daysmod);
  240. task_map.put("Due_Date",closing_date.subDay(daysmod));
  241. task_map.put("Subject","Go over settlement statement with seller");
  242. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  243. // Verify settlement is OK with title (4 days before closing)(closing task)
  244. daysmod = "4";
  245. task_map.put("daysmod",daysmod);
  246. task_map.put("Due_Date",closing_date.subDay(daysmod));
  247. task_map.put("Subject","Verify settlement is OK with Title");
  248. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  249. //Send Commission instructions to broker for signature(10 days before closing)(closing task)
  250. daysmod = "10";
  251. task_map.put("daysmod",daysmod);
  252. task_map.put("Due_Date",closing_date.subDay(daysmod));
  253. task_map.put("Subject","Send commission instructions to broker for signature");
  254. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  255. //Send signed commission instructions to title (7 days before closing)(closing task)
  256. daysmod = "10";
  257. task_map.put("daysmod",daysmod);
  258. task_map.put("Due_Date",closing_date.subDay(daysmod));
  259. task_map.put("Subject","Send broker signed commission instructions to title");
  260. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  261. //-Email seller reminder to turn off utilities/ transfer on closing day (7 days before closing)(closing task)
  262. daysmod = "7";
  263. task_map.put("daysmod",daysmod);
  264. task_map.put("Due_Date",closing_date.subDay(daysmod));
  265. task_map.put("Subject","Email seller reminder to turn off utilities/ transfer on closing day");
  266. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  267. //--------Ask if seller wants a family photo (5 days before closing)(closing task)
  268. daysmod = "5";
  269. task_map.put("daysmod",daysmod);
  270. task_map.put("Due_Date",closing_date.subDay(daysmod));
  271. task_map.put("Subject","Ask if seller wants a family photo");
  272. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  273. //--------Ensure repairs are completed (5 days before closing)(closing task)
  274. daysmod = "5";
  275. task_map.put("daysmod",daysmod);
  276. task_map.put("Due_Date",closing_date.subDay(daysmod));
  277. task_map.put("Subject","Ensure repairs are completed");
  278. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  279. //--------Send repair receipts to buyer's agent (5 days before closing)(closing task)
  280. daysmod = "5";
  281. task_map.put("daysmod",daysmod);
  282. task_map.put("Due_Date",closing_date.subDay(daysmod));
  283. task_map.put("Subject","Send repair receipts to buyer's agent");
  284. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  285. //-------Check with lender to ensure clear to close (5 days before closing)(closing task)
  286. daysmod = "5";
  287. task_map.put("daysmod",daysmod);
  288. task_map.put("Due_Date",closing_date.subDay(daysmod));
  289. task_map.put("Subject","Check with lender to ensure CD has been signed and is clear to close");
  290. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  291. //--------Check Workdrive file to ensure all documents are uploaded/ completed (2 days before closing)(closing task)
  292. daysmod = "2";
  293. task_map.put("daysmod",daysmod);
  294. task_map.put("Due_Date",closing_date.subDay(daysmod));
  295. task_map.put("Subject","Check Paperwork to ensure all documents are uploaded/ completed");
  296. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  297. //---------Schedule seller signing with title(4 days before closing)(closing task)
  298. daysmod = "4";
  299. task_map.put("daysmod",daysmod);
  300. task_map.put("Due_Date",closing_date.subDay(daysmod));
  301. task_map.put("Subject","Schedule seller signing with title");
  302. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  303. //---------Ensure MLS has correct data (4 days before closing)(closing task)
  304. daysmod = "4";
  305. task_map.put("daysmod",daysmod);
  306. task_map.put("Due_Date",closing_date.subDay(daysmod));
  307. task_map.put("Subject","Ensure MLS has correct data (contract price, closing date, concessions, commissions, etc.)");
  308. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  309. //-------Call title company to make sure they have all documents required (1 day before closing)(closing task)
  310. daysmod = "1";
  311. task_map.put("daysmod",daysmod);
  312. task_map.put("Due_Date",closing_date.subDay(daysmod));
  313. task_map.put("Subject","Call title company to make sure they have all documents required");
  314. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  315. //-------Final walkthrough completed (1 day before closing)(closing task)
  316. daysmod = "1";
  317. task_map.put("daysmod",daysmod);
  318. task_map.put("Due_Date",closing_date.subDay(daysmod));
  319. task_map.put("Subject","Final walkthrough completed?");
  320. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  321. //----------Has property closed? (closing day)(closing task)
  322. daysmod = "0";
  323. task_map.put("daysmod",daysmod);
  324. task_map.put("Due_Date",closing_date.subDay(daysmod));
  325. task_map.put("Subject","Has property closed?");
  326. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  327. //---------Ensure MLS info is correct (closing day) (closing task)
  328. daysmod = "0";
  329. task_map.put("daysmod",daysmod);
  330. task_map.put("Due_Date",closing_date.subDay(daysmod));
  331. task_map.put("Subject","Change closing date in MLS is correct if property does not close today");
  332. create_task = zoho.crm.createRecord("Tasks",task_map,{"trigger":{"workflow"}});
  333. //--------------------------------------------------------PAPERWORK---------------------------------------------------------------------------
  334. paper_map = Map();
  335. paper_map = Map();
  336. paper_map.put("$se_module","Deals");
  337. paper_map.put("Deal_Name",{"id":deal_id});
  338. paper_map.put("Due_Date",zoho.currentdate);
  339. paper_map.put("Owner",{"id":deal_owner_id});
  340. paper_map.put("Status","Not Submitted");
  341. paper_map.put("Type","Purchase");
  342. //Purchase Contract
  343. paper_map.put("Name","Purchase Contract");
  344. paper_map.put("Due_Date",zoho.currentdate);
  345. create_paperwork = zoho.crm.createRecord("Paperwork",paper_map,{"trigger":{"workflow"}});
  346. info create_paperwork;
  347. //Broker W-9
  348. paper_map.put("Name","Broker W-9");
  349. paper_map.put("Due_Date",closing_date.subDay(3));
  350. create_paperwork = zoho.crm.createRecord("Paperwork",paper_map,{"trigger":{"workflow"}});
  351. info create_paperwork;
  352. //HOA
  353. if(HOA == "Yes")
  354. {
  355. paper_map.put("Name","HOA Addendum");
  356. paper_map.put("Due_Date",zoho.currentdate);
  357. create_paperwork = zoho.crm.createRecord("Paperwork",paper_map,{"trigger":{"workflow"}});
  358. info create_paperwork;
  359. }
  360. //On Site Wastewater Addendum
  361. if(septic == "Yes")
  362. {
  363. paper_map.put("Name","On Site Wastewater Addendum");
  364. paper_map.put("Due_Date",zoho.currentdate);
  365. create_paperwork = zoho.crm.createRecord("Paperwork",paper_map,{"trigger":{"workflow"}});
  366. }
  367. //Solar Addendum
  368. if(!solar == "No Solar")
  369. {
  370. paper_map.put("Name","Solar Addendum");
  371. paper_map.put("Due_Date",zoho.currentdate);
  372. create_paperwork = zoho.crm.createRecord("Paperwork",paper_map,{"trigger":{"workflow"}});
  373. }
  374. //Lead Based Paint Addendum
  375. if(year_built < 1978)
  376. {
  377. paper_map.put("Name","Lead Based Paint Addendum");
  378. paper_map.put("Due_Date",zoho.currentdate);
  379. create_paperwork = zoho.crm.createRecord("Paperwork",paper_map,{"trigger":{"workflow"}});
  380. }
  381. //Claims History signed by buyer
  382. paper_map.put("Name","Claims History signed buyer");
  383. paper_map.put("Due_Date",contract_date.addDay(3));
  384. create_paperwork = zoho.crm.createRecord("Paperwork",paper_map,{"trigger":{"workflow"}});
  385. //Earnest Money Deposit Receipt
  386. paper_map.put("Name","Earnest Money Deposit Receipt");
  387. paper_map.put("Due_Date",contract_date.addDay(3));
  388. create_paperwork = zoho.crm.createRecord("Paperwork",paper_map,{"trigger":{"workflow"}});
  389. //All Inspections
  390. paper_map.put("Name","All Inspections");
  391. paper_map.put("Due_Date",inspection_over.addDay(3));
  392. create_paperwork = zoho.crm.createRecord("Paperwork",paper_map,{"trigger":{"workflow"}});
  393. //LSU
  394. paper_map.put("Name","Loan Status Update");
  395. paper_map.put("Due_Date",closing_date.subDay(7));
  396. create_paperwork = zoho.crm.createRecord("Paperwork",paper_map,{"trigger":{"workflow"}});
  397. //MLS Detailed History
  398. paper_map.put("Name","MLS Detailed History (after closing)");
  399. paper_map.put("Due_Date",closing_date.addDay(1));
  400. create_paperwork = zoho.crm.createRecord("Paperwork",paper_map,{"trigger":{"workflow"}});
  401. //Preliminary Title Report
  402. paper_map.put("Name","Preliminary Title Report");
  403. paper_map.put("Due_Date",contract_date.addDay(10));
  404. create_paperwork = zoho.crm.createRecord("Paperwork",paper_map,{"trigger":{"workflow"}});
  405. //Buyer Pre-Qualification or Proof of Funds
  406. paper_map.put("Name","Buyer Pre-Qual or Proof of Funds");
  407. paper_map.put("Due_Date",contract_date.addDay(3));
  408. create_paperwork = zoho.crm.createRecord("Paperwork",paper_map,{"trigger":{"workflow"}});
  409. //Repair Receipts
  410. paper_map.put("Name","Repair Receipts");
  411. paper_map.put("Due_Date",closing_date.subDay(3));
  412. create_paperwork = zoho.crm.createRecord("Paperwork",paper_map,{"trigger":{"workflow"}});
  413. //BINSR
  414. paper_map.put("Name","BINSR");
  415. paper_map.put("Due_Date",inspection_over);
  416. create_paperwork = zoho.crm.createRecord("Paperwork",paper_map,{"trigger":{"workflow"}});
  417. //Settlement Statement Estimated
  418. paper_map.put("Name","Estimated Settlement Statement");
  419. paper_map.put("Due_Date",closing_date.subDay(3));
  420. create_paperwork = zoho.crm.createRecord("Paperwork",paper_map,{"trigger":{"workflow"}});
  421. //Settlement Statement Final
  422. paper_map.put("Name","Final Settlement Statement");
  423. paper_map.put("Due_Date",closing_date.addDay(1));
  424. create_paperwork = zoho.crm.createRecord("Paperwork",paper_map,{"trigger":{"workflow"}});
  425. //Recorded Deed
  426. paper_map.put("Name","Recorded Deed");
  427. paper_map.put("Due_Date",closing_date.addDay(1));
  428. create_paperwork = zoho.crm.createRecord("Paperwork",paper_map,{"trigger":{"workflow"}});
  429. //SPDS Signed by Buyer
  430. paper_map.put("Name","SPDS Signed Buyer");
  431. paper_map.put("Due_Date",zoho.currentdate.addDay(1));
  432. create_paperwork = zoho.crm.createRecord("Paperwork",paper_map,{"trigger":{"workflow"}});
  433. //Tax Record
  434. paper_map.put("Name","Tax Record");
  435. paper_map.put("Due_Date",zoho.currentdate.addDay(1));
  436. create_paperwork = zoho.crm.createRecord("Paperwork",paper_map,{"trigger":{"workflow"}});
  437. //
  438. //------------------------------------------------End-------------------------//
Advertisement
Add Comment
Please, Sign In to add comment