Looping over record list

Why is it that if my record list has only one element, the loop fails to execute my code to process that single element?

The loop should work for a list, even with one element only. Probably your loop fails because the element is not element of a list but a single structure. Make sure that the documentToRecord service that should produce the recordList is configured correctly.

huub,
Could you please give a few more details. Still cannot loop over the single record in a record list.

I believe what happen here is that when it is only one element, the XML was parsed as a single element instead of an array – if you trace your code with one element, you will find out.

I had a similar problem. Try to set the recordname in the recordName field of documentToRecord (eg. FolderName.SubFolderName:RecordName)
Also set makeArrays to false.
That worked for me!

Hope it helps,

Holger.

Thanks for the valuable input. My code is not working. I set the recordName and set the makarrays variable to false and all is ok.

Thanks again to all who responded.