Display status in command bar button on form load

Hey guys,

i have created several status:

  • 1 for "New" (I took the default one) --> "0 - New"
  • 5 for "In Progress" (I took the default one also) --> "1 - In Progress1", "2 - In Progress2", ...
  • 5 for "Pending" (I took the default one also) --> "6 - Pending1", "7 - Pending2", ...
  • 3 for "Solved" (I took the default one also) --> "11 - Solved1", "12 - Solved2", ...

If I create a ticket, the default Status is "0 - New". --> Fine.

If I edit a Ticket, the Status should be by default "1 - In Progress1" (if the Status was "0 - New") and this Status should be displayed also by default in the command-bar in the drop-down button.

The problem is to display the correct Status in the dropdown button while the form is rendered.

Can you help?

Thanks
Daniel

Hello Daniel!

Perhaps, I don't get the problem, but for me, the custom status is rendered in the dropdown:

Could you provide some visual information so I could understand the issue better?

Yes, the custom status is rendered.

My point is:

  • If i am a member of a specific group and open a ticket with status "0", i want to display the next status in the save button. This would be Status 1 in my case.

The code should look similar likethis (not implemented the group membership yet).

fd.spRendered(function(value) {
    if (fd.field('Status').value = 29) {
            fd.field('Status').value = 30;
        }
});

UseCase:
The user don't have to pick the apprpriate status from the dropdown but can klick the save button because the right status is already in the button.

Thank you for clarifying the use case. I have turned to developers and will notify you about the result I get.

1 Like

Please use the code below to set a custom default status for the Edit form:

fd.spRendered(function() {
    ticketForm.Render().then(function() {
        setTimeout(function() {
            fd.toolbar.$children[0].$children[0].currentStatus = {
                ID: 5,
                Title: 'In progress (custom)'
            }
        }, 500);
    });
});

1 Like

Thanks for the reply! Works perfect!

1 Like