Expand my Community achievements bar.

Adobe Campaign User Groups are live now. Join our Adobe Campaign User Groups and connect with your local leaders!
SOLVED

Impossible to update. Creation of new recipient profile is not allowed. Unsubscribe and subscribe

Avatar

Level 7

Hello, I get this error trying to subscribe recipients to services via javascript:

Heku__0-1701258990602.png

My code is like this, I query the target schema and I subscribe or unsubscribe with a non empty email that has a existing recipient, and in @SuB there is the service.

Heku__2-1701259202947.png

Any idea? @Manoj_Kumar_ @ParthaSarathy @Parvesh_Parmar @DavidKangni

Thank you in advance.

1 Accepted Solution

Avatar

Correct answer by
Community Advisor

Hello @Heku_ 

 

Try chaging the _key from @email to @id

 

Your code will look like this:

 

 var recipient =<recipient _key = "@id" id = {e.@id} /> // assuming e.@id is the recipient id

nms.subscription.Subscribe(e.@sub,recipient,false)   

 

If you don't have the recipient id value in the targetData then query the recipient with email address and then pass the object or recipient id.

 


     Manoj
     Find me on LinkedIn

View solution in original post

4 Replies

Avatar

Employee Advisor

Hi Heku,

 

I found a few internal bug references for this, and it appears to occur because of a limitation seen when webApps are going through stage, and no prefill is done. Meaning, either no prefill activity is present or a prefill activity with "Skip preloading if no ID" is checked.

 

The limitations listed for this are NEO-33769 and NEO-33770. Once addressed these references should be listed in the build release notes.

Avatar

Level 7

Hello, thank you for your reply, but this script is not from a webapp.

Avatar

Correct answer by
Community Advisor

Hello @Heku_ 

 

Try chaging the _key from @email to @id

 

Your code will look like this:

 

 var recipient =<recipient _key = "@id" id = {e.@id} /> // assuming e.@id is the recipient id

nms.subscription.Subscribe(e.@sub,recipient,false)   

 

If you don't have the recipient id value in the targetData then query the recipient with email address and then pass the object or recipient id.

 


     Manoj
     Find me on LinkedIn

Avatar

Level 7

The problem was initializing in two steps the recipient to update, solved with:

var recipient = {recipient: {_key: "id", id: e.@id.toString()}};

 

Thank you!