I am trying to approximate the Submit all so that it can be executed directly from a portal and I am trying to figure out how the UI is able to generate the following message:
"The following items cannot be submitted as they are already part of a workflow."
How can I determine if a given item in a users sandbox is already part of a workflow?