Implement SendBack Feature

Forums Dynamic Forms for SharePoint Implement SendBack Feature

This topic contains 4 replies, has 3 voices, and was last updated by  Chandan Kumar 1 week, 1 day ago.

  • Author
    Posts
  • #21143

    Chandan Kumar
    Participant

    Hi Alex,
    We are using DFFS tool in our organization to develop application functionality in SharePoint 2013. We are fairly new to DFFS. We have one custom functionality to implement send back feature in Workflow. Currently we are implementing workflow logic using JavaScript (Switch case) in Custom JS. Now we have custom requirement to send back the workflow to any previous steps. My plan is to store all the workflow steps name which is already passed, in one multiline column and when users select Send Back button, then we can give pop up to user which steps he wants to send back. It would be much helpful if you could help me out with some snippet or inbuilt function I can use to achieve similar functionality

  • #21147

    Alexander Bautz
    Keymaster

    Hi,
    Wouldn’t it be easier to use a choice field where all the statuses were listed, and then use rules in DFFS to trigger on the different statuses?

    In this scenario, you could for example add a HTML section in a Tab with a button like this:

    <input type="button" onclick="sendBackToDraft()" value="Set back to Draft">

    Then put this in the Custom JS:

    function sendBackToDraft(){
        setFieldValue("YOUR_STATUS_FIELD_NAME","Draft");
        // If you want to save the form when pressing the button, you can add this line:
        spjs.dffs.triggerSave();
    }

    Alexander

  • #21149

    Chandan Kumar
    Participant

    Hi Alex,
    Thanks for your quick response! Currently I am using the same way to move the Workflow ahead from one step to another. I am using one choice field which is holding all the Workflow Steps name and using switch case for each steps and its working perfectly file. I am also using rule to handle showhide at each step.

    So now my actual requirement is different. Suppose there is 10 steps workflow and currently the workflow is pending at 5th step. The 5th step Approver wants the workflow to Send back to 3rd step. So when 5th Approver click on Send Back button, he should get option to send it back to any 4 previous steps.
    Now my plan is to store the Steps name which is already passed, in multi-line column (suggest if better option available). And When user click on Send Back button, I will show the value of multi-line column as a option(not sure if its feasible) to user to which previous steps he wants to send it back. Once the user select one step name, Then I will use the rule to handle showhide of the columns. So please let me know if it can be achieved in a better way and also some snippet to achieve the functionality.
    Thanks a lot in advance!

  • #21154

    Keith Hudson
    Participant

    Chandan;

    As your form moves from one step to the next, you could store an array of the step names for the steps that have already happened in your multi-line text field. Then, on your form, you can use an HTML section to construct a select element, and use add() method as explained here https://www.w3schools.com/jsref/met_select_add.asp to loop through the array of previous steps and add them to the select drop down.

  • #21158

    Chandan Kumar
    Participant

    Thanks for the solution Keith!

    I will try implementing the way you suggested and will update

You must be logged in to reply to this topic.