Skip to main content
May 28, 2021
Question

Casting list of variant to record type invalid

  • May 28, 2021
  • 7 replies
  • 0 views

Hi, so when i was testing the summary view interface using a query rule to get customer info by iD. I got this kind of message. How to solve this? Thank you

Expression evaluation error at function a!eval_inputMapWithTypes_ruleInputCast [line 42]: Could not cast from List of Variant to SJ Customer. Details: CastInvalidCould not cast from List of Variant to SJ Customer. Details: CastInvalid

7 replies

harshas2775
Brainy
May 28, 2021

Check the output of rule SJ_CM_getCustomerById(). If it is returning datasubset then you need to test using the dot operator like: 

rule!SJ_CM_getCustomerById(6).data

May 29, 2021

Still the same problem.

adityap0004
May 28, 2021

[mention:70644fd178664ba3a3e920fb02e9c2db:e9ed411860ed4f2ba0265705b8793d05] Please try this

a!queryRecordType(
recordType: 'recordType!ISJ_CM_Customer_Record',    /*(Your Record Type)*/
filters: a!queryFilter(
field: 'recordType!SJ_CM_Customer_Record.customerID',  /*(Your Record Type Field)*/
operator: "=",
value: ri!customerID   /*(Your rule input)*/
),
pagingInfo: a!pagingInfo(
startIndex: 1,
batchSize: 1
)
).data

Try with creating a new expression rule with Adding you record type with above shown example add record field and compare with rule input to follow above example and check again with using this rule.

May 29, 2021

Thank you that worked. Just a follow up question, i have a set of docu images in a folder but in my records, its contained in an integer variable (the folder id of the image). How do i retrieve the image in an interface?

thank you

gayathris111098
May 29, 2021

Hello,

Below might be useful!

a!localVariables(
local!images_cdt: folder(ri!idOfFolder, "documentChildren"),
{
a!imageField(
images: a!forEach(
items: local!images_cdt,
expression: a!documentImage(document: fv!item)
)
),
/* OR */
a!richTextDisplayField(
value: a!forEach(
items: local!images_cdt,
expression: a!richTextImage(a!documentImage(document: fv!item))
)
)
}
)