Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Create an empty associative array
- HashIDs is associative array of bool
- // Populate the associative array with values from the "idAnunciList" parameter
- FOR EACH id OF params.idAnunciList
- HashIDs[id] = True
- END
- // Create a list to store the IDs of the selected records
- listIDs is List of Integer
- // Add the IDs of the selected records to the list
- FOR EACH TAULELL_ANUNCIS
- IF TAULELL_ANUNCIS.CodiEmpleat_Autor = params.userID AND HashIDs[TAULELL_ANUNCIS.TaulellAnuncis_ID].Exists THEN
- listIDs.Add(TAULELL_ANUNCIS.TaulellAnuncis_ID)
- END
- END
- // Use SQL queries to modify and update the selected records
- IF listIDs.Count > 0 THEN
- sQuery is string = "UPDATE TAULELL_ANUNCIS SET isDeleted = true WHERE TaulellAnuncis_ID IN (" + Join(listIDs, ",") + ")"
- // Execute the SQL query to update the records
- HExecuteSQLUpdate(sQuery)
- // Read the modified records and add them to the array
- FOR EACH ID IN listIDs
- taulellAnuncis is MTAULELL_ANUNCIS
- taulellAnuncis.Read(ID)
- obj is MTAULELL_ANUNCIS = taulellAnuncis
- arrayAnuncis.Add(obj)
- END
- // Serialize the modified records and return the result
- sToReturn is ANSI string
- Serialize(arrayAnuncis, sToReturn, psdJSON)
- RETURN sToReturn
- ELSE
- // If no records were selected, return an empty array
- sToReturn is ANSI string
- Serialize(arrayAnuncis, sToReturn, psdJSON)
- RETURN sToReturn
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement