That line (68) needs to be in the second loop and you need to find the serialnum value defined on line 74, so it needs to appear after that line.
The syntax is incorrect - it needs two parameters (see docs).
You can use ListFind in a cfif quite easily. If it finds it, it will return true and false otherwise. You only want to delete if it doesn't find the serial number.
What these changes do are the following:
1. Insert/update serials only in the first loop.
2. In the loop, get the serials that have been inserted and updated in an array to avoid deleting them.
3. When inserting/updating is complete, we now want to delete.
4. All serials that were not inserted or updated are deleted.
You'll eventually have to do something similar for parts, but get this working first.
The syntax is incorrect - it needs two parameters (see docs).
You can use ListFind in a cfif quite easily. If it finds it, it will return true and false otherwise. You only want to delete if it doesn't find the serial number.
What these changes do are the following:
1. Insert/update serials only in the first loop.
2. In the loop, get the serials that have been inserted and updated in an array to avoid deleting them.
3. When inserting/updating is complete, we now want to delete.
4. All serials that were not inserted or updated are deleted.
You'll eventually have to do something similar for parts, but get this working first.
Comment