Web app to update a custom schema other than recipient schema | Community
Skip to main content
Level 2
August 31, 2021
Question

Web app to update a custom schema other than recipient schema

  • August 31, 2021
  • 2 replies
  • 3811 views

Hello Everyone,

I want to build a simple web app that updates to a custom schema (offerActivation schema). When I am selecting the document type in the web as offerActivation schema and sending the link in an email and trying to open that link, it is not working. I guess this could be because in the browser there is context related to the recipient schema. I have tried out a lot of things, but it is not working for me. 

I am working with Adobe campaign classic.

Can anyone help me , how to just create a simple web app to update a schema other than the recipeint schema.?

 

Thank you,

Abhijeet

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

Manoj_Kumar
Community Advisor
Community Advisor
August 31, 2021

Hello @abhisr 

 

You can update the custom schema by using Data oriented APIs.

 

Here is a sample code on how to update a customer schema.

xtk.session.write(<customSchemaName _operation="insert" columnName="value" xtkschema="namespace:customSchemaName"/>)

More details are available here: https://experienceleague.adobe.com/docs/campaign-classic/using/configuring-campaign-classic/api/data-oriented-apis.html?lang=en#example-with-the--write--method

 

 

 

Manoj     Find me on LinkedIn
AbhiSrAuthor
Level 2
August 31, 2021

Hi Manoj,

I have kept nms:recipient as the document type in the web app and I have a js activity with the below code.

xtk.session.Write(<offerActivation _operation="update" _key="@salesforceId" offerStatus="as" xtkschema="bp:offerActivation"/>)

 

I am getting the below error:

 

QUE-370007 Unable to find key values for element 'Offer Activation ' (document with schema 'offerActivation') XSV-350023 Unable to save document of type 'Offer Activation (bp:offerActivation)'. SOP-330011 Error while executing the method 'Write' of service 'xtk:persist|xtk:session'.

AbhiSrAuthor
Level 2
August 31, 2021

@abhisr  As mentioned in the error message. You are missing the primary key (salesforceID) against which the data should be updated.

 

Your code should be something like this.

xtk.session.Write(<offerActivation _operation="update" _key="@salesforceId"  salesforceId={SALES_FORCE_ID} offerStatus="as" xtkschema="bp:offerActivation"/>

Let me know if that works.


@_manoj_kumar_ This works in the preview mode of the web app. But when I send this link in an email and then try to open it, it gives the below error.

An error occured

In this persists contact adobe admin.

JS code:


xtk.session.Write(<offerActivation _operation="update" _key="@salesforceId" salesforceId={"125jdkd"} offerStatus="df" xtkschema="bp:offerActivation"/>)

 

Sukrity_Wadhwa
Community Manager
Community Manager
September 16, 2021

Hi @abhisr,

 

Were you able to resolve this query or do you still need more help here? Do let us know.

 

Thanks!

Sukrity Wadhwa