Skip to content

Looping a call to a *_API.MODIFY__() procedure across many records only actually updates the first record in the loop, even though a log table confirms every iteration of the loop genuinely ran. Why does only the first record change?

Answer

The attr_ parameter you pass to MODIFY__ gets consumed/cleared out by the call itself (the method processes and effectively empties it, potentially also returning other attributes back into it) — so if you set that attribute string once before the loop and just reuse the same variable across iterations, it's empty by the second call onward, and MODIFY__ has nothing to actually change. Rebuild the attribute string fresh inside the loop, immediately before each MODIFY__ call: call Client_SYS.Clear_Attr() on it first, then Client_SYS.Add_To_Attr() for each field you want to change, every single iteration — don't set it once outside the loop and expect it to persist across calls.

← Browse Developer Studio, deployment, and upgrades questions