I have created a content block which will display a custom resource field and i am making it dynamic by using Java Script. As we know we can access an OOTB field for example firstName from Profile as:
var firstName = context.profile.firstName ;
But how to access a custom resource field in the similar way.
For my use case i want to access a field named 'price' from a custom resource say 'productLookUp':
I am using the following code:
var price= context.targetData.cusProductLookUp.price;
But when i am using the above content block in an Email Delivery i am getting the following :
JST-310000 Error while compiling script 'sampleDeliveryTemplate[htmldefaultContent]' line 86: context.targetData is undefined.
so it is not able to compile the above line of code. Can you please suggest any alternative way to achieve the same.