Improper statement line 31 (Highlighted in red) pls help

Improper statement line 31 (Highlighted in red) pls help

// Fetch the current record from the AMER form
previous_record = AMER[ID == input.ID];
info "Previous Record: " + previous_record;

// Fetch the record from the AMER form by its unique ID
previous_status = previous_record.Status; // Get the old status
info "Previous Status: " + previous_status;

// Get the updated device status
current_status = input.Status;
info "Current Status: " + current_status;

// Define the statuses that should trigger an entry in the IN/OUT_Test form
trigger_statuses_out = List();
trigger_statuses_out.add("Sold");
trigger_statuses_out.add("Discarded");
trigger_statuses_out.add("Missing");
trigger_statuses_out.add("Active");

trigger_statuses_in = List();
trigger_statuses_in.add("Deprovisioning");
trigger_statuses_in.add("Spare (Old)");
trigger_statuses_in.add("Spare (New)");
trigger_statuses_in.add("Damaged");
trigger_statuses_in.add("Legal Hold");

info "Trigger Statuses OUT: " + trigger_statuses_out;
info "Trigger Statuses IN: " + trigger_statuses_in;

// Check if the status has changed and if it is one of the trigger statuses
if (current_status != previous_status && (current_status in trigger_statuses_out || current_status in trigger_statuses_in)) {
    // Determine IN or OUT based on the current status
    in_out_status = "IN";
    if (current_status in trigger_statuses_out) {
        in_out_status = "OUT";
    }
   
    // Create a new record in the IN/OUT_Test form
    new_record = insert into IN_OUT_Test
        .set("IN_OUT", in_out_status)
        .set("SERIAL_NUMBER", input.Serial_Number)
        .set("Computer_Name1", input.Computer_Name)
        .set("ASSIGN_UNASSIGN_DATE", zoho.currentdate)
        .set("USER_LOCATION", input.Location)
        .set("DEPARTMENT", input.Department)
        .set("Model_Description", input.Model_Description)
        .set("AU_Email", input.Assigned_User_Email)
        .set("Last_User", input.Last_User)
        .set("Added_User", zoho.loginuser);
    info "New record created: " + new_record;
} else {
    info "Condition not met for creating a new record.";
}



    Access your files securely from anywhere

        Zoho Developer Community




                                  Zoho Desk Resources

                                  • Desk Community Learning Series


                                  • Digest


                                  • Functions


                                  • Meetups


                                  • Kbase


                                  • Resources


                                  • Glossary


                                  • Desk Marketplace


                                  • MVP Corner


                                  • Word of the Day



                                      Zoho Marketing Automation


                                              Manage your brands on social media



                                                    Zoho TeamInbox Resources

                                                      Zoho DataPrep Resources



                                                        Zoho CRM Plus Resources

                                                          Zoho Books Resources


                                                            Zoho Subscriptions Resources

                                                              Zoho Projects Resources


                                                                Zoho Sprints Resources


                                                                  Qntrl Resources


                                                                    Zoho Creator Resources



                                                                        Zoho Campaigns Resources


                                                                          Zoho CRM Resources

                                                                          • CRM Community Learning Series

                                                                            CRM Community Learning Series


                                                                          • Kaizen

                                                                            Kaizen

                                                                          • Functions

                                                                            Functions

                                                                          • Meetups

                                                                            Meetups

                                                                          • Kbase

                                                                            Kbase

                                                                          • Resources

                                                                            Resources

                                                                          • Digest

                                                                            Digest

                                                                          • CRM Marketplace

                                                                            CRM Marketplace

                                                                          • MVP Corner

                                                                            MVP Corner





                                                                              Design. Discuss. Deliver.

                                                                              Create visually engaging stories with Zoho Show.

                                                                              Get Started Now