query linked tables in content block

surajp86368405

30-12-2019

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

Accepted Solutions (1)

Accepted Solutions (1)

chan2111

08-01-2020

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

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.

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.

so, are you able to access the CB or is it still showing any issue?
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
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.

Answers (0)