Skip to main content
July 27, 2022
Question

Script Task to multiple parameter in process model

  • July 27, 2022
  • 2 replies
  • 0 views

Requirement : Inserting customer and transaction records to database using Process Model.

one to many relationship between cutomer and transaction table. ( one customer can have multiple transaction )

My Scenario

I have one customer and 2 ttransacion records which has to be added to the database.

Write to Datastore entty :Inserted  customer data in to  database and received  inserted id  for the customer data.

Script task :Used script task to assign the  customer id ( received from previous step) to  transaction table foregin key . ( multiple  checkbox is checked in script task)

Write to Datastore entty : 2  transaction records are added to db but first record has the foreign key but not the second one.  

May I know why script task is assigning foreign key to the first record but not second record ? Did I miss anything ?  Is there any other method to resolve this  ?

----------------------------------------------------------------------------------Current Status-------------------------------------------------------------------

Customer record inserted to database and returned  newly created id ( primary key) to  process model

 2 transactions record were also added  one with foreign key  ( Correctly added )  and other one without foreign key ( null) [emoticon:ca08b2c27c2f40e993e89508acf29e0b]

2 replies

harshitb6843
July 27, 2022

Did you run a loop in the second script task to assign the customerId to every transaction CDT in the list?

stefanhelzle0001
July 27, 2022

Same question from you

community.appian.com/.../98510