[Eg-newdevs] get_tcn function scope

Josh Stompro stomproj at gsuite.larl.org
Wed Jun 16 16:35:30 EDT 2021


Terran, I think the get_tcn function is in scope... it just doesn't return
a value.  I followed the code in the developer console and it does grab the
tcn.

The function sets the $scope.local_overlay_target_tcn to be equal to the
found tcn value.  But it doesn't return it.

    function get_tcn(currTarget) {
        egCore.pcrud.retrieve('bre', currTarget, {
            select: {bre: ['tcn_value']}
        }).then(function(rec) {
            $scope.local_overlay_target_tcn = rec.tcn_value();
        });
        return;
    };

Maybe the function should just return the value... and then instead of just
calling it like

  } else {
            $scope.local_overlay_target = items[0]['bibid'];
            var currTarget = items[0] ['bibid'];
            get_tcn(currTarget);
        }

You would use

  } else {
            $scope.local_overlay_target = items[0]['bibid'];
            var currTarget = items[0] ['bibid'];
            $scope.local_overlay_target_tcn = get_tcn(currTarget);
        }

Josh
[image: Company logo]
*Josh Stompro*

*IT Director stomproj at gsuite.larl.org <stomproj at gsuite.larl.org>*
*218-233-3757 ext. 139* | *Mobile: 218-790-2110*

*Lake Agassiz Regional Library | **www.larl.org <http://www.larl.org>*
118 5th ST S
Moorhead MN 56560
*Celebrating 60 Years of Service in 2021!*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://list.evergreen-ils.org/pipermail/eg-newdevs/attachments/20210616/8e950666/attachment.html>


More information about the Eg-newdevs mailing list