getcurrentitem() mthod

when i try to get date field from collection in my panel code where this field i’m not connected dirctly to it’s dataset but i connected to it by refernce in anther dataset coolection an error apear. this my code

$w.onReady( ()=> {
$w(‘#dataset1’).onReady(()=>{
var date=$w(‘#dataset1’).getCurrentItem(). barithdate ;
var options = { year: ‘numeric’, month: ‘numeric’, day: ‘numeric’ };
$w(‘#text27’).text=date.toLocaleDateString(‘ar-EG’, options);

where barithdate field in client collection and i connecte client collection to booking collection by refernce .where booking collection contain refernce field refer to client collection items .in my page i use booking (R&W)dataset onlyin my pag . this error apears

An error occurred in one of datasetReady callbacks TypeError: Cannot read property ‘toLocaleDateString’ of undefined

Octo, I can reproduce this error with this code if my field name is not in the proper case. For instance, I have a date field called “dateRegistered”. If it is entered as “dateregistered”, the error occurs. Otherwise, it returns the expected result.

no the same name i dont know why i get that error may be where i use field conected by refernce