How to access CDT field by number ?

Certified Senior Developer

Hi,

I'm surprised to have to ask this question, but could you tell me how to access the value of a CDT field giving a number please ?

I would need to use this kind of code :

local!value: field(local!vehicle, 1) /* where "1" is the first field of the row */

a!localVariables(
  local!vehicle: rule!CJT2_GetVehiclesWithFilters(
    id: 1
  ).data[1],

  /* Here I just display some data with fieldname */
  property(local!vehicle, "id") & " - " & property(local!vehicle, "model")
  
  /* Now I would need to do the same thing, without using the fieldname, so I need a function that can do that
  I just tried to use the "property" function as an example but maybe is there any other function like "field" 
  or other ? */ 
  
  property(local!vehicle, 1) & " - " & property(local!vehicle, 2)
  field(local!vehicle, 1) & " - " & field(local!vehicle, 2)

)

Regards

  Discussion posts and replies are publicly visible