// Add NEW ACCOUNT
newAccountName = input.New_Account_Name1;
parentAccountId = "2073479000108966015"; // ID of the Parent Account
if (input.AccountsDD == "New Account") {
newAccount = Map();
newAccount.put("Account_Name", newAccountName);
createResponse = zoho.crm.createRecord("Accounts", newAccount);
if (createResponse.get("status") == "success") {
newAccountId = createResponse.get("id");
info "New account created successfully! ID: " + newAccountId;
// Introduce a delay (optional)
updateAccount = Map();
updateAccount.put("Parent_Account_New", parentAccountId); // Use the correct API name and Parent Account ID
response = zoho.crm.updateRecord("Accounts", newAccountId, updateAccount);
info "Update Response: " + response;
}
}