Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm currently working on a custom workflow, that kicks in as soon as the user submits a form and then redirects the user with extracted data to an external URL. Thus the "workflow execution chain" is aborted, when the redirect happens. Now I'd like to be totally crazy and pick the execution chain up again from where it left via a callback URL from the page the user was redirected to.
So the flow would be like this
Is there a way to achieve this?
I guess I could also try creating a surface controller, which does the work another custom workflow would do and then set the record state manually. But for this task to work the user needs to specify configuration data, what is easily done with workflows. With surface controllers those variables would need to be set hard in code.. and I'm not a fan of that, especially if it's sensitive data..
Yeah just use the API, if you have the record id that's all you'll need and then you'll need a code snippet that set's the record to approved
So just like this and I'm done?
//Get record and form by recordID in the url params
ApproveRecord ar = new ApproveRecord();
That would be splendid :D
Hm apparently yes and no. I'm struggling to find a way to actually be able to use that snippet. I apparently can't use it in Razor, so what are my options to approve a record? Is there a way in razor? Or how can I do it without Razor?
You can run any code in razor, because it is effectively C#. Unfortunately, the code snippet you have there isn't correct. You may want to checkout the Umbraco Contour Documentation and read up on how it works. Tom Fulton has a good code sample on gist. Here's another one:
var recordId = Request["recordId"];
var guid = new Guid(recordId);
using (var storage = new RecordStorage())
var record = storage.GetRecord(guid);
using (var service = new RecordService(record))
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted