Skip to main content
Known Participant
Sep 29, 2022 4:50 AM UTC
Question

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

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
Sep 29, 2022 5:02 AM UTC

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.

Known Participant
Sep 29, 2022 5:34 AM UTC

Thanks for the reply Ujjwal Rathore.

harshitb6843
Brainy
Sep 29, 2022 5:11 AM UTC

Instead of 

ri!product.supplierDetails.quantity

use 
fv!row.quantity

That should help

Known Participant
Sep 29, 2022 5:34 AM UTC

Thanks Harshit