Populate field from one module into an other module

PHOTO EMBED

Tue Jul 01 2025 12:33:14 GMT+0000 (Coordinated Universal Time)

Saved by @Peaky ##pagination ##zoho ##crm ##zohocrm ##zoho_crm ##deluge

void automation.OCR_001_Fetch_Reservation_Details(Int Ownership_change_request_id)
{
Owner_map = Map();
Ownership_change_request_details = zoho.crm.getRecordById("Ownership_Change_Requests",Ownership_change_request_id);
info "Ownership_change_request_details ==>" + Ownership_change_request_details;
Reservation_Owner = Ownership_change_request_details.get("Reservation_Name");
info "Reservation_Owner ==>" + Reservation_Owner;
if(!Reservation_Owner.isNull() || !Reservation_Owner.isEmpty())
{
	Reservation_naame = Reservation_Owner.get("name");
	info "Reservation_naame ==>" + Reservation_naame;
	Reservation_id = Reservation_Owner.get("id");
	info "Reservation_id ==>" + Reservation_id;
	Reservation_details = zoho.crm.getRecordById("Deals",Reservation_id);
	info "Reservation_details ==>" + Reservation_details;
	Contact_Owner = Reservation_details.get("Contact_Name");
	info "Contact_Owner ==>" + Contact_Owner;
	if(!Contact_Owner.isNull() || !Contact_Owner.isEmpty())
	{
		Contact_name = Contact_Owner.get("name");
		info "Contact_name ==>" + Contact_name;
		contact_id = Contact_Owner.get("id");
		info "contact_id ==>" + contact_id;
		Owner_map.put("Customer_Name",Contact_Owner);
		Customer_Details = zoho.crm.getRecordById("Contacts",contact_id);
		info "Customer_Details ==>" + Customer_Details;
		Email = Customer_Details.get("Email");
		Owner_map.put("Customer_Email",Email);
	}
	Joint_buyer_name_owner = Reservation_details.get("Joint_buyer_name");
	info "Joint_buyer_name_owner ==>" + Joint_buyer_name_owner;
	if(!Joint_buyer_name_owner.isNull() || !Joint_buyer_name_owner.isEmpty())
	{
		Joint_buyer_name = Joint_buyer_name_owner.get("name");
		info "Joint_buyer_name ==>" + Joint_buyer_name;
		Joint_buyer_id = Joint_buyer_name_owner.get("id");
		info "Joint_buyer_id ==>" + Joint_buyer_id;
		Owner_map.put("Joint_buyer_name",Joint_buyer_name_owner);
	}
	Project = Reservation_details.get("Property");
	info "Project ==>" + Project;
	if(!Project.isNull() || !Project.isEmpty())
	{
		Owner_map.put("Project",Project);
	}
	Project_ID = Reservation_details.get("Project_ID");
	info "Project_ID ==>" + Project_ID;
	if(!Project_ID.isNull() || !Project_ID.isEmpty())
	{
		Owner_map.put("Project_ID",Project_ID);
	}
	Unit = Reservation_details.get("Unit");
	info "Unit ==>" + Unit;
	if(!Unit.isNull() || !Unit.isEmpty())
	{
		unit_name = Unit.get("name");
		info "unit_name ==>" + unit_name;
		unit_id = Unit.get("id");
		info "unit_id ==>" + unit_id;
		Owner_map.put("Unit",Unit);
	}
	Unit_Price_At_Sale = Reservation_details.get("Unit_Price_At_Sale");
	info "Unit_Price_At_Sale ==>" + Unit_Price_At_Sale;
	if(!Unit_Price_At_Sale.isNull() || !Unit_Price_At_Sale.isEmpty())
	{
		Owner_map.put("Unit_Price_At_Sale",Unit_Price_At_Sale);
	}
	Paid_Admin_Fee = Reservation_details.get("Paid_Admin_Fee");
	info "Paid_Admin_Fee ==>" + Paid_Admin_Fee;
	if(!Paid_Admin_Fee.isNull() || !Paid_Admin_Fee.isEmpty())
	{
		Owner_map.put("Paid_Admin_Fee",Paid_Admin_Fee);
	}
	Admin_Fee = Reservation_details.get("Admin_Fee");
	info "Admin_Fee ==>" + Admin_Fee;
	if(!Admin_Fee.isNull() || !Admin_Fee.isEmpty())
	{
		Owner_map.put("Admin_Fee",Admin_Fee);
	}
	Joint_Buyers_Multiple = Reservation_details.get("Joint_Buyers_Multiple");
	info "Joint_Buyers_Multiple ==>" + Joint_Buyers_Multiple;
	info "Joint_Buyers_Multiple.size ==>" + Joint_Buyers_Multiple.size();
	// 	if(!Joint_Buyers_Multiple.isNull() || !Joint_Buyers_Multiple.isEmpty() && Joint_Buyers_Multiple.size() > 0)
	// 	{
	// 		Joint_Buyers_Multiple_list = Joint_Buyers_Multiple.toList(",");
	// 		for each  my_Joint_Buyers_Multiple in Joint_Buyers_Multiple
	// 		{
	// 			info "my_Joint_Buyers_Multiple ==>" + my_Joint_Buyers_Multiple;
	// 			search_resp = zoho.crm.searchRecords("Contacts","(Full_Name:equals:" + my_Joint_Buyers_Multiple + ")");
	// 			info "search_resp ==>" + search_resp;
	// 			// 			Lead_owner = search_resp.get("Lead");
	// 			// 					info "Lead_owner   "
	// 		}
	// 		// 			Owner_map.put("Joint_Buyers_Multiple", Joint_Buyers_Multiple);
	// 	}
	
	
	// need to put in owner map 
	Payment_Details1 = Reservation_details.get("Payment_Details1");
	info "Payment_Details1 ==>"+Payment_Details1;
	
	
	Payment_Details1_size = Payment_Details1.size();
	info "Payment_Details1_size ==>"+Payment_Details1_size;
	
	
	Total_Amount_Payablee = Reservation_details.get("Total_Amount_Payablee");
	info "Total_Amount_Payablee ==>"+Total_Amount_Payablee;
	if ( !Total_Amount_Payablee.isNull() || !Total_Amount_Payablee.isEmpty() ) 
    {
			Owner_map.put("Total_Amount_Payable", Total_Amount_Payablee);
    }
/////// From Here
	Paid_Installment_Amount = Reservation_details.get("Paid_Installment_Amount");
	info "Paid_Installment_Amount ==>"+Paid_Installment_Amount;
		if ( !Paid_Installment_Amount.isNull() || !Paid_Installment_Amount.isEmpty() ) 
    {
			Owner_map.put("Paid_Installment_Amount", Paid_Installment_Amount);
    }
	
	Registration_Fees = Reservation_details.get("Registration_Fees");
	info "Registration_Fees ==>"+Registration_Fees;
		if ( !Registration_Fees.isNull() || !Registration_Fees.isEmpty() ) 
    {
			Owner_map.put("DLD_Registration_Fees", Registration_Fees);
    }
	
	DLD_Waiver_Amount = Reservation_details.get("DLD_Waiver_Amount");
	info "DLD_Waiver_Amount ==>"+DLD_Waiver_Amount;
		if ( !DLD_Waiver_Amount.isNull() || !DLD_Waiver_Amount.isEmpty() ) 
    {
			Owner_map.put("DLD_Waiver_Amount", DLD_Waiver_Amount);
    }
	
	Paid_Registration_Fee = Reservation_details.get("Paid_Registration_Fee");
	info "Paid_Registration_Fee ==>"+Paid_Registration_Fee;
		if ( !Paid_Registration_Fee.isNull() || !Paid_Registration_Fee.isEmpty() ) 
    {
			Owner_map.put("Paid_DLD_Registration_Fee", Paid_Registration_Fee);
    }
	
	Total_Paid_Amount_Report = Reservation_details.get("Total_Paid_Amount_Report");
	info "Total_Paid_Amount_Report ==>"+Total_Paid_Amount_Report;
		if ( !Total_Paid_Amount_Report.isNull() || !Total_Paid_Amount_Report.isEmpty() ) 
    {
			Owner_map.put("Total_Paid_Amount_Report", Total_Paid_Amount_Report);
    }
	Total_Amount_Paid = Reservation_details.get("Total_Amount_Paid");
	info "Total_Amount_Paid ==>"+Total_Amount_Paid;
		if ( !Total_Amount_Paid.isNull() || !Total_Amount_Paid.isEmpty() ) 
    {
			Owner_map.put("Total_Amount_Paid_AED", Total_Amount_Paid);
    }
	DLD_Waiver = Reservation_details.get("DLD_Waiver");
	info "DLD_Waiver ==>"+DLD_Waiver;
		if ( !DLD_Waiver.isNull() || !DLD_Waiver.isEmpty() ) 
    {
			Owner_map.put("DLD_Waiver", DLD_Waiver);
			Choose_waiver = Reservation_details.get("Choose_waiver");
			info "Choose_waiver ==>"+Choose_waiver;
			if ( !Choose_waiver.isNull() || !Choose_waiver.isEmpty() ) 
            {
				Owner_map.put("Choose_waiver", Choose_waiver);
            }
    }
	DLD_Admin_fees_paid= Reservation_details.get("DLD_Admin_fees_paid");
	info "DLD_Admin_fees_paid ==>"+DLD_Admin_fees_paid;
		if ( !DLD_Admin_fees_paid.isNull() || !DLD_Admin_fees_paid.isEmpty() ) 
    {
			Owner_map.put("DLD_Admin_fees_paid", DLD_Admin_fees_paid);
    }
	DLD_Payment_Date = Reservation_details.get("DLD_Payment_Date");
	info "DLD_Payment_Date ==>"+DLD_Payment_Date;
		if ( !DLD_Payment_Date.isNull() || !DLD_Payment_Date.isEmpty() ) 
    {
			Owner_map.put("DLD_Payment_Date", DLD_Payment_Date.toDate());
    }
	SPA_Issued_Date = Reservation_details.get("SPA_Issued_Date");
	info "SPA_Issued_Date ==>"+SPA_Issued_Date;
		if ( !SPA_Issued_Date.isNull() || !SPA_Issued_Date.isEmpty() ) 
    {
			Owner_map.put("SPA_Issued_Date", SPA_Issued_Date.toDate());
    }
	
	
    }
	
update_ownership_change_request = zoho.crm.updateRecord("Ownership_Change_Requests",Ownership_change_request_id,Owner_map);
info "update_ownership_change_request ==>" + update_ownership_change_request;
}
content_copyCOPY