Grid Table for Standard Grid Order Printing

The grid print templates for purchase order and sales order transactions contain the record.custbody_gridoe_productgrpdata field. This field contains the data for the grid table. Refer to the following information to learn more about this field.

JSON Code Snippet for Standard Grid Order Printing

The following JSON code snippet shows a sample 2x2 grid table from record.custbody_gridoe_productgrpdata:

            [
  {
    "type": "MI",
    "nameId": "2369",
    "name": "Basic Crew Neck T-shirt",
    "category": "Color, Size",
    "rowattr": "custitem2",
    "colattr": "custitem1",
    "grid": {
      "rowlabel": "Color",
      "collabel": "Size",
      "rowcollabel": "Matrix Item Option",
      "header": [
        {
          "id": "Column1",
          "colAttr": "1",
          "name": "Small",
          "percentage": "0.0"
        },
        {
          "id": "Column2",
          "colAttr": "2",
          "name": "Medium",
          "percentage": "0.0"
        }
      ],
      "data": [
        {
          "id": "Row1",
          "rowattributeid": "1",
          "rowattribute": "Red",
          "rowpercents": 0,
          "columnids": [
            "Column1",
            "Column2"
          ],
          "columnpercents": [
            0,
            0
          ],
          "Column1": {
            "internalid": 4220,
            "defaultpercent": 25
          },
          "Column2": {
            "internalid": 4222,
            "defaultpercent": 25
          }
        },
        {
          "id": "Row2",
          "rowattributeid": "2",
          "rowattribute": "Blue",
          "rowpercents": 0,
          "columnids": [
            "Column1",
            "Column2"
          ],
          "columnpercents": [
            0,
            0
          ],
          "Column1": {
            "internalid": 4221,
            "defaultpercent": 25
          },
          "Column2": {
            "internalid": 4223,
            "defaultpercent": 25
          }
        }
      ]
    }
  }
] 

          

Sample 2x2 Grid Table Representation for Standard Grid Order Printing

For grid tables in standard grid order printing, consider the following details:

  • The index of the grid in record.custbody_gridoe_productgrpdata is the same as the item's grid ID column in item sublist.

  • The template may contain an empty record.custbody_gridoe_productgrpdata field.

  • The template may contain an empty {} entry member in record.custbody_gridoe_productgrpdata. If the entry member is empty, it means that the whole template and its items are deleted in item sublist.

The following table represents the sample JSON code into a 2x2 grid table in purchase order and sales order printouts.

Matrix Item Option

(record.custbody_gridoe_productgrpddata[0].grid.rowcollabel)

Small

(record.custbody_gridoe_productgrpddata[0].grid.header[0].name)

Medium

(record.custbody_gridoe_productgrpddata[0].grid.header[1].name)

Blue

(record.custbody_gridoe_productgrpddata[0].grid.data[0].rowattribute)

Row 1 Col 1 Item ID:

(record.custbody_gridoe_productgrpddata[0].grid.data[0].Column1)

Row 1 Col 2 Item ID:

(record.custbody_gridoe_productgrpddata[0].grid.data[0].Column2)

Red

(record.custbody_gridoe_productgrpddata[0].grid.data[1].rowattribute)

Row 2 Col 1 Item ID:

(record.custbody_gridoe_productgrpddata[0].grid.data[1].Column1)

Row 2 Col 2 Item ID:

(record.custbody_gridoe_productgrpddata[0].grid.data[1].Column2)

For information about the other elements included in Grid Print Templates, see the following topics:

Related Topics

General Notices