What is the key field for records in a temporary schema? How to update records in the temp schema using JavaScript | Community
Skip to main content
Level 2
September 17, 2024
Solved

What is the key field for records in a temporary schema? How to update records in the temp schema using JavaScript

  • September 17, 2024
  • 1 reply
  • 709 views

I have created a field in a workflow temporary schema (for the sake of this example, called fieldToUpdate).

I have a JavaScript activity and I want this to update the content of the field 'fieldToUpdate' to "Y" for record flowing through the activity as follows:

var myXML = <queryDef schema="temp:query3" operation="select"> <select> <node expr="fieldToUpdate"/> </select> </queryDef> var query = xtk.queryDef.create(myXML) var res = query.ExecuteQuery() for each (var rcp in res.query3){ var myXMLwrite = <query3 xtkschema="temp:query3" fieldToUpdate="Y" operation="insertOrUpdate" _key="???"/>; xtk.session.Write(myXMLwrite) }


I am able to update persistent schemas without difficulty, but my inability to identify the key value for rows in a temporary schema is blocking my progress here.

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

Hi @dandrews2 , See if this helps https://technowide.net/2017/05/19/iterating-custom-functions-record/

1 reply

Pradeep_Kumar_Srivastav
Community Advisor
Pradeep_Kumar_SrivastavCommunity AdvisorAccepted solution
Community Advisor
September 17, 2024
Dandrews2Author
Level 2
September 25, 2024

Thanks for sharing Pradeep

In the end I used a different method to solve my issue, but the above should prove a useful resource anyway.