If you’ve been creating a custom record in your Sandbox, finished coding up the rest of your project and are ready to bring everything over you can either looking at creating a bundle, or you can download the Object Definitions of each of your newly created Custom Records to transfer them over into Production.

There are a couple of things you may need to watch when you bring them over, such as the Object Definitions’ connections to other Custom Records already pre-existing in your Sandbox account.

Provided everything should be okay for your standalone project this is how you can transfer those Custom Records across without needing to design them from scratch again in your production account.

First, you’ll need to run a command-line prompt. This assumes you’re already connected to your Sandbox account in your terminal (run suitecloud account:setup to check or change) and you already have suitecloud installed.

If you’re good to go simply run a command where you’re changing the --scriptid flag to the id of your customrecord id:

$ suitecloud object:import --type customrecordtype --scriptid customrecord_YOUR_RECORD_ID --destinationfolder /Objects

For example, if I have created a Custom Record and its id has the label: customrecord_my_awesome_record

I would import this record as an Object Definition into my project by running the command:

$ suitecloud object:import --type customrecordtype --scriptid customrecord_my_awesome_record --destinationfolder /Objects

(Similarly, if you need to import a customrole then change the --type parameter to role and use the --scriptid parameter as the name of the custom role, for example: suitecloud object:import --type role --scriptid customroleXYZ --destinationfolder /Objects)

Suitecloud will then fetch the custom record and overwrite any existing project objects that I may have already downloaded of the same record.

The imported objects will overwrite the project objects
The following objects have been imported:
    - customrecordtype:customrecord_my_awesome_record

Updating your manifest.xml file

There may be instances where downloading the Custom Record may require updating your manifest.xml file.

If this is the case you may need to add some or all (or other!) features to your manifest.xml file (which is found in your src folder):

1
2
3
4
5
6
<dependencies>
	<features>
        <feature required="true">SERVERSIDESCRIPTING</feature>
        <feature required="true">CUSTOMRECORDS</feature>
	</features>
</dependencies>

Success of your download will mean the custom record from Netsuite has been added to your Objects folder, or whatever you defined in your --destinationfolder parameter.

It should look something like this:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
<customrecordtype scriptid="customrecord_XYZ">
  <accesstype>CUSTRECORDENTRYPERM</accesstype>
  <allowattachments>T</allowattachments>
  <allowinlinedeleting>F</allowinlinedeleting>
  <allowinlinedetaching>F</allowinlinedetaching>
  <customrecordcustomfields>
    <customrecordcustomfield scriptid="custrecord_ABC">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <defaultselection>[ACCOUNT_SPECIFIC_VALUE]</defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <enabletextenhance>F</enabletextenhance>
      <encryptatrest>F</encryptatrest>
      <fieldtype>SELECT</fieldtype>
      <globalsearch>F</globalsearch>
      <help>Enter the subsidiary which is the lender.</help>
      <isformula>F</isformula>
      <ismandatory>T</ismandatory>
      <isparent>F</isparent>
      <label>Lending Subsidiary</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete>NO_ACTION</onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype>-117</selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
  </customrecordcustomfields>
  // ETC ETC
  <subtabs>
    <subtab scriptid="ABCD">
      <tabparent></tabparent>
      <tabtitle>Transactions</tabtitle>
    </subtab>
  </subtabs>
</customrecordtype>