Version: eXtendFiles 1.5.4.3 and above
Audience: Administrator, Developer
Introduction
This guide will help you optimize your eXtendFiles approval templates by allowing you to return only necessary data as well as utilize use line item data.
Configuration
When configuring your approval templates, you can apply specific labels to the custom label section of your saved search results columns. These labels allow you to filter and tailor the data that is returned in the multi-approval JSON response.
Label 1: extend|txt
By using this label, the JSON response will only include the text value of a field (if it exists). This is especially useful for fields that contain both a text value and an ID, as you can eliminate the ID from the response.
Example:
a. Without the extend|txt label:
custrecord_extfile_so_pref": {"text": "Sales Order #SLS00548346","value": "43673"}
b. With the extend|txt label:
custrecord_extfile_so_pref": "Sales Order #SLS00548346"
Label 2: extend|val
Similar to the first label, this option will return only the ID of a record instead of its name.
Example:
a. Without the extend|val label:
custrecord_extfile_so_pref": {"text": "Sales Order #SLS00548346","value": "43673"}
b. With the extend|val label:
custrecord_extfile_so_pref": "43673"
Label 3: extend|nrcombine
This label groups common data into a single 'common' object in the JSON response. This reduces redundancy and makes the response more concise.
Please note, this label will only work if the field value is common across all records in the JSON response. If the value differs, it will not be displayed.
You can use the extend|txt and extend|val labels in combination with this label for a more refined response. The combination should be used as follows: extend|txt,nrcombine, extend|val,nrcombine or extend|txt,val,nrcombine.
Example
a. Without the extend|nrcombine label:
{"success": true,"records": [{"id": "4828","custrecord_extfile_approval_id": "ba3f045d-54a4-4dcd-b522-fc87f446a76b","custrecord_extfile_approved": "F","custrecord_extfile_filename": "lukasz-szmigiel-NeSykhHkyQw-unsplash.jpg","custrecord_extfile_submituser": "","custrecord_extfile_rejected": "F","custrecord_extfile_rejectionreason": "","custrecord_extfile_type_system": "image/jpeg","custrecord_extfile_link": "https://suitextend.sharepoint.com/:i:/g/EZralnBTEyVPgQTlvYZm3TcBuzUUUuuwVmsTCU6QTVQVOA?download=1","custrecord_extfile_user_comments": "","custrecord_extend_preview_image": "https://suitextend.sharepoint.com/:i:/g/EZralnBTEyVPgQTlvYZm3TcBuzUUUuuwVmsTCU6QTVQVOA?download=1","custrecord_extend_preview_file_format": "image/jpeg","custrecord_extfile_so_pref": {"text": "Sales Order #SLS00548346","value": "43673"}},{"id": "4929","custrecord_extfile_approval_id": "95073d93-bd8b-4f1d-b22d-e33b9eaa09db","custrecord_extfile_approved": "F","custrecord_extfile_filename": "Komatsu-911-harvester.jpg","custrecord_extfile_submituser": "","custrecord_extfile_rejected": "F","custrecord_extfile_rejectionreason": "","custrecord_extfile_type_system": "image/jpeg","custrecord_extfile_link": "https://drive.google.com/uc?id=101MyiEgWsczHBeuf_jOy31IYu05iuyWc","custrecord_extfile_user_comments": "","custrecord_extend_preview_image": "https://drive.google.com/uc?id=101MyiEgWsczHBeuf_jOy31IYu05iuyWc","custrecord_extend_preview_file_format": "image/jpeg","custrecord_extfile_so_pref": {"text": "Sales Order #SLS00548346","value": "43673"}},{"id": "5028","custrecord_extfile_approval_id": "7cd525e1-726b-48c6-bf57-affeabba7414","custrecord_extfile_approved": "F","custrecord_extfile_filename": "Komatsu-911-harvester.jpg","custrecord_extfile_submituser": "","custrecord_extfile_rejected": "F","custrecord_extfile_rejectionreason": "","custrecord_extfile_type_system": "image/jpeg","custrecord_extfile_link": "https://suitextend.sharepoint.com/:i:/g/Ed9Fg6Hi33lNgT-qjTWJyQMB5H1kiNrnjq_0H3gY_NHlYg?download=1","custrecord_extfile_user_comments": "","custrecord_extend_preview_image": "https://suitextend.sharepoint.com/:i:/g/Ed9Fg6Hi33lNgT-qjTWJyQMB5H1kiNrnjq_0H3gY_NHlYg?download=1","custrecord_extend_preview_file_format": "image/jpeg","custrecord_extfile_so_pref": {"text": "Sales Order #SLS00548346","value": "43673"}}],"common": {"CUSTRECORD_EXTFILE_SO_PREF": {"custbody_extend_public_upload_link": "https://qa4.qa.suitextend.net/v1/files/salesorder/checkupload/672fb0c8-a0a9-4623-8010-df3dc684b130?storage=s3aws","statusref": "Pending Fulfillment","recordType": "salesorder","otherrefnum": "","timeStamp": "2019-09-04T06:08:39.848Z"},"fromGlom": 1},"v": 3,"company": {"name": "eXtendTech Leading QA","url": "www.netsuite.com","mainAddress": "Jeff Honeycomb<br>HQ<br>100 Rodeo Drive<br>Beverly Hills CA 90210<br>United States"},"id": "672fb0c8-a0a9-4623-8010-df3dc684b130","userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36"}
b. With the extend|nrcombine label:
{ "success": true, "records": [ { "id": "4728", "custrecord_extfile_approval_id": "a3bcdbf8-1ad4-4334-af3b-8ddc85731635", "custrecord_extfile_approved": "F", "custrecord_extfile_filename": "Gallery_S172_1.jpg", "custrecord_extfile_submituser": "", "custrecord_extfile_rejected": "F", "custrecord_extfile_rejectionreason": "", "custrecord_extfile_type_system": "image/jpeg", "custrecord_extfile_link": "https://suitextend.sharepoint.com/:i:/g/EcdQuBp65ydFl5db9psYdREBIT2SJG4pZfExxwFwEsIqEQ?download=1", "custrecord_extfile_user_comments": "", "custrecord_extend_preview_image": "https://suitextend.sharepoint.com/:i:/g/EcdQuBp65ydFl5db9psYdREBIT2SJG4pZfExxwFwEsIqEQ?download=1", "custrecord_extend_preview_file_format": "image/jpeg" }, { "id": "4828", "custrecord_extfile_approval_id": "ba3f045d-54a4-4dcd-b522-fc87f446a76b", "custrecord_extfile_approved": "F", "custrecord_extfile_filename": "lukasz-szmigiel-NeSykhHkyQw-unsplash.jpg", "custrecord_extfile_submituser": "", "custrecord_extfile_rejected": "F", "custrecord_extfile_rejectionreason": "", "custrecord_extfile_type_system": "image/jpeg", "custrecord_extfile_link": "https://suitextend.sharepoint.com/:i:/g/EZralnBTEyVPgQTlvYZm3TcBuzUUUuuwVmsTCU6QTVQVOA?download=1", "custrecord_extfile_user_comments": "", "custrecord_extend_preview_image": "https://suitextend.sharepoint.com/:i:/g/EZralnBTEyVPgQTlvYZm3TcBuzUUUuuwVmsTCU6QTVQVOA?download=1", "custrecord_extend_preview_file_format": "image/jpeg" }, { "id": "4929", "custrecord_extfile_approval_id": "95073d93-bd8b-4f1d-b22d-e33b9eaa09db", "custrecord_extfile_approved": "F", "custrecord_extfile_filename": "Komatsu-911-harvester.jpg", "custrecord_extfile_submituser": "", "custrecord_extfile_rejected": "F", "custrecord_extfile_rejectionreason": "", "custrecord_extfile_type_system": "image/jpeg", "custrecord_extfile_link": "https://drive.google.com/uc?id=101MyiEgWsczHBeuf_jOy31IYu05iuyWc", "custrecord_extfile_user_comments": "", "custrecord_extend_preview_image": "https://drive.google.com/uc?id=101MyiEgWsczHBeuf_jOy31IYu05iuyWc", "custrecord_extend_preview_file_format": "image/jpeg" }, { "id": "5028", "custrecord_extfile_approval_id": "7cd525e1-726b-48c6-bf57-affeabba7414", "custrecord_extfile_approved": "F", "custrecord_extfile_filename": "Komatsu-911-harvester.jpg", "custrecord_extfile_submituser": "", "custrecord_extfile_rejected": "F", "custrecord_extfile_rejectionreason": "", "custrecord_extfile_type_system": "image/jpeg", "custrecord_extfile_link": "https://suitextend.sharepoint.com/:i:/g/Ed9Fg6Hi33lNgT-qjTWJyQMB5H1kiNrnjq_0H3gY_NHlYg?download=1", "custrecord_extfile_user_comments": "", "custrecord_extend_preview_image": "https://suitextend.sharepoint.com/:i:/g/Ed9Fg6Hi33lNgT-qjTWJyQMB5H1kiNrnjq_0H3gY_NHlYg?download=1", "custrecord_extend_preview_file_format": "image/jpeg" } ], "common": { "custrecord_extfile_so_pref": { "text": "Sales Order #SLS00548346", "value": "43673" }, "CUSTRECORD_EXTFILE_SO_PREF": { "custbody_extend_public_upload_link": "https://qa4.qa.suitextend.net/v1/files/salesorder/checkupload/672fb0c8-a0a9-4623-8010-df3dc684b130?storage=s3aws", "statusref": "Pending Fulfillment", "recordType": "salesorder", "otherrefnum": "", "timeStamp": "2019-09-04T06:08:39.848Z" }, "fromGlom": 1 }, "v": 3, "company": { "name": "eXtendTech Leading QA", "url": "www.netsuite.com", "mainAddress": "Jeff Honeycomb<br>HQ<br>100 Rodeo Drive<br>Beverly Hills CA 90210<br>United States" }, "id": "672fb0c8-a0a9-4623-8010-df3dc684b130", "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/76.0.3809.100 Safari/537.36" }
Label 4: extend|line
Use this label for line item fields to avoid repeating record objects in the JSON response. It can be combined with labels 1 and 2 as follows: extend|txt,line and extend|val,line.
Be sure to set the a transaction record's Main Line, Tax Line, and Shipping Line to false. This ensures only main item lines are shown in the search results and JSON response, and not tax lines or shipping items. If you are not using the extend|line custom label in your saved search, ensure your template can handle it to avoid errors
Example:
When using this label, all items in the order will be listed under the 'items' array in the 'common' object. If you want line item data available, it's important to add the 'Line Sequence Number' field in your search column and specify the custom label as extend|line. If not, all items will not be listed in your JSON response.
"common": { "items": [ { "item": "19118", "quantity": "5", "linesequencenumber": "2" }, { "item": "15700", "quantity": "2", "linesequencenumber": "1" } ], "custrecord_extfile_so_pref": { "text": "Sales Order #SLS00548346", "value": "43673" }, "CUSTRECORD_EXTFILE_SO_PREF": { "custbody_extend_public_upload_link": "https://qa4.qa.suitextend.net/v1/files/salesorder/checkupload/672fb0c8-a0a9-4623-8010-df3dc684b130?storage=s3aws", "statusref": "Pending Fulfillment" } }
Frequently Asked Questions (FAQs)
- What is the purpose of the "extend|txt" label? The "extend|txt" label is used to include only the text value of a field in the JSON response. This is useful for fields that contain both a text value and an ID, as it eliminates the ID from the response.
- What does the "extend|val" label do? Similar to the "extend|txt" label, the "extend|val" label returns only the ID of a record, rather than its name.
- What is the function of the "extend|nrcombine" label? The "extend|nrcombine" label groups common data into a single 'common' object in the JSON response, reducing redundancy and making the response more concise.
- What is the "extend|line" label used for? The "extend|line" label is used for line item fields to avoid repeating record objects in the JSON response. It can be combined with the "extend|txt" and "extend|val" labels. It's important to add the 'Line Sequence Number' field in your search column for this to work properly.
- How can I ensure only main item lines are shown in the search results and JSON response? You need to set a transaction record's Main Line, Tax Line, and Shipping Line to false. This ensures only main item lines are shown and not tax lines or shipping items.
- Why are unexpected line items being included in the response which aren't listed on the transaction record's line items?
If Assembly Items are being returned on records included in the underlying saved search, the unexpected line items could be the component items that constitute the assembly item. When performing a joined saved search, such as the eXtendFiles record to the Sales Order record, NetSuite returns both the assembly item and each component item in the results even though only the assembly item is shown on the sales order. There are two ways to manage this within the approval template context: - Incorporate logic into your approval template page to prevent component items from being returned to the approval page.
- Include logic in your saved search to prevent component items from displaying.
- One method to achieve this is to identify a custom transaction line field that is consistently populated for all items on your transaction. Items that are actually listed on the transaction would have this value, but component items of an assembly item (which aren't actually on the transaction record) would not have a value populated. Therefore, they could be excluded by using the custom transaction line field as criteria in your saved search.