Skip to main content
nitinn0007
June 16, 2022
Solved

script task in process model

  • June 16, 2022
  • 8 replies
  • 0 views

Hello community,

   I am tried to store my all data of form into database,

   So in that I used more than 1 CDT in my form, and then I am using script task to mapping one ID into other one, and then I am using multiple data store entity

  to send all data at a time in different tables of database.

So now the issues is that My all data is saving but

script task is not working, I am unable to mapping ID.

So what I have to do  to map.

Best answer by stefanhelzle0001

Your code in the output of a script task should like something like this

a!foreach(
  items: pv!something,
  expression: a!update(
    fv!item,
    "foreign key field",
    pv!customer.id
  )
)

a!save() does only work inside a saveInto on UI components.

8 replies

harshitb6843
June 16, 2022

You need to run write to DSE node. NOT write to Multiple DSE. 
because you need the ID of first table in the second one. Therefore, you a write to DSE, store the output in the same variable, use a script task to map the id into another table, and then write the second table. 

nitinn0007
June 16, 2022

First I used write to DSE  from that I take only 1 CDT in that and I got the ID and that after used script task, and then I used

Multiple DSE than I am getting all the details in my database