Looking at the second screen, I would change the Where clause from RecordID = Action Result: refnoresult to RecordID = Value from Screen RecordID. An even better approach would be the action I suggested above, if the recordID is available on screen.
If this is being imported through the API, where are these actions posted above taking place? From what I understand of the API, you will get an XML response of the recordID if the insert was successful. Perhaps you can use this in additional API calls to update the Ref Number field. However, a question like this is better off asked in our API Forums.
If this is something you wish to do with an action on a Method screen, let me know which screen and button this is happening on. Depending on where the action is taking place, I believe I can suggest a better way of doing this. Also, are you using Invoice and Bill interchangably? Method has both an Invoice screen and Bill screen, so this is confusing me a bit.
- Adam