Creating Attribute Tags for Standard Records

Attribute tags are typically made up of two components — record type and attribute.

The attribute can be any information available on a NetSuite record or a field on a record that contains the information. For a list of record types and their corresponding tag components, see Using recordType in Attribute Tags.

Sample Attribute Tags

Attribute tags are commonly used for displaying the default value in a field on a certain record type, such as item records or customer records. You can also display a value in a field on a specific record, or specify the information for display. Use the information below to create attribute tags for your own website.

Displaying the Default Value from a Field on a Record

You can use an attribute tag to display information from the current applicable record. This can be can be an item being viewed in the web store, or data from the customer record assigned to the same customer currently logged in. Note the following syntax:

             <%=getCurrentAttribute('recordType','attribute','defaultValue')%> 

        
Note:

Customers must be logged in to display personalized information. NetSuite recommends using default values for all customer tags.

Displaying Information from a Specific Record

Use an internal ID in the tag to refer to a specific record of any type that supports current attribute tags. In this way, you can display values from fields on specific records regardless of the page being viewed on the website. Note the following syntax:

             <%=getAttribute('recordType',id,'attribute')%> 

        

The internal ID is found in the URL of the record page in your account. For more information, see How do I find a record's internal ID?

For example, to display the value in the Store Display Name field on item ID 7, use this attribute tag:

             <%=getAttribute('item',7,'storedisplayname')%> 

        

Specifying Information for Display

You can use an additional parameter, nlignorefamily, in an Attribute tag to omit data from the record “family.” The nlignorefamily flag ignores data from record types other than the record type specified in the tag. For example, when you are working with customer records, you can exclude data from other entity records that may be related, such as partner records.

In the following sample attribute tag, an empty string is returned if a particular customer record does not exist. When the nlignorefamily flag is not present, a partner email, or an email from some related entity record is rendered.

          <%=getCurrentAttribute('customer','email', '', 'nlignorefamily')%> 

        

Note that you can change the third parameter in the sample, from an empty string to any string you want to display when a customer record does not exist.

You can use the nlescapehtml parameter to specify that you want a response formatted for HTML. For example:

          <%=getCurrentAttribute('request','querystring','','nlescapehtml')%> 

        
Note:

When using request attributes in you r attribute tags, also use nlescapehtml to avoid cross-site scripting vulnerabilities.

Records that Support Attribute Tags

Use the links below to see a complete list of attributes for each record type:

Related Topics

Using Attribute Tags in Site Templates
Using Web Site Tags in Hosted Files
Creating Attribute Tags for Custom Records and Custom Fields
Creating Attribute Tags

General Notices