Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

Can We Call a Javascript function through Personalisation block in Message Centre Template

Avatar

Avatar
Validate 1
Level 2
Visakha
Level 2

Likes

5 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile

Avatar
Validate 1
Level 2
Visakha
Level 2

Likes

5 likes

Total Posts

4 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
View profile
Visakha
Level 2

24-04-2019

Hi team,

I have created few functions in Javascript code and want to use those function in personalisation block for Message Center Template.

For the same i have loaded the library and called the function.

I have created a new personalisation block with below Snippet   :

<%

loadLibrary("/cus/customizedFPLCode.js");

%>

<%= displayCurrentDateMonthYearTime(value)%>

Here customizedFPLCode.js is Javascript code name and displayCurrentDateMonthYearTime(value) is the function name.

In Message Center template i have included the above personalisation block(i.e. where i am calling Javascript code). Below is the snippet :

<%@ include view=' ' %> // entered the personalisation block name
But mail is not getting triggered after executing the Soap Request . Below error is coming :

"Error while compiling script 'content htmlContent' line 685: loadLibrary is not defined. SCR-160012 JavaScript: error while evaluating script 'content htmlContent'."

1739767_pastedImage_3.png

Please help me on this.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 250
MVP
DavidKangni
MVP

Likes

256 likes

Total Posts

372 posts

Correct Reply

151 solutions
Top badges earned
Boost 250
Validate 1
Give Back 5
Give Back 3
Give Back 25
View profile

Avatar
Boost 250
MVP
DavidKangni
MVP

Likes

256 likes

Total Posts

372 posts

Correct Reply

151 solutions
Top badges earned
Boost 250
Validate 1
Give Back 5
Give Back 3
Give Back 25
View profile
DavidKangni
MVP

25-04-2019

Hi,

It won't work as Message center server is hosted by Adobe. Until you have access to this server to load your js library, you will not be able to call it.

David

Answers (0)