Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Bo Jacobsen 438 posts 1818 karma points
    Feb 12, 2016 @ 11:14
    Bo Jacobsen
    0

    Cant update record fields in workflow when manually approve submitted records.

    using Umbraco 7.3.3 and Umbraco Forms 4.1.4

    I got the issue that i cant seem to update record fields in a custom workflow when i set it to manually approve submitted records.

    Dont update this way as i though it would.

    public override WorkflowExecutionStatus Execute(Record record, RecordEventArgs e)
        {
            record.GetRecordField("Aktivitet").Values.Clear();
            record.GetRecordField("Aktivitet").Values.Add("MyCustomString");
    
            var fs = new FormStorage();
            var form = fs.GetForm(record.Form);
            var rs = new RecordStorage();
            rs.UpdateRecord(record, form);
            rs.UpdateRecordXml(record, form);
    
            fs.Dispose();
            rs.Dispose();
    
            return WorkflowExecutionStatus.Completed;
        }
    

    Update the record, but crashes the server

    public override WorkflowExecutionStatus Execute(Record record, RecordEventArgs e)
        {
            record.GetRecordField("Aktivitet").Values.Clear();
            record.GetRecordField("Aktivitet").Values.Add("MyCustomString");
    
            RecordService.Instance.Submit(record, e.Form);
    
            return WorkflowExecutionStatus.Completed;
        }
    

    Updates the record field if not set to manuelly approve submitted records. If i want to manuelly approve the records, it wont save it to the fields, but it sends the field data that is not set with the currect value in a mail (if i select a workflow to send mail).

    public override WorkflowExecutionStatus Execute(Record record, RecordEventArgs e)
        {
    
            record.GetRecordField("Aktivitet").Values[0] = "MyCustomString;
            return WorkflowExecutionStatus.Completed;
        }
    

    I really need help here :)

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies