Expand my Community achievements bar.

SOLVED

query linked tables in content block

Avatar

Level 5

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

Avatar

Correct answer by
Level 4

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

View solution in original post

6 Replies

Avatar

Correct answer by
Level 4

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

Avatar

Level 5
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.

Avatar

Level 5

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.

Avatar

Level 4
so, are you able to access the CB or is it still showing any issue?

Avatar

Level 5
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

Avatar

Level 5
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.