An element of type '' cannot be converted to 'chaine Unicode'

Created by Mike James, Modified on Fri, 20 Dec, 2024 at 4:17 PM by Mark Crichton

This error message has been found to occur when using code like this:


FOR EACH (data source)

...

END



To avoid it, use this instead:


HReadFirst(data source)

While NOT HOut(data source)

...

...

HReadNext(data source)

END


Here's working example

For/Each gave the error. While Not Hout() ran correctly.

 

// Rename PayCategoryType for Salary Sacrifice

HReadFirst(tmpTable)

WHILE NOT HOut(tmpTable)

       //FOR EACH tmptable 

       IF Contains(Upper(tmpTable.PayCategoryName),"GUARANTEE") THEN

              tmpTable.PayCategoryType = "SUPER EXPENSES"

              HModify(tmpTable)

       END

       HReadNext(tmpTable)

END


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article