Script Task to multiple parameter in process model

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) Disappointed

  Discussion posts and replies are publicly visible