Monday, October 29, 2018

Sample Script to upload a file to the File Cabinet using Object Assistant APIs

This simple script will upload a file into the File Cabinet, specify the folder container, then attach the file to the Customer record, using Object Assistant APIs.

1. Create a .js file with the code below:

2. Navigate to Customization Scripting >  Scripts > New.
3. Select Suitelet for Type.
4. Fill out the Name and ID fields.
5. Under Scripts tab, select New from the Script File field and upload the script from Step 1.
6. Fill out the Function field.
7. Click Save and Deploy.
8. In the Script Deployment page, set the following:
    - Deployed = T
    - Status = Released
    - Log Level = Debug
    - Execute as Role = Administrator
9. Under Audience tab, mark the Select All checkbox next to the Roles selection.
10. Under Links tab, set the following:
    - Center = Classic Center
    - Section = Setup
    - Category = Custom
    - Label = File Upload Assistant
11. Click Save.

DISCLAIMER: The sample code described herein is provided on an "as is" basis, without warranty of any kind, to the fullest extent permitted by law. NetSuite Inc. does not warrant or guarantee the individual success developers may have in implementing the sample code on their development platforms or in using their own Web server configurations.

NetSuite Inc. does not warrant, guarantee or make any representations regarding the use, results of use, accuracy, timeliness or completeness of any data or information relating to the sample code. NetSuite Inc. disclaims all warranties, express or implied, and in particular, disclaims all warranties of merchant-ability, fitness for a particular purpose, and warranties related to the code, or any service or software related thereto.

NetSuite Inc. shall not be liable for any direct, indirect or consequential damages or costs of any type arising out of any action taken by you or others related to the sample code.

No comments:

Post a Comment