Skip to main content
natashan0002
July 1, 2021
Question

get readonlyGrid Fv! data outside gridcolumn()

  • July 1, 2021
  • 2 replies
  • 0 views

Hi,

I have the following scenario:

Take a shopping cart. I have three tables: cartdetails which has foreign key productsId from product table, product table  which has categoryId from category table.

the grid data is -> cartdetails and columns are ->   srno| category name| category type| category data| productname| product price| product data| quantity| totalprice

Now in the grid i can call a rule to fetch the required data as:

1. call getcategorydata()-> for  category name| category type| category data

2. call getproductdata()-> for productname| product price| product data

Instead of calling the rule again and again for the three columns each, i want to call it once per row. So im trying to use localvariables. 

But the data that i can use is only fv!currentpage outside the gridcolumn() . so i tried doing fv!currentpage.data.productid. This is giving me the whole array of products. I want to index this to only get the individual row's productid.

Idk if i explained it properly, 

Thank youin advance

 

2 replies

mikes0011
Brainy
July 1, 2021

From what I can understand of your use case, this will be at least 10 times easier if you create a View containing the combination of columns you need and query that for your grid, rather than trying to query three separate tables in a grid (especially if you're calling a rule multiple times for different columns, which I'm not sure I quite understand what you're doing there).

The Expression Guru
natashan0002
July 2, 2021

Hi Mike,

Yeah i just dont want to query the same rule again and again.

Views make much more sense here.

Thank you [emoticon:c4563cd7d5574777a71c318021cbbcc8]