EOS-Solutions / IDEAS

IDEAS for Apps and Features
14 stars 5 forks source link

EDS Order for Status (WI 12790) #206

Open MarcusFabian opened 1 year ago

MarcusFabian commented 1 year ago

Table EOS DS Table Status (18122142) I'd like to see a sort order of the status (aka new "Order" field). The idea is that the user could simply start a function "Next Status" in order to move to the next higher status rather than manually selecting status change from the factbox.

We achieved that in the current solution by prefixing our status with numerical values. Such as 01-NEW, 02-PROGRES, 05-APPROVED but giving an order to "find the next higher status" would be a plus.

You might use the following code snipped as a start:

local procedure StatusUP()
    var
        EDSStatusTrans: Record "EOS DS Status Transaction";
        EDSMgt: Codeunit "EOS DS Management";
        rRef: RecordRef;
        fRef: FieldRef;

    begin
        rRef.Open(Rec."Table ID");
        if not rRef.GetBySystemId(Rec."Table Rec. SystemId") then
            EDSMgt.GetCurrentRecordRef(Rec, rRef);
        EDSStatusTrans.SetRange("Table ID", Rec."Table ID");
          fRef := rRef.Field(1);
          EDSStatusTrans.SetRange("Table Option Type", fRef.Value);
        EDSStatusTrans.SetRange("From Status", Rec."Status Code");
        EDSStatusTrans.SetFilter("To Status", '>%1', Rec."Status Code");  // replace here with new order-value
        if EDSStatusTrans.FindFirst() then begin
            if EDSStatusTrans."To Status" <> Rec."Status Code" then begin
                EDSMgt.ChangeDirectStatus(rRef, Rec."Status Code", EDSStatusTrans."To Status", '');
            end;
        end;
    end;
AndreaDiCeglie commented 1 year ago

We are evaluating a different implementation

image image