Configuring File and Image Uploads in FSM Mobile
The following examples are custom configuration fragments, not standard defaults or complete account configurations. Merge only the intended changes. For guidance on the shared Editor, activation, merging, and Preview, see Updating and Validating FSM Configuration.
This example uses an illustrative custom inspection record for CRM Task jobs. The record and fields are account-created. Replace their placeholder IDs consistently with the IDs from your account.
To configure form-generated file and image fields:
-
Provide the inspection record type, a Document field, and an Image field in NetSuite. The example IDs are
customrecord_example_inspection,custrecord_example_document, andcustrecord_example_image. The record must support native file attachments. The synchronization role must be able to create files, save the inspection record, and attach files to that record. -
Provide a field linking the inspection to the CRM Task. The example uses
custrecord_example_task. Make the document and image fields available on the form loaded for that record. -
Define the
inspectionresource as shown in the following example.article.parentsupplies the Task link for new inspections and restricts retrieval to that Task when no customarticle.filtersare supplied. If you supply customarticle.filters, include the Task restriction in those filters.article.parentdoesn't add the restriction to supplied filters.{ "routes/mobile": { "inspection": { "label": "Inspection", "article": { "record": "customrecord_example_inspection", "parent": "custrecord_example_task" }, "form": { "include": [ "custrecord_example_document", "custrecord_example_image" ] }, "automap": true, "element": { "custrecord_example_document": { "type": "file", "label": "Inspection Document", "required": true, "accept": "application/pdf,.pdf", "maxsize": 2048 }, "custrecord_example_image": { "type": "image", "label": "Inspection Photograph", "camera": true, "downsample": 1600 } } } } } -
Include
inspectionalongside the required existing resource IDs in the matching CRM Task rule atroutes/mobile.event.article.task.resources. For rule structure and array preservation, see Selecting Resources.
The document is required in FSM Mobile. The picker offers PDF selection, and the non-BMP size limit is 2,048 KB. The selected file must be smaller than this limit. The optional photograph requests camera capture and resizes supported BMP images to a maximum width or height of 1,600 pixels. These input choices don't change the NetSuite field types or capacity.
The form supplies the fields. The explicit elements apply the document and photograph settings in this example. For generated types, properties, initial values, and field-ID suffix recognition, see Form Field Translation.
Automap generates each field's file-reference mapping from its element name. An existing matching article.map entry takes precedence, so retain a complete compatible mapping if one is already configured. If another field or initial value is required to save the inspection, supply it through the form, elements, or article defaults as appropriate. The example's two-field include array is not a substitute for those record requirements.
This Task-link example applies to CRM Tasks. A Project Task requires its own valid relationship field and selection rule. A Task reference cannot be assumed to accept Project Task IDs.
Explicit File and Image Elements and Mappings
This alternative defines the same two inputs without loading a form. Use it in place of the preceding inspection definition, retaining the record, field, attachment, and resource-selection prerequisites. The element names now differ from the NetSuite field IDs, so the map identifies each destination explicitly.
When switching between these alternatives in custom JSON, replace the earlier resource definition rather than combining both sets of element names. Object merging otherwise retains the earlier elements and mappings. Keep any other account-specific fields required by the record.
{
"routes/mobile": {
"inspection": {
"label": "Inspection",
"form": false,
"automap": false,
"article": {
"record": "customrecord_example_inspection",
"parent": "custrecord_example_task",
"map": {
"document": {
"id": "=custrecord_example_document",
"url": "formulatext:nvl2({custrecord_example_document},'mobile/file/'||{custrecord_example_document.id}, '')"
},
"photo": {
"id": "=custrecord_example_image",
"url": "formulatext:nvl2({custrecord_example_image},'mobile/file/'||{custrecord_example_image.id}, '')"
}
}
},
"element": {
"document": {
"type": "file",
"label": "Inspection Document",
"required": true,
"accept": "application/pdf,.pdf",
"maxsize": 2048
},
"photo": {
"type": "image",
"label": "Inspection Photograph",
"camera": true,
"downsample": 1600
}
}
}
}
}
Each map loads the file ID and download address together. Its id entry writes the uploaded file ID to the destination field. The formula for the download address is read-only. Retain both entries so an existing document or photograph loads with its identity and link. For the primary-ID syntax and the syntax for reading and writing, see FSM Searches and Field Mapping.