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
Views
Replies
Total Likes
Hello @AbhijeetSrivastava
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...
Views
Replies
Total Likes
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'.
Views
Replies
Total Likes
@AbhijeetSrivastava 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.
Views
Replies
Total Likes
@_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"/>)
Views
Replies
Total Likes
In the preview mode, Are you selecing the recipient manually? If yes, Then you need to pass the encrypted recipient id parameter in the URL.
Also, You can make use of debug mode to trouble shoot issue and get more details on the error.
Views
Replies
Total Likes
@_Manoj_Kumar_ Below is my url. I am passing the recipient id.
/webApp/APP7?id=<%=escapeUrl(cryptString(recipient.id))%>
Views
Replies
Total Likes
If I remove my js code to update the offerActivation table and try to update something in the recipient table, then it works. It is not working for other tables and I don't understand why.
Views
Replies
Total Likes
Can you share your JS Code? Without that it won;t be possible to identify the issue.
Views
Replies
Total Likes
below is my js code:
xtk.session.Write(<offerActivation _operation="update" _key="@salesforceId" salesforceId={"123xyz"} offerStatus="df" xtkschema="bp:offerActivation"/>)
I am hardcoding the salesforce id for now.
Views
Replies
Total Likes
changed the code to this.
var salesForceId="123xyz"; xtk.session.Write(<offerActivation _operation="update" _key="@salesforceId" salesforceId={salesForceId} offerStatus="df" xtkschema="bp:offerActivation"/>)
Views
Replies
Total Likes
Also, Your SalesforceId should exists in the schema
Views
Replies
Total Likes
@_Manoj_Kumar_ Still it is behaving the same. Working in the preview mode and not working in the browser.
Views
Replies
Total Likes
Can you share the screenshot of debug mode to troubleshoot?
Views
Replies
Total Likes
Were you able to resolve this query or do you still need more help here? Do let us know.
Thanks!
Views
Replies
Total Likes