Sanjay191
Kilo Patron

Managing Bulk Attachment Fields in Mobile Agent

Overview

This article explains the implementation approach for handling bulk attachment fields in Mobile Agent applications. The solution focuses on managing attachments uploaded from mobile screens and mapping them to specific attachment fields on a table instead of directly attaching them to the record.

The implementation also includes:

  • Uploading multiple attachments through a custom mobile input page

  • Backend automation for attachment handling

  • Old attachment cleanup during updates

  • Displaying attachment count information on mobile list screens

This approach improves attachment management, provides better user visibility, and maintains clean attachment records within the system.


Requirement

In Mobile Agent, attachment handling for custom attachment fields is not directly supported in the same way as standard record attachments. The requirement was to:

  1. Allow users to upload multiple attachments from Mobile Agent.

  2. Store attachments against specific attachment fields on the target table.

  3. Replace old attachments when new files are uploaded.

  4. Display attachment-related information on the mobile list screen.


Solution Architecture

The complete solution was implemented using the following components:

  • Mobile Input Page

  • Backend Business Rules

  • Attachment Cleanup Logic

  • Mobile List Screen Enhancements


1. Create Mobile Input Page for Attachments

Objective

A dedicated mobile input page was created to allow users to upload multiple attachments from Mobile Agent.

Implementation

  • A custom mobile page/input form was developed.

  • Attachment upload fields were added for required attachment categories.

  • Users can select and upload multiple files directly from the mobile application.

Benefits

  • Easy attachment upload experience for mobile users

  • Supports bulk attachment handling

  • Better control over attachment processing


2. Backend Business Rule to Map Attachments to Field-Level Attachments

Objective

By default, Mobile Agent uploads attachments directly to the record. However, the requirement was to associate attachments with specific attachment fields on the table.

Implementation

A backend Business Rule was created to:

  • Capture attachments uploaded from the mobile page

  • Identify the target attachment field

  • Move or map the attachments appropriately

  • Maintain attachment references for field-level management

Key Logic

The Business Rule performs the following actions:

  1. Detect newly uploaded mobile attachments

  2. Identify the corresponding attachment field

  3. Associate attachments with the correct field

  4. Maintain attachment metadata for future operations

Benefits

  • Structured attachment handling

  • Field-wise attachment segregation

  • Better attachment tracking and maintenance


3. Business Rule for Old Attachment Cleanup

Objective

When users upload new attachments, the previous attachments must be removed to avoid duplicate or outdated files.

Problem Statement

Without cleanup logic:

  • Old attachments remain in the system

  • Duplicate files accumulate

  • Storage usage increases unnecessarily

Implementation

An additional backend Business Rule was created to:

  • Detect when new attachments are uploaded

  • Identify existing attachments linked to the same field

  • Delete old attachments before saving the new ones

Process Flow

  1. User uploads new attachment

  2. System checks for existing attachments

  3. Old attachments are deleted

  4. New attachments are attached successfully

Benefits

  • Prevents duplicate attachments

  • Keeps records clean

  • Reduces unnecessary storage usage

  • Ensures users always see the latest files


4. Display Attachment Information on Mobile List Screen

Objective

Users should be able to quickly identify how many attachments are associated with a record directly from the mobile list screen.

Implementation

Separate sections were added on the mobile list screen to display:

  • Attachment category name

  • Number of attachments uploaded

  • Visual indication for attachment availability

Example Display

Attachment Type Count
Repaired Equipment 2
New Equipment 1
RCA Documents 3

Benefits

  • Improved mobile user experience

  • Quick attachment visibility

  • Easy verification of uploaded documents

  • Better operational tracking


End-to-End Flow

Complete Workflow

  1. User opens Mobile Agent input page

  2. User uploads bulk attachments

  3. Attachments are temporarily stored

  4. Backend Business Rule maps attachments to field-level attachment references

  5. Existing old attachments are removed automatically

  6. New attachments are saved

  7. Attachment count is displayed on the mobile list screen


Technical Components Used

Mobile Components

  • Mobile Input Page

  • Mobile List Screen Configuration

  • Attachment Upload Controls

Backend Components

  • Business Rules

  • GlideRecord Operations

  • Attachment APIs

  • Attachment Cleanup Logic


Advantages of This Approach

  • Supports bulk attachment handling in Mobile Agent

  • Enables field-level attachment management

  • Automatically removes outdated attachments

  • Provides better visibility on mobile screens

  • Improves overall attachment lifecycle management


Conclusion

This implementation provides a scalable and structured solution for handling bulk attachments in Mobile Agent applications. By combining custom mobile pages, backend Business Rules, and attachment cleanup mechanisms, the system ensures efficient attachment management while maintaining a clean and user-friendly mobile experience.
#NowMobile #NowMobileAgent #FSM
Thank you