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

SOLVED

query linked tables in content block

surajp86368405
Level 4
Level 4

Hi Experts

 

i have an requirement where i am trying to access the linked resource for the profile resource using content block. the linked resource contains offers for which is linked via email.

i can see the linked resources but when i am trying to access it using content block using context.profile.linkname, i am getting an undefined error.

 

Below are some of the path i have tried which are all undefined. any hint in the right direction will be helpful

 

/context/profile/cusFavonSaleDatalinkoffers1 - undefined

/context/profile/cusFavonSaleDataofferslink - error in email preparation

/context/profile/cusFavonSaleData - undefined

/context/favonSaleData - undefined while saving

/context/cusfavonSaleData - undefined while saving

/context/profile/linkoffers  - undefined

1 Accepted Solution
chan2111
Correct answer by
Level 4
Level 4

can you provide the code you have written in the content block?

View solution in original post

6 Replies
chan2111
Correct answer by
Level 4
Level 4

can you provide the code you have written in the content block?

View solution in original post

surajp86368405
Level 4
Level 4
Thank you for your reply. After some more research i have narrowed down the issue to some update in the table. the content block currently i have is just just loop through the variables.
surajp86368405
Level 4
Level 4

missed to put whole content. Below is the content block i have.

 

<p>above this is profile before fav initialization... below this is customm fav on sale data offerlink </p> <% for (var y in context.profile) { if (context.profile.hasOwnProperty(y)) { %> <%= y %> <% } } %> <p>above this is context... below this is customm fav on sale data offerlink </p> <% for (var z in context.profile.cusSavingsforyouofferslink) { if (context.profile.cusSavingsforyouofferslink.hasOwnProperty(y)) { %> <%= z %> <% } } %> <p>above this is context... below this is customm fav on sale data offerlink </p>.

 

 

when a profile doesnot have any linked offers email preparation goes fine. but, when there is an linked offer the email preparation throws the error. Below is what i see.

 

WDB-200001 SQL statement 'INSERT INTO NmsBroadLogExec(biBroadLogId,biMktBroadLogId,sAddress,iDeliveryId,iStatus,iFlags,tsEvent,tsLastModified,tsnextPass,sIpAffinity) SELECT biMessageId,biMessageId,sAddress,iDeliveryId,6,CASE WHEN sTargetCode='__BAT__' THEN 2 WHEN sTargetCode='__MAIN__' THEN 0 ELSE 4 END,tsEvent,GetDate(),tsEvent,E'default' FROM wkf40966864_1_1' could not be executed. 01/08/2020 11:41:37 AM PGS-220000 PostgreSQL error: ERROR: duplicate key value violates unique constraint "nmsbroadlogexec_id" DETAIL: Key (bibroadlogid)=(11756002) already exists.

chan2111
Level 4
Level 4
so, are you able to access the CB or is it still showing any issue?
surajp86368405
Level 4
Level 4
missed to put whole content. Below is the content block i have. <p>above this is profile before fav initialization... below this is customm fav on sale data offerlink </p> <% for (var y in context.profile) { if (context.profile.hasOwnProperty(y)) { %> <%= y %> <% } } %> <p>above this is context... below this is customm fav on sale data offerlink </p> <% for (var z in context.profile.cusSavingsforyouofferslink) { if (context.profile.cusSavingsforyouofferslink.hasOwnProperty(y)) { %> <%= z %> <% } } %> <p>above this is context... below this is customm fav on sale data offerlink </p>. when a profile doesnot have any linked offers email preparation goes fine. but, when there is an linked offer the email preparation throws the error. Below is what i see. WDB-200001 SQL statement 'INSERT INTO NmsBroadLogExec(biBroadLogId,biMktBroadLogId,sAddress,iDeliveryId,iStatus,iFlags,tsEvent,tsLastModified,tsnextPass,sIpAffinity) SELECT biMessageId,biMessageId,sAddress,iDeliveryId,6,CASE
surajp86368405
Level 4
Level 4
i am still having issues. the problem i face is i am unable to access the offerlink variables using the content block. Let me know if you need more details. Thank you for you help on this.