Can't publish a quote using custom coded action in a workflow
SOLVE
Morning!
We are currently scoping out the possibility of automating quote generation for some of our accounts.
I have code that 1. creates a new quote in draft state and adds in - the title, status, expiration date, language, esign enabled, some sender info, comments and terms.
2. associates the quote to a deal
3. associates the quote to a signing contact
4. associates the quote with a quote template (custom one)
5. creates a line item and associates that to the new quote and to the deal
However when we try to publish the quote it fails with a 400 error message.
We've checked the scopes on the private API which all seem present and accounted for but it is still erroring.
We've tested and manually clicking through the quote to the final page (just before published stage) and then running the code and it works! What am I missing that is in a manual click through (no changes made what soever on this click through) that is is not picking up in the code to publish?
Thank you for coming back to me and the link to the other thread.
The error mesage isn't very helpful. It just says
Request failed with status code 400
I've tried the 'hs_currency' and this doesn't seem to be the probelm either. We are default USD and the deal is USD i'm still getting the same error message as above.
I've added in a delay before publishing incase associating the line item wasn't happening as quickly as I'd hoped. I also went through to the other thread linked in the thread you mentioned and can't see anything there that would be causing the error either. We are doing it as a patch request and not a post request and all associations are being made before the quote needs to be published.
Each of the steps is a separate block of code in my workflow. Would that be casuing any issues? On checking the quote it does create it is all fine and seems to be setting things correctly to the same quote so it should have everything it needs to be published.
I am setting a signing contact. Do I need to also set them as the main 'non signing' contact in the code too? From looking at the quote it seems to infer that if they are the signer they are also a contact as well however.