Skip to main content
February 13, 2024
Solved

Editable grid using record type

  • February 13, 2024
  • 11 replies
  • 0 views

Iam trying to add a new row link to the editable grid, The data entered in the new row shoud be saved to Database. anyone give suggestions. 

    Best answer by harshitb6843

    Add the brackets () after the record reference in your value parameter.

    value: recordType!KNS Product Details()

    11 replies

    harshitb6843
    February 13, 2024

    Add the brackets () after the record reference in your value parameter.

    value: recordType!KNS Product Details()

    February 13, 2024

    Thank you Harshit bumb, I have corrected the mistake but again getting error while saving the values from the New Row

    a!localVariables(
      local!data:rule!IT_getProductDetailsFromRecord(),
      
      {
      a!cardLayout(
        contents: {
          a!gridLayout(
            label: "Product Details",
            labelPosition: "ABOVE",
            headerCells: {
              a!gridLayoutHeaderCell(label: "Product Id"),
              a!gridLayoutHeaderCell(label: "Name"),
              a!gridLayoutHeaderCell(label: "Category"),
              a!gridLayoutHeaderCell(label: "Price"),
              a!gridLayoutHeaderCell(label: "Brand"),
              a!gridLayoutHeaderCell(label: "Rating")
              
            },
            columnConfigs: {},
            rows: {
              a!forEach(
                items: local!data,
                expression: a!gridRowLayout(
                  contents: {
                    a!integerField(
                      value: fv!item['recordType!{271af57d-1ea1-4b98-bd80-8092624e72b6}KNS Product Details.fields.{153b4a0d-fa28-42b1-93a8-743296065f94}productid'],
                      saveInto: fv!item['recordType!{271af57d-1ea1-4b98-bd80-8092624e72b6}KNS Product Details']
                    ),
                    a!textField(
                      value:fv!item['recordType!{271af57d-1ea1-4b98-bd80-8092624e72b6}KNS Product Details.fields.{7d9347e6-175d-4ce7-8518-ac7d3a3188e5}name'],
                      saveInto: fv!item['recordType!{271af57d-1ea1-4b98-bd80-8092624e72b6}KNS Product Details.fields.{7d9347e6-175d-4ce7-8518-ac7d3a3188e5}name']
                    ),
                    a!textField(
                      value: fv!item['recordType!{271af57d-1ea1-4b98-bd80-8092624e72b6}KNS Product Details.fields.{0bd23d9d-6272-4401-ad24-11178974ad9d}category'],
                      saveInto: fv!item['recordType!{271af57d-1ea1-4b98-bd80-8092624e72b6}KNS Product Details.fields.{0bd23d9d-6272-4401-ad24-11178974ad9d}category']
                    ),
                    a!integerField(
                      value: fv!item['recordType!{271af57d-1ea1-4b98-bd80-8092624e72b6}KNS Product Details.fields.{479ce285-bbc8-4712-90b5-c171f482c82f}price'],
                      saveInto: fv!item['recordType!{271af57d-1ea1-4b98-bd80-8092624e72b6}KNS Product Details.fields.{479ce285-bbc8-4712-90b5-c171f482c82f}price']
                    ),
                    a!textField(
                      value: fv!item['recordType!{271af57d-1ea1-4b98-bd80-8092624e72b6}KNS Product Details.fields.{d7bfc7af-8dc8-4918-8bed-72ca1c5ab151}brand'],
                      saveInto: fv!item['recordType!{271af57d-1ea1-4b98-bd80-8092624e72b6}KNS Product Details.fields.{d7bfc7af-8dc8-4918-8bed-72ca1c5ab151}brand']
                    ),
                    a!floatingPointField(
                      value: fv!item['recordType!{271af57d-1ea1-4b98-bd80-8092624e72b6}KNS Product Details.fields.{dd8acd71-e555-4d3d-81d2-dc28c41273ef}rating']
                      ,
                      saveInto: fv!item['recordType!{271af57d-1ea1-4b98-bd80-8092624e72b6}KNS Product Details.fields.{dd8acd71-e555-4d3d-81d2-dc28c41273ef}rating']
                    )
                  }
                )
              )
              
            },
            addRowLink: a!dynamicLink(
              label: "Add New Record",
              value: 'recordType!{271af57d-1ea1-4b98-bd80-8092624e72b6}KNS Product Details'(),
              saveInto: {
                a!save(local!data,append(local!data,save!value))
              }
            ),
            selectionSaveInto: {},
            validations: {},
            shadeAlternateRows: true
          ),
        },
        
        height: "AUTO",
        style: "TRANSPARENT",
        marginBelow: "STANDARD"
      )
    }
    )

    stefanhelzle0001
    Brainy
    February 13, 2024

    Do you try to use dot-notation somewhere?

    https://docs.appian.com/suite/help/23.4/reference-records.html

    February 13, 2024

     [mention:78a6d98d720b44fb846f87bb7600fd36:e9ed411860ed4f2ba0265705b8793d05] 

    Hi Kishore Within the gridlayout 27 line you are missing saveInto...need to give the field(productId) name use dot-notation

    February 14, 2024

    Thank you .. I have corrected