Calling Magento 2 API from NetSuite

I needed a way to move data from NetSuite to Magento. Here is a simple example that creates an attribute set in Magento. This example runs in a NetSuite debugger session. It is written in SuiteScript 2.1.

To create your token in Magento. Login in as admin. Go to
System >> Integrations >> Add New Integration

Once you’ve added your integration, Magento will create an Access Token. This is your Bearer Token.

Use the Bearer Token in your header. Refer to the Magento 2 Admin REST endpoint’s documentation to correctly build the body. Here is example code.

require(['N/https'],
    (https) => {

        var header = {
            'Authorization': 'Bearer [your token here]',
            'Accept': 'application/json',
            'Content-Type': 'application/json; charset=utf-8'
        };

        var body = JSON.stringify(
            {
                "attributeSet": {
                    "attribute_set_name": "[Your attribute set name here]"
                },
                "skeletonId": 4
            }
        );

        https.post.promise({
            url: encodeURI('https://[Your Magento base domain here]/rest/default/V1/products/attribute-sets'),
            body: body,
            headers: header
        })
            .then(function (response) {
                log.debug({
                    title: 'Response',
                    details: response
                });
            })
            .catch(function onRejected(reason) {
                log.debug({
                    title: 'Invalid Request: ',
                    details: reason
                });
            })


    }
)

Calculated Fields – A Checklist

I needed away to roll up entries from a custom table to display as a single value under an item record. What a meticulous and tedious pain this was. I can’t think of any more applicable adjectives, or I’d use them. I needed a checklist!

To be fair, NetSuite is great about letting you create a saved search to display summary results in what they call a “Calculated Custom Field”. It displays as if the value was actually stored with the entity, but it’s not, it’s built on the fly. In my case, I needed to show the SuiteCommerce Advanced base image from the list of images associated with any item.

The task at hand presented multiple problems. I’ll spare you the details of the first problem, which was an inability to write a saved search listing only images associated with a single item. I learned this is not supported in NetSuite, so I had to built my own custom table. Note: I used a SuiteQL query against the ItemImage table (Thank you Tim Dietrich) along with a Map/Reduce script. This let me build a copy of the ItemImage table which WAS accessible from a Saved Search.

This brings me to the list of all quirky things required show the one file name under an item. Here is that list!

  • Identify the standard or custom table you wish to pull your value from. In my case it was a custom table called “Item Images”.
  • Create a saved search against your source table.
    • Make your search public.
    • Add any criteria you like. In my case it was “Base Image” = true.
    • Include the entity type as the first field in your results.
    • Make sure the results are “Summary Results”. In my case I used MINIMUM File Name
    • Create an Available filter that limits results to a single entity and make sure to check “Show in Filter Region”.
Add any criteria you like
The first field in results should be the entity, or in my case, Item. Make sure the results are “Summary Results”. I don’t believe you can select “Group” under “Summary Type”. I chose “Minimum” and it works!
Set an available filter that matches your entity type. Again, in my case, it was Item. Be sure to check “Show in Filter Region.”
  • Create a new Custom Field.
    • Pick the field type that is correct for the rolled up value you will display from your saved search.
    • Uncheck “Store Value”. This value will not be stored, but calculated on the fly.
    • Under “Validation and Defaulting”, select the saved search your just created.
Select the proper field type. Uncheck “Store Value” and associate your calculated field with your new saved search.
Be sure to include the parent record reference in your custom table.

Tying up lose ends, I’ll show the definition of my custom table.

Be sure your entity field is also set to “Record is Parent”.

Hopefully, in the future, if we all follow this checklist, we’ll be thinking happy thoughts about NetSuite and not letting fly any uncomplimentary adjectives. Cheers!

Example: Magento API from Node.js with Axios

I feel like every time I post, the answer is simple, but the documentation is terrible. The task: Call Magento API from a JavaScript program in Node.js.

  • Login to your Magento Admin account at https://%5Byour-domain%5D/admin
  • Create an integration: System >> Integrations >> Add New Intgration
  • Copy the Access Token for use later in the header of your get request

Here is the code in a format you can cut and paste.

const axios = require('axios').default;

axios({
    method: 'get',
    url: 'https://[My URL Here]/rest/default/V1/products' +
            '?searchCriteria[currentPage]=1&searchCriteria[pageSize]=5',
    responseType: 'text/json',
    timeout: 1000,
    headers: {'authorization': 'Bearer [My Access Token Here]'}
  })
    .then(function (response) {
      console.log(JSON.stringify(response.data));
    })
    .catch(function(err) {
        console.log(err.message);
    })
    .finally(
        function() {
            console.log('finally');
        }
    )

SuiteScript 2.1 – SUITESCRIPT_API_UNAVAILABLE_IN_DEFINE

ES6 got me! The same code in SuiteScript 2.0 passes all syntax checks, but when converted to SuiteScript 2.1 fails to upload to NetSuite. What the heck? I’m not even going to try to explain this. I’m just going to show the problem and the fix with examples.

This PASSES syntax checks but FAILS to upload to NetSuite:

This PASSES syntax checks and SUCCEEDS to upload to NetSuite:

The only difference is moving the reference to N/format inside the main function. Apparently this is something the NetSuite JavaScript compiler frowns upon, but the vsCode syntax checker is OK with.

My complaint is with the NetSuite error message. It’s ugly! I formatted it here to make easier to parse with the eyes. If you are reading this, you already know it comes out as a jumbled mess on the screen. Argh!

Here is the actual text you’d see on the screen, again I formatted it to make it readable. I’m including it in text to help find this article if you experience this error. It’s exactly what you see above.

Notice
 
Fail to evaluate script:
{
    "type": "error.SuiteScriptError",
    "name": "SUITESCRIPT_API_UNAVAILABLE_IN_DEFINE",
    "message": "All SuiteScript API Modules are unavailable while executing your define callback.",
    "stack": [
        "Error\n at /SuiteScripts/Logic/your_suitelet_here.js:24:32"
    ],
    "cause": {
        "type": "internal error",
        "code": "SUITESCRIPT_API_UNAVAILABLE_IN_DEFINE",
        "details": "All SuiteScript API Modules are unavailable while executing your define callback.",
        "userEvent": null,
        "stackTrace": [
            "Error\n at /SuiteScripts/your_suitelet_here.js:24:32"
        ],
        "notifyOff": false
    },
    "id": "",
    "notifyOff": false,
    "userFacing": true
}

GitHub Local Repository on Microsoft OneDrive – I’m out!

I’m a developer who bounces back and forth between working at the office and working from home. I have a full developer setup in both places. I know… “First world problems!” Because I work in the cloud, publishing JavaScript files to NetSuite, I noticed files were checking in and out of GitHub on both systems, but did not match what I last uploaded to NetSuite. What was going on?

Using remote access from home to my office, I did a couple of tests.

  • I trued up source code at home, in the office, and in NetSuite. (WinMerge will compare files in 3 directories).
  • I modified one JavaScript file at home and checked it in.
  • I pushed changes to the remote repository on GitHub.
  • I pulled from my office computer. Changes came through.
  • I modified the file again in the office, checked back in and pushed to remote repository.
  • Pulled again from home. All was fine. Changes were there.
  • I came back a few minutes later on the same home computer and changes were gone!!!!!
  • Both systems were saying they were fully up to date with the same repository on GitHub (remote).
  • The same file on home and office were not in sync.
  • I deleted the local repository on my office computer, and cloned it again outside of OneDrive.
  • Interestingly enough, my home computer then prompted with a pull request and proceeded to update the file which had been out of sync, and replaced it with the correct version. Again, this was my home computer! Crazy.

This was such an odd situation, I thought I’d document it. I’ll add, and I have no real understanding of this, my new rule is, “I’m already saving updated source code in the remote repository. What again is the point of OneDrive? So I’m now personally steering clear of OneDrive for my local repositories.” I don’t need any more hassles! I have enough writing software for a living.

Avalara’s Avatax Bundle in NetSuite – Demystified (Developer Notes)

I’ve been asked to investigate why our NetSuite system is making so many calls to Avalara to calculate tax. Each call costs, and we make an inordinate number of calls. These notes are mainly for me, but I’m happy to share. If anything in this post is incorrect, please feel free to comment. This is not intended to disparage Avalara, it’s simply notes about how to manage it.

First, I’ve determined that any time transactions (Estimates, Sales Orders and possibly Invoices) are saved, a web service call is made to Avalara to calculate tax. Cha Ching!

Second, and to Avalara’s credit, they offer configuration options for turning off the tax calculation on each type of transaction. So if you don’t need tax on an estimate, just turn it off. However, if you convert an estimate to a sales order, you may want the totals to match, and that requires tax.

Third, if nothing affecting the tax calculation changes, you would expect Avalara to skip the web service call. It does not! Consider this, someone copies an estimate/quote to make a revision. Nothing changes. The shipping address and all items in the quote remain 100% the same as the copied transaction. However, at that instant, the newly created copy isn’t saved until the user clicks Save, Cha Ching! If anything is changed in the transaction, like assigning a second sales rep, anything, Cha Ching! And so on, and so on, and so on. Cha Ching.

Now, here are some notes regarding how to track the web services calls. Open a transaction and save it, without changing anything. NetSuite will prompt to confirm. Say yes. Next, view the AvaTax tab. You’ll see something like this. Check the timestamps, it confirms you just made a webservice call to Avalara! If you click “More…”, you’ll see the response includes your calculated tax amount.

Developer Notes:

Avalara is installed as a bundle and associated scripts live in the file cabinet in “/SuiteBundles/Bundle 1894”.

AvaTax got an upgrade from SuiteScript 1.0 to SuiteScript 2.0 with AvaTax 7.6. If you have not upgraded your Avalara bundle in some time, you should. All code from 7.6 on which affects web services calls has been upgraded and moved to new libraries.

Reviewing Avalara code:

It’s an easy task to browse to “/SuiteBundles/Bundle 1894” and download the entire directly. It comes down as a zipped file which can be expanded and checked into source control.

In AVA_CLI_Transaction.js (the naming conventions make it very easy to find the client-side scripts that handle the Save and Calculate Tax buttons), you’ll find AVA_TransactionSave() and AVA_CalcuateOnDemand() functions. Because they are client-side calls you can evaluate these using Chrome Developer Tools.

Ultimately, calls wind up at TaxLibrary.js AVA_CalculateTax(). It is important to note that this library is not available in VIEW mode, but only in EDIT mode when setting stops in Chrome Developer tools.

And finally, here is where I stopped my research prior to writing this post, you can make a direct call to AVA_CalculateTax() from the console window of Chrome Developer Tools. It looks like this. Open a transaction in EDIT mode. Let it fully load. Then paste this into the console window of Chrome Dev Tools. You can step through the entire process of updating the tax amount, including the web services call.

Snapshot of vsCode sample call to calculate tax
require(['N/currentRecord', '/SuiteBundles/Bundle 1894/utility/AVA_TaxLibrary.js'],
    function (currentRecord, tax_lib) {
        var cRecord = currentRecord.get();
        var connectionStartTime = new Date();
        debugger;
        tax_lib.AVA_CalculateTaxOnDemand(cRecord, connectionStartTime);
    }
)

This call appears to calculate tax and update your transation (I didn’t actually confirm that the tax amount has been updated). And, it does not log the web services call in the AvaTax tab. That remains to be investigated.

It took time to get this far and I don’t want to lose my research. Thus, this blog article. If anyone picks up here, send me a comment and perhaps you can return the favor by saving me some time. Thanks!

NetSuite Email Capture Example

I wish I’d known this much sooner. NetSuite’s email capture script is a great way to incorporate incoming email directly into NetSuite.

First, my company uses Outlook 365 in the cloud. We set a rule to forward incoming email to a particular address on to NetSuite. The mail remains in the original mailbox in Outlook 365, but also arrives as though sent by the original sender in NetSuite. When it arrives in NetSuite, a custom Email Capture script reads the message, records all the detail such as FROM, TO, SUBJECT, BODY and all ATTACHMENTS into a custom record type. That record type is included in a saved search, which is then displayed as a shared dashlet, accessed by an entire department.

Individuals in the department assign themselves to the incoming emails and set a status letting their colleagues know they have it. That begins a workflow in NetSuite. It’s really slick, and really easy to implement.

First, here is a sample script. It’s written in SuiteScript 1.0. I was unable to find documentation on writing this in any other version of SuiteScript. Feel free to add comments to this article if I’ve missed something.

function process(email) {

    const IS_PRODUCTION = true;

    const valid_types = [
        'APPCACHE',
        'AUTOCAD',
        'BMPIMAGE',
        'CERTIFICATE',
        'CONFIG',
        'CSV',
        'EXCEL',
        'FLASH',
        'FREEMARKER',
        'GIFIMAGE',
        'GZIP',
        'HTMLDOC',
        'ICON',
        'JAVASCRIPT',
        'JPGIMAGE',
        'JSON',
        'MESSAGERFC',
        'MP3',
        'MPEGMOVIE',
        'MSPROJECT',
        'PDF',
        'PJPGIMAGE',
        'PLAINTEXT',
        'PNGIMAGE',
        'POSTSCRIPT',
        'POWERPOINT',
        'QUICKTIME',
        'RTF',
        'SCSS',
        'SMS',
        'STYLESHEET',
        'SVG',
        'TAR',
        'TIFFIMAGE',
        'VISIO',
        'WEBAPPPAGE',
        'WEBAPPSCRIPT',
        'WORD',
        'XMLDOC',
        'XSD',
        'ZIP',
    ]

    var fromAddress = email.getFrom();
    nlapiLogExecution('DEBUG', 'Email - from: ' + fromAddress.getName() + ', ' + fromAddress.getEmail());
    nlapiLogExecution('DEBUG', 'subject - ' + email.getSubject());

    var newRec = nlapiCreateRecord('customrecord_xxxxxxxxxxxxxxxxxxxxxxxxxxxx');
    newRec.setFieldValue('custrecord_xxxxxxxxxx', fromAddress.getName());
    newRec.setFieldValue('custrecord_xxxxxxxxxx', fromAddress.getEmail());
    newRec.setFieldValue('custrecord_xxxxxxxxxx', email.getSubject());
    newRec.setFieldValue('custrecord_xxxxxxxxxx', email.getTextBody());
    var newRec_id = nlapiSubmitRecord(newRec, true);

    var attachments = email.getAttachments();

    // This variable is here in case you wanted to add notes about attachments.
    // it is currently unused. 
    var processing_notes = '';

    for (var indexAtt in attachments) {
        var attachment = attachments[indexAtt];
        nlapiLogExecution('DEBUG', 'Attachment: ' + attachment.getName() + ', ' + attachment.getType());

        // If the file name does not have an extension, skip it
        var fileName = attachment.getName();
        if (fileName.indexOf('.') <= 0) continue;

        // add a unique suffix to the file name, but leave the extension as-is
        var fileArray = fileName.split('.');
        var newName = '';
        for (var i = 0; i < fileArray.length; i++) {
            if (i == fileArray.length - 1) {
                newName += ('_' + (new Date().valueOf()).toString());
            }
            newName += ('.' + fileArray[i]);
        }
        
        // Lookup the file type to see if it is supported, else save as PLAINTEXT
        // This really won't affect being able to open and download the file.
        // It only affects filtering files by type.
        var file_type = attachment.getType().toUpperCase();
        if (valid_types.filter(function (p) { return p == file_type }).length == 0) {
            file_type = 'PLAINTEXT';  // Import nonrecognized file types as Other Binary File
        }

        var file = nlapiCreateFile(newName, file_type, attachment.getValue());

        // Save the file under a selected folder in the file cabinet
        file.setFolder(1111111111); //Internal ID of folder to hold imported attachments
        var file_id = nlapiSubmitFile(file);

        // Attach the file to a custom record type
        nlapiAttachRecord('file', file_id, 'customrecord_xxxxxxxxxxxxxxxxxxxxxxxxxxxx', newRec_id);
    }

    // here is where you'd include notes about attachments, perhaps those that were erroniously
    // saved under the PLAINTEXT type.
    nlapiSubmitField('customrecord_xxxxxxxxxxxxxxxxxxxxxxxxxxxx', newRec_id, 'custrecord_xxxxxxxxxx', processing_notes);
}

Once you upload your script to the file cabinet, go to Customizations >> Plug-Ins >> Plug-In Implementations >> New

Customizations >> Plug-Ins >> Plug-In Implementations

Select your script. Next, look for it under Manage Plug-Ins.

Your new Email Capture Script shows up here along with the associated NetSuite email address. Be sure to activate your script by checking the box next to your Plug-In.

To test, click the link. It should open your default email client (in my case it is Outlook 365) and address the mail to this address. Send your test message and in a couple of seconds, it will be picked up and processed by the new script. It’s fast!

Once you are happy with your script, set Outlook 365 (the server-side in the cloud) to forward to this address.

It is important to understand that NetSuite will only allow your script to upload known file types. That’s why I’ve supplied an array of file types in the code. However, NetSuite will accept any file of any type as long as you fib and say it’s a known file type. So, my code tries to match the type with a known NetSuite file type. If there is no match, I tell NetSuite the file is type PLAINTEXT. It allows the file to be uploaded and saved. It does not affect downloading the file. It still comes down and is opened based on the file’s extension. The only thing it affects is your ability to filter files. In my case, I’ll have a lot of files of type PLAINTEXT that are actually some other format. And… I can live with that.

The other gotcha is NetSuite thinks files of same name are the same file. So my code adds a suffix based on an integer time stamp. So two files of the same name Kevin.text and Kevin.text will be saved as Kevin_[big unique integer number].text. When these files get attached to two separate custom records, the files are not be overwritten.

And that should be all you need to know about that!

jsTree Control with Multiselect – DblClick to toggle, Click to select

As with most things, this turned out to be a hard problem with a simple solution. I was using jsTree to display a product catalog. Originally, I did not implement multiselect. So when a node in the tree was double clicked, it expanded the node. However, when I went to multiselect, double clicking a node expanded it, but also selected it and every child node under it. I needed to decouple those two behaviors.

Double click to expand. Single click on the checkbox to select.

Here is the code in JSFiddle: https://jsfiddle.net/cq9o4t8w/20/

https://jsfiddle.net/cq9o4t8w/20/
Double click to expand the tree. Click checkbox to select nodes. 
</p>
<div id="jstree_div">
  <ul>
    <li id="node_root">root
      <ul>
        <li id="node_1">node 1
          <ul>
            <li id="node_1_1">node 1.1</li>
            <li id="node_1_2">node 1.2</li>
          </ul>
        </li>
        <li id="node_2">node 2</li>
      </ul>
    </li>
  </ul>
</div>
<br />
<b>Selection: </b><span id="selection"></span>
$(document).ready(
  function() {

    $('#jstree_div').jstree({
      plugins: ['checkbox', 'changed'],
    }).on('changed.jstree', function(e, data) {
      var t1 = setTimeout(
        function() {
          var selected_nodes = $('#jstree_div').jstree('get_selected');
          if (Array.isArray(selected_nodes) && selected_nodes.length > 0) {
            // Fire whatever asynchronous process you choose here.
            // Like a call to the server to fetch data. 
            $('#selection').text(selected_nodes.join(', '));
          } else {
            $('#selection').text('');
          }
        }, 500
      )
    })

  })

Replacing NetSuite’s Rich Textbox Control

As crazy as this sounds, NetSuite’s richtext control allows (and possibly creates) markup that won’t print. We decided to replace their control with tinyMCE.

Originally, I did this with client-side scripting. It was simple, because a client-side script would wait until the page loaded, look for all richtext controls, remove the DOM elements, replace them with a TEXTAREA and initialize tinyMCE. Doing it client-side let me continue to manage my page and scripts exactly the same as if I’d left the original (NetSuite’s) controls in place. No swapping, no renaming. Simple!

This worked great until we got a Chrome update this past week, then stuff completely unrelated to the rich textboxes stopped working. It was incredibly hard to diagnose, as the problems were intermittent. It turned out it had to do with delivering the first richtext control, and the replacing it while it was in the process of initializing. Somehow that messed up other NetSuite client-side JavaScript.

To fix this, I had to rethink how I was replacing the richtext control with tinyMCE. I had to do it server-side, to keep the original control from ever starting to render. It is impossible to remove a control server-side, but you can hide it. It is also impossible to have 2 fields with the same ID. That means you’ll need to do some renaming. Argh!

/**
 * Add a textarea to the form with the name custpage_ in place of custbody_, then hide the original.
 * @param {*} context 
 * @param {*} original_field_id 
 */
function swapRichTextControls(context, original_field_id) {
    var new_field_id = original_field_id.replace('custbody_', 'custpage_');
    var value = context.newRecord.getValue(original_field_id);

    var originalField = context.form.getField(original_field_id);

    var newField = context.form.addField({
        id: new_field_id,
        label: originalField.label,
        type: serverWidget.FieldType.TEXTAREA
    });

    newField.defaultValue = value

    context.form.insertField({
        field: newField,
        nextfield: original_field_id
    });

    originalField.updateDisplayType({ displayType: serverWidget.FieldDisplayType.HIDDEN });
}

I call swapRichTextControls from an event script. In my case all my richtext fields are custom fields, which start with “custbody_”. Since I can’t have 2 fields with the same name, and the convention is to name all custom fields with “custpage_”, I do that in a beforeLoad() function.

In the beforeSave() function, I take value from the newly created control and save it back in field that was previously associated with the original richtext control, the one I hid in the beforeLoad() function.

/**
 * On save, you need to move the value from the fake TEXTAREA back to the original field.
 * @param {*} context 
 * @param {*} original_field_id 
 */
function swapBackRichTextControls(context, original_field_id) {
    var new_field_id = original_field_id.replace('custbody_', 'custpage_');
    try {
        context.newRecord.setValue(
            original_field_id,
            context.newRecord.getValue(new_field_id)
        )
    }
    catch (err) {

    }
}

This takes care of delivering a standard TEXTAREA control in place of the richtext control that we wanted to get rid of. To turn it into a tinyMCE control, we need to include the tinyMCE library and initialize the TEXTAREA.

/**
 * Initialize tinyMCE on a TEXTAREA control.
 * @param {*} control_id Internal ID of the control. example: custpage_note_internal.
 */
initControl: function (control_id) {
    //console.log('initControl: ' + control_id);
    //if (!tinymce) console.log('tinymce cdn libraries are not included');
    tinymce.init({
        selector: '#' + control_id,
        plugins: 'link paste code media table lists hr help',
        default_link_target: '_blank',
        link_assume_external_targets: 'https',
        paste_data_images: true,
        menubar: 'edit view insert format table tools help',
        toolbar: 'numlist bullist link hr',
        browser_spellcheck: true,
        contextmenu: false,
        forced_root_block: false,
        init_instance_callback: function (editor) {
            editor.on('Change', function (e) {
                // This is where the contents of the TinyMCE control
                // are put back into the textarea where the server picks
                // them up as though they were in the original <input type="hidden">
                var realFieldId = e.target.id;
                $('#' + realFieldId).val(e.target.getContent());
            })
        }
    });
    var control_width = jQuery(window).width() * 0.30;
    jQuery('#'+control_id).css('width', control_width, 'padding-right', 20, 'padding-bottom', 20);
}

Here is the basics of how I include the tinyMCE CDN.

const tinymce_js = 'https://cdn.tiny.cloud/1/.../tinymce/5/tinymce.min.js';

function tinymce_client_includes() {
    client_includes_count++;
    return [

        ... Other library references ...
        tinymce_js,
    ].join("\n");
}

dimDate in NetSuite – Adding a Date Dimension Table

I was working on capturing transaction summary data for use later in trending reports. A colleague of mine mentioned incorporating a date dimension table to save having to do all the complicated date calculations on the fly. This was a great idea, but not so simple to implement in NetSuite.

In short, a date dimension table is a series of rows, each representing a day. Corresponding columns represent date associations, like start of week, day in week, start of month, day in month, start and end of quarter, start and end of fiscal year, day suffix, etc. It’s extremely handy when looking back on the first of the month to say, what is the start and end dates of this week, month, year, fiscal year, etc. My end result was a series of Map/Reduce Suitescripts that wake up on start of month, quarter or year and capture summary data for the period that just ended. Once I had the dimDate table, the rest was easy.

To build my dimDate table, I started with the article my colleague sent me which builds one from a script in Microsoft SQL Server. Rather than translate this to JavaScript and run it in SuiteScript, I opted to run it and export the result. Then I created a custom record type (table) in NetSuite called dimDate with matching fields. I’ll include the definition of that table as saved via SuiteCloud Developer Framework (SDF). I’ll also include the script I used to create my dimDate data (in MS SQL Server).

Here is the original article that describes the dimDate table. https://www.mssqltips.com/sqlservertip/4054/creating-a-date-dimension-or-calendar-table-in-sql-server/

This is what you’ll be building in NetSuite.

This is the definition you’ll be importing. It’s a custom record type called dimDate.

Here is the Transact SQL code used to create my dimDate table. It uses October 1st as the start of the fiscal year. It starts on January 1st, 1999 and builds rows that represent all days for 40 years.

-- Run this in a sql server 2012 or higher
-- Export to CSV using the SQL Mgmt Studio Export feature (Right click on DB and Export)
-- Don't open this with Excel, or the date formats in the first 4 fields will be screwed up

DROP table DimDate;

DECLARE @StartDate  date = '19990101';

DECLARE @CutoffDate date = DATEADD(DAY, -1, DATEADD(YEAR, 40, @StartDate));

;WITH seq(n) AS 
(
  SELECT 0 UNION ALL SELECT n + 1 FROM seq
  WHERE n < DATEDIFF(DAY, @StartDate, @CutoffDate)
),
d(d) AS 
(
  SELECT DATEADD(DAY, n, @StartDate) FROM seq
),
src AS
(
  SELECT
    Date         = CONVERT(date, d),
    Day          = DATEPART(DAY,       d),
    DayName      = DATENAME(WEEKDAY,   d),

    Week         = DATEPART(WEEK,      d),
	FiscalWeek		= DATEPART(WEEK, DATEADD(MONTH, -9, d)),

    DayOfWeek    = DATEPART(WEEKDAY,   d),

    Month        = DATEPART(MONTH,     d),
	FiscalMonth		= DATEPART(MONTH,	DATEADD(MONTH, -9, d)),

    MonthName    = DATENAME(MONTH,     d),
    
	Quarter      = DATEPART(Quarter,   d),
	FiscalQuarter	= DATEPART(Quarter, DATEADD(MONTH, -9, d)),
    
	Year         = DATEPART(YEAR,      d),
	FiscalYear		= DATEPART(YEAR, DATEADD(MONTH, -9, d)),
    
	FirstOfMonth = CONVERT(varchar, DATEFROMPARTS(YEAR(d), MONTH(d), 1), 101),
    
	LastOfYear   = CONVERT(varchar, DATEFROMPARTS(YEAR(d), 12, 31), 101),
	FiscalLastOfYear = CONVERT(varchar, DATEFROMPARTS(DATEPART(YEAR, DATEADD(MONTH, -9, d)), 9, 30), 101),
    
	DayOfYear    = DATEPART(DAYOFYEAR, d),
	FiscalDayOfYear	= DATEPART(DAYOFYEAR, DATEADD(MONTH, -9, d))
  FROM d
),
dim AS
(
  SELECT
    DateKey             = CAST(CONVERT(char(8),  Date, 112) as varchar),
    ExternalID             = CAST(CONVERT(char(8),  Date, 112) as varchar),
    Date					= CAST(CONVERT(varchar,Date, 101) as varchar),
    LongDate		        = CAST(CONVERT(varchar(20), Date, 101) as varchar), 
	  ShortDate			      = CAST(DATEPART(MONTH, Date) as varchar) + '/' + cast(DATEPART(DAY, Date) as varchar) + '/' + CAST(YEAR(Date) as varchar),
	  SortDate            = CAST(CONVERT(char(10), Date, 120) as varchar),

    Day,
    DaySuffix           = cast(Day as varchar(10)) + CONVERT(char(2), CASE WHEN Day / 10 = 1 THEN 'th' ELSE 
                            CASE RIGHT(Day, 1) WHEN '1' THEN 'st' WHEN '2' THEN 'nd' 
                            WHEN '3' THEN 'rd' ELSE 'th' END END),
    DayName,
    DayOfWeek,
    DayOfWeekInMonth    = CONVERT(tinyint, ROW_NUMBER() OVER 
                            (PARTITION BY FirstOfMonth, DayOfWeek ORDER BY Date)),
    DayOfYear,
	  FiscalDayOfYear,

    IsWeekend           = CASE WHEN DayOfWeek IN (CASE @@DATEFIRST WHEN 1 THEN 6 WHEN 7 THEN 1 END,7) 
                            THEN 1 ELSE 0 END,
    Week,
	  FiscalWeek,

    FirstOfWeek         = CONVERT(varchar, DATEADD(DAY, 1 - DayOfWeek, Date), 101),
    LastOfWeek          = CONVERT(varchar, DATEADD(DAY, 6, DATEADD(DAY, 1 - DayOfWeek, Date)), 101),
    WeekOfMonth         = CONVERT(tinyint, DENSE_RANK() OVER 
                            (PARTITION BY Year, Month ORDER BY Week)),
    Month,
    MonthName,
    FirstOfMonth,
    LastOfMonth         = CONVERT(varchar, MAX(Date) OVER (PARTITION BY Year, Month), 101),
    FirstOfNextMonth    = CONVERT(varchar, DATEADD(MONTH, 1, FirstOfMonth), 101),
    LastOfNextMonth     = CONVERT(varchar, DATEADD(DAY, -1, DATEADD(MONTH, 2, FirstOfMonth)), 101),

    Quarter,
    FiscalQuarter,

    FirstOfQuarter      = CONVERT(varchar, MIN(Date) OVER (PARTITION BY Year, Quarter), 101),
    LastOfQuarter       = CONVERT(varchar, MAX(Date) OVER (PARTITION BY Year, Quarter), 101),

    FiscalFirstOfQuarter   = CONVERT(varchar, MIN(Date) OVER (PARTITION BY Year, FiscalQuarter), 101),
    FiscalLastOfQuarter    = CONVERT(varchar, MAX(Date) OVER (PARTITION BY Year, FiscalQuarter), 101),

    Year,
	  FiscalYear,

    FirstOfYear      = CONVERT(varchar, DATEFROMPARTS([Year], 1,  1), 101),
    LastOfYear,

	  FiscalFirstOfYear	= CONVERT(varchar, DATEFROMPARTS(FiscalYear, 10, 1), 101),
	  FiscalLastOfYear,
    
	  IsLeapYear          = CASE when CONVERT(bit, CASE WHEN (Year % 400 = 0) 
                            OR (Year % 4 = 0 AND Year % 100 <> 0) 
                            THEN 1 ELSE 0 END) = 1 then 'T' else 'F' end,
    Has53Weeks          = CASE WHEN DATEPART(WEEK,     LastOfYear) = 53 THEN 'T' ELSE 'F' END,
    MMYYYY              = CONVERT(char(2), CONVERT(char(8), Date, 101))
                          + CONVERT(char(4), Year)
  FROM src
)
SELECT * 
INTO dimDate
FROM dim
  ORDER BY Date
  OPTION (MAXRECURSION 0)

Here is the dimDate table definition saved via SuiteCloud Developer Framework. It’s huge. Sorry!

<customrecordtype scriptid="customrecord_logic_dimdate">
  <accesstype>CUSTRECORDENTRYPERM</accesstype>
  <allowattachments>F</allowattachments>
  <allowinlinedeleting>F</allowinlinedeleting>
  <allowinlinedetaching>F</allowinlinedetaching>
  <allowinlineediting>F</allowinlineediting>
  <allowmobileaccess>F</allowmobileaccess>
  <allownumberingoverride>F</allownumberingoverride>
  <allowquickadd>F</allowquickadd>
  <allowquicksearch>F</allowquicksearch>
  <allowuiaccess>T</allowuiaccess>
  <description></description>
  <enabledle>T</enabledle>
  <enablekeywords>F</enablekeywords>
  <enablemailmerge>F</enablemailmerge>
  <enablenametranslation>F</enablenametranslation>
  <enablenumbering>F</enablenumbering>
  <enableoptimisticlocking>T</enableoptimisticlocking>
  <enablesystemnotes>F</enablesystemnotes>
  <hierarchical>F</hierarchical>
  <icon></icon>
  <iconbuiltin>T</iconbuiltin>
  <iconindex>30</iconindex>
  <includeinsearchmenu>F</includeinsearchmenu>
  <includename>F</includename>
  <isinactive>F</isinactive>
  <isordered>F</isordered>
  <numberinginit></numberinginit>
  <numberingmindigits></numberingmindigits>
  <numberingprefix></numberingprefix>
  <numberingsuffix></numberingsuffix>
  <recordname>dimDate Table</recordname>
  <showcreationdate>F</showcreationdate>
  <showcreationdateonlist>F</showcreationdateonlist>
  <showid>F</showid>
  <showlastmodified>F</showlastmodified>
  <showlastmodifiedonlist>F</showlastmodifiedonlist>
  <shownotes>F</shownotes>
  <showowner>F</showowner>
  <showownerallowchange>F</showownerallowchange>
  <showowneronlist>F</showowneronlist>
  <customrecordcustomfields>
    <customrecordcustomfield scriptid="custrecord_dimdate_datekey">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>F</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>TEXT</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>DateKey</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_date">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>F</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>DATE</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>Date</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>T</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_longdate">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>F</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>TEXT</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>LongDate</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_shortdate">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>F</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>TEXT</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>ShortDate</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_sortdate">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>F</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>TEXT</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>SortDate</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_day">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>T</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>INTEGER</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>Day</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>T</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_daysuffix">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>F</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>TEXT</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>DaySuffix</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>T</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_dayname">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>F</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>TEXT</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>DayName</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_dayofweek">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>T</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>INTEGER</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>DayOfWeek</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>T</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_dayofweekinmonth">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>T</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>INTEGER</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>DayOfWeekInMonth</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_dayofyear">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>T</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>INTEGER</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>DayOfYear</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_fiscaldayofyear">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>T</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>INTEGER</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>FiscalDayOfYear</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_isweekend">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>T</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>INTEGER</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>IsWeekend</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_week">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>T</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>INTEGER</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>Week</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_fiscalweek">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>T</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>INTEGER</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>FiscalWeek</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_firstofweek">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>F</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>DATE</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>FirstOfWeek</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_lastofweek">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>F</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>DATE</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>LastOfWeek</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_weekofmonth">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>T</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>INTEGER</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>WeekOfMonth</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_month">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>T</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>INTEGER</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>Month</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_monthname">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>F</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>TEXT</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>MonthName</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_firstofmonth">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>F</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>DATE</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>FirstOfMonth</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_lastofmonth">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>F</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>DATE</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>LastOfMonth</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_firstofnextmonth">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>F</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>DATE</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>FirstOfNextMonth</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_lastofnextmonth">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>F</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>DATE</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>LastOfNextMonth</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_quarter">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>T</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>INTEGER</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>Quarter</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_fiscalquarter">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>T</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>INTEGER</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>FiscalQuarter</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>T</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_firstofquarter">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>F</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>DATE</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>FirstOfQuarter</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>T</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_lastofquarter">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>F</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>DATE</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>LastOfQuarter</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>T</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_fiscalfirstofquarter">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>F</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>DATE</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>FiscalFirstOfQuarter</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>T</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_fiscallastofquarter">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>F</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>DATE</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>FiscalLastOfQuarter</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>T</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_year">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>T</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>INTEGER</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>Year</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>T</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_fiscalyear">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>T</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>INTEGER</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>FiscalYear</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>T</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_firstofyear">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>F</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>DATE</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>FirstOfYear</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_lastofyear">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>F</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>DATE</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>LastOfYear</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_fiscalfirstofyear">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>F</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>DATE</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>FiscalFirstOfYear</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_fiscallastofyear">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>F</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>DATE</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>FiscalLastOfYear</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_isleapyear">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>F</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>CHECKBOX</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>IsLeapYear</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_has53weeks">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>F</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>CHECKBOX</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>Has53Weeks</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
    <customrecordcustomfield scriptid="custrecord_dimdate_mmyyyy">
      <accesslevel>2</accesslevel>
      <allowquickadd>F</allowquickadd>
      <applyformatting>F</applyformatting>
      <checkspelling>F</checkspelling>
      <defaultchecked>F</defaultchecked>
      <defaultselection></defaultselection>
      <defaultvalue></defaultvalue>
      <description></description>
      <displayheight></displayheight>
      <displaytype>NORMAL</displaytype>
      <displaywidth></displaywidth>
      <dynamicdefault></dynamicdefault>
      <encryptatrest>F</encryptatrest>
      <fieldtype>TEXT</fieldtype>
      <globalsearch>F</globalsearch>
      <help></help>
      <isformula>F</isformula>
      <ismandatory>F</ismandatory>
      <isparent>F</isparent>
      <label>MMYYYY</label>
      <linktext></linktext>
      <maxlength></maxlength>
      <maxvalue></maxvalue>
      <minvalue></minvalue>
      <onparentdelete></onparentdelete>
      <parentsubtab></parentsubtab>
      <rolerestrict>F</rolerestrict>
      <searchcomparefield></searchcomparefield>
      <searchdefault></searchdefault>
      <searchlevel>2</searchlevel>
      <selectrecordtype></selectrecordtype>
      <showinlist>F</showinlist>
      <sourcefilterby></sourcefilterby>
      <sourcefrom></sourcefrom>
      <sourcelist></sourcelist>
      <storevalue>T</storevalue>
      <subtab></subtab>
    </customrecordcustomfield>
  </customrecordcustomfields>
</customrecordtype>