Still having problems, unfortunately. I'm calling three APIs to make the changes. The first two appear to work OK, but the third fails with 'Grade step is invalid. Either grade step does not exist or the eff dates for the assignment are outside those for the grade step'. Sounds straightforward, but I can't find anything that looks wrong - am I missing something?
I hate to inflict reams of code on people, but here are the calls I make (in the correct order but with the surrounding code edited out). I'm only half-familiar with this stuff so am not particularly confident that what I'm doing is sensible.
- I wasn't able to post the code in this window so have attached as PDF.
Thanks for looking! Andrew
Last edited by Andrew; 15/02/1903:22 PM.
#12202 - 19/02/1905:13 PMRe: Update employee spinal point via API
[Re: Andrew]
Andrew, sorry I didn't get an alert that this thread had been updated so I've only just seen it. If in the meantime you've fixed it, then good on you, if not then post an update here and hopefully you won't wait a couple of weeks for me to respond
CT
#12207 - 01/03/1902:40 PMRe: Update employee spinal point via API
[Re: Andrew]
Andrew, something just occurred to me regarding the validation mode.
If you are running your api calls with the p_validation_mode parameter set to TRUE in each case, it may be that the act of rolling back the previous transaction(s) will cause the last one to fail.
It's better, I think, to create a save point prior to your first API call, then set all your p_validation_mode parameters to false - meaning they aren't rolled back (but then neither are they committed).
Then, after the last API call has completed, establish whether you were doing validate-only, and do a ROLLBACK TO <savepoint name> if so.
I'd probably go further and have that entire 3-api sequence in a single procedure with appropriate error handling as well as the savepoint stuff (in case either the second or third APIs failed for some weird reason) that way, you are able to treat the succession of API calls as a pseudo-API in itself - if you see what I mean! No? OK then!