Error while trying to access Custom Label from Skuid (from JavaScript)
Hello There ,
I am trying to access a label as shown below:
var specialSegment = skuid.utils.mergeAsText("global","{{$Label.Special_Partner}}");
but have got an error saying :
skuid__SkuidJS:26 Uncaught TypeError: Cannot read property 'organizationId' of undefined
Any idea on how to utilize this method from utils ?
I am trying to access a label as shown below:
var specialSegment = skuid.utils.mergeAsText("global","{{$Label.Special_Partner}}");
but have got an error saying :
skuid__SkuidJS:26 Uncaught TypeError: Cannot read property 'organizationId' of undefined
Any idea on how to utilize this method from utils ?
Tagged:
1
Categories
- 7.9K Questions
- 926 Ideas
- 220 Discussion Categories
- 178 General
- 9 Community Feedback
- 3 Community Info
- 18 Knowledge Base
Comments
If anyone out there is looking for same problem solution:
The reason was : The Skuid.utils.userInfo object is only available once the page is loaded.
So if you intend to access this in "inline" snippet
$(document.body).one('pageload',function(){
//Here you should be able to access as shown below
var specialSegment = skuid.utils.mergeAsText("global","{{$Label.Special_Partner}}"); console.log('specialSegment from Label',specialSegment);
});