Copied to clipboard

Flag this post as spam?

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


  • Gus Braz 14 posts 38 karma points
    Mar 02, 2015 @ 06:44
    Gus Braz
    0

    Umbraco Forms - Add Disapprove Record Action

    Hi guys,

    I'm using UmbracoForms.Package.4.0.1 with Umbraco 7.2.1 and I require to add a new state to the form called Disapprove. So that in the form entries page the user will be able to Approve, Disapprove or Delete a form.

    How can I append the state Disapprove to the form states? 

    Does anybody know the direction?

    Many Thanks,

    Gus

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Mar 02, 2015 @ 07:14
    Jan Skovgaard
    0

    Hi Gus

    Not quite sure if what you're asking about is possible - But I think you should checkout the documenation for Forms at https://github.com/umbraco/UmbracoFormsDocumentation/blob/master/Developer/index.md - There is a section named "Extending", which may be of interest.

    /Jan

  • Gus Braz 14 posts 38 karma points
    Mar 02, 2015 @ 07:30
    Gus Braz
    0

    Thanks Jan,

    I had already looked at the documentation you provided as I have already created a new workflow type.

    I'm developing a charity website where families apply for grants for children with rare diseases using Umbraco Forms. What I need to do is send a custom email back to the family when a Grant Application is approved and a different email when a Grant Application is disapproved.

    Thanks again,

    Gus

     

     

  • Rohith Racherla 9 posts 79 karma points
    Jul 29, 2016 @ 18:01
    Rohith Racherla
    0

    Hey Gus,

    Did you manage to sort this issue, I'm trying to implement something similar

    Thanks Ro

  • marcelh 171 posts 471 karma points
    Jan 11, 2018 @ 22:16
    marcelh
    0

    Just ran in t this. Did you manage to add another state to Umbraco Forms?

  • Henrik Bayer Nielsen 10 posts 92 karma points
    Dec 02, 2019 @ 10:41
    Henrik Bayer Nielsen
    0

    I just ran into this scenario as well and as no solution was posted I figured I would post mine here for reference.

    I didn't manage to add a new state, but as the "Deleted" state isn't really used I decided to use that as my "Declined" state.

    I am using Umbraco 8.3.0 but it should work for v7 as well.

    I basically just created a new class inheriting from the RecordSetActionType and that was it.

    public class DeclineRecord : RecordSetActionType
    {
        private readonly IRecordStorage _recordStorage;
    
        public DeclineRecord(IRecordStorage recordStorage)
        {
            Id = new Guid("165bd6b4-f0d3-40f2-8ade-f7bb960ccae0");
            Name = "Decline";
            Icon = "icon-thumb-down";
            Description = "Declines an application";
            ConfirmMessage = "Are you sure you want to decline these entries?";
            NeedsConfirm = true;
    
            _recordStorage = recordStorage;
        }
    
        public override RecordActionStatus Execute(List<Record> records, Form form)
        {
            foreach (var record in records)
            {
                record.State = FormState.Deleted;
                _recordStorage.UpdateRecord(record, form);
    
                // Do whatever else you want here
            }
    
            return RecordActionStatus.Completed;
        }
    
        public override List<Exception> ValidateSettings()
        {
            throw new NotImplementedException();
        }
    }
    
  • 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