Skip to main content
December 4, 2022
Question

Error in ER

  • December 4, 2022
  • 10 replies
  • 0 views

can anyone please give suggestion how to resolve this error ?

    10 replies

    harshas2775
    December 4, 2022

    Hey, looks like the rule mentioned in line 26 is calling another rule within it, namely - cdm2_gettimeentrycdtfielddiff. Open the rule mentioned in line 16 and within that whichever line you are calling rule cdm2_gettimeentrycdtfielddiff, check the and() where you are trying to compare variables. In that one would be an integer and another might be a local variable. Just wrap that local variable in a tointeger(). That should help!
    If not advice you to paste the screenshot of the rule cdm2_gettimeentrycdtfielddiff as called from within the rule timeEntryDetailsForActivityHistory!

    December 4, 2022

    Hii Harsha,

    TimeentryDetailsForActivityHistory:

    and  cdm2_gettimeentrycdtfielddiff

    harshas2775
    December 5, 2022

    In your second rule where you are checking the time entry cdt field difference, add a typecasting logic so that both the values in comparison are of same type.

     eg. value1=value2 can be replaced as cast(typeof(value2),value1)=value2 

    In your case value1 i.e. the old record might be null and thus when you are trying to compare that to value 2, having an integer field in it casting error is coming. By using cast() you can make both the values of the same type so that comparison can happen.

    karthikr067273
    December 4, 2022

    Hi Jyoti,

    The cdm2_gettimeentrycdtfielddiff() expression is being called from cdm2_timeentrydetailsforactivityhistory() and the values being used by the cdm2_gettimeentrycdtfielddiff() expression are the types of Number and List.

    But the values should be in the type of Number to do the successful comparison. That is what the error says.


    Check the parameter values and properly index and cast the value to the Number type if needed. Then the issue will get solved.
    Thanks

    December 5, 2022

    Hii karthi,

    can you please help me out where I missed