Skip to main content
September 29, 2022
Question

In read-only-grid unable to fletch list of an entity from CDT(one to many) via DB.!

  • September 29, 2022
  • 4 replies
  • 0 views

Hi All 

here the use case was selecting particular Id(Product Id) in record list, than it will show all the relavent records in Summary view and In the grid will list out all the Related suppliers(data) only in grid,

{
  a!sectionLayout(
    label: "Section",
    contents: {
      a!columnsLayout(
        columns: {
          a!columnLayout(
            contents: {
              a!textField(
                label: "ProductName",
                labelPosition: "ADJACENT",
                value:ri!product.productname,
                saveInto: {},
                refreshAfter: "UNFOCUS",
                readOnly: true(),
                validations: {}
              ),
              a!textField(
                label: "Productdetails",
                labelPosition: "ADJACENT",
                value: ri!product.productdetails,
                saveInto: {},
                refreshAfter: "UNFOCUS",
                readOnly: true(),
                validations: {}
              ),
              a!textField(
                label: "Categorytype",
                labelPosition: "ADJACENT",
                value: ri!product.categorytype,
                saveInto: {},
                refreshAfter: "UNFOCUS",
                readOnly: true(),
                validations: {}
              )
            }
          ),
          a!columnLayout(
            contents: {
              a!paragraphField(
                label: "Comments",
                labelPosition: "ADJACENT",
                value: ri!product.Comments,
                saveInto: {},
                refreshAfter: "UNFOCUS",
                readOnly: true,
                validations: {}
              ),
              a!textField(
                label: "Status",
                labelPosition: "ADJACENT",
                value: ri!product.status,
                saveInto: {},
                refreshAfter: "UNFOCUS",
                readOnly: true,
                validations: {}
              )
            }
          )
        }
      ),
      a!gridField(
        label: "Supplier Details",
        labelPosition: "ABOVE",
        data: property(ri!product, "supplierDetails", null),
        columns: {
          a!gridColumn(
            label: "Supplierid",
            value: ri!product.supplierDetails.supplierid
          ),
          a!gridColumn(
            label: "Suppliername",
            value: ri!product.supplierDetails.suppliername
          ),
          a!gridColumn(
            label: "Location",
            value: ri!product.supplierDetails.location
          ),
          a!gridColumn(
            label: "Phonenumber",
            value: ri!product.supplierDetails.phonenumber
          ),
          a!gridColumn(
            label: "Productprice",
            value: ri!product.supplierDetails.productprice
          ),
          a!gridColumn(
            label: "Quantity",
            value: ri!product.supplierDetails.quantity
          ),
          a!gridColumn(
            label: "image",
            value: ri!product.supplierDetails.image
          )
        },
        validations: {}
      )
    }
  )
}

4 replies

Participating Frequently
September 29, 2022

Data in the readOnly grid should be passed as datasubset.

And instead of passing it through rule input you should query the data on the interface.

September 29, 2022

Thanks for the reply Ujjwal Rathore.

harshitb6843
September 29, 2022

Instead of 

ri!product.supplierDetails.quantity

use 
fv!row.quantity

That should help

September 29, 2022

Thanks Harshit