Type comparison error

Certified Associate Developer

 Hi,

I'm getting "Cannot compare type" error while executing the rule. Below is the code i'm using

* Code inside parent interface

local!details:apply(
rule!LeaveDetailsMerge(
empDataSubSet_cdt: _,
leaveDataSubSet_cdt:local!leaveDataSubSet.data
),
local!empDataSubSet.data
),

 

* Code inside "LeaveDetailsMerge" 

 

with(
local!setOfMatchingData: index(
ri!leaveDataSubSet_cdt,
wherecontains(
cast(3,ri!empDataSubSet_cdt.EmployeeUserName),
cast(103,ri!leaveDataSubSet_cdt.EmployeeUserName)
),
{}
),
{
EmployeeDetails:ri!empDataSubSet_cdt,
LeaveDetails: union(local!setOfMatchingData,local!setOfMatchingData)
}
)

 

If I will just print the values of empDataSubset_cdt or LeaveDataSubSet_cdt, It shows the correct information but when I'm trying to use the above logic it ends up throwing the type conversion error. I also checked by changing the cast(103) to cast(3) but in that case It will not display any data inside LeaveDetails. Can someone please let me know what mistake i'm doing inside the code? Thanks in advance

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    Certified Associate Developer
    in reply to Jayapriya Muthu
    Hi Jayap,

    Thanks for reply but I figured out the issue it was not something related to the type casting in wherecontains() function. It was the issue with union clause used at the bottom code link i.e. LeaveDetails: union(local!setOfMatchingData,local!setOfMatchingData) . I figured out that the issue is happening because I haven't did type conversion there. So after implementing type casting there issue got resolved. Between thanks Vinay and Jayap for all your efforts, I really appreciate your help !