0

Optimizar Script. Too slow on Web

let vDD := CutOff_;
let check := dialog(" Warning ", " ¿Confirm the Update Progress Project? ", ["Yes", "No"]);
if check = "Yes" then
    for loop1 in select CutOff do
        CutOff_ := loop1.DateCO;
        let xPry := first(select Project);
        let xFld0 := xPry.'% Plan';
        let xFld1 := xPry.'% Earned';
        let xFld2 := xPry.'Data|Date';
        let xFld3 := xPry.Week;
        let xFld4 := xPry.'Plan Value PV';
        let xFld5 := xPry.'Earned Value EV';
        let xFld6 := xPry.'Cost Week';
        let xFld7 := xPry.SPI;
        let xFld8 := xPry.CPI;
        let xFld9 := xPry.'Plan Hours';
        let xFld10 := xPry.'Earned Hours';
        let Pgr := (create 'Progress Report');
        Pgr.(Plan := xFld0);
        Pgr.(Real := xFld1);
        Pgr.('Date CutOff' := xFld2);
        Pgr.('Week CutOff' := xFld3);
        Pgr.('Total Earned Plan' := xFld4);
        Pgr.('Total Earned Real' := xFld5);
        Pgr.('Gasto Semana' := xFld6);
        Pgr.(SPI := xFld7);
        Pgr.(CPI := xFld8);
        Pgr.(Plan_Hours := xFld9);
        Pgr.(Earned_Hours := xFld10)
    end
else
    closeRecord()
end;
(select 'CutOff Date').(CutOff_ := vDD);
alert(" 👍 The Update Progress Report created Successfully")

How can I optimize this script, is too slow on Web.

Works excelente on Android.

2 Antworten

null
    • + Maßanzug statt Massenware +
    • RonaldP
    • vor 1 Jahr
    • Gemeldet - anzeigen

    HiRafael Sanchis ,

    i have the following suggestions:

    a.) Move xPry up, to be executed once befor the loop instead of everytime in each loop.

     let xPry := first(select Project);
    for loop1 in select CutOff do
            CutOff_ := loop1.DateCO;

    b.)  use:

    CODE

    do as server
    xPry := first(select Project);
    for loop1 in select CutOff do
            CutOff_ := loop1.DateCO;
            let xFld0 := xPry.'% Pla
    .
    .
    Pgr.(Earned_Hours := xFld10)
    end
    end

    c.) You can also try: ....

    do as deferred
    
    .xPry := first(select Project);
    for loop1 in select CutOff do
    .
    .
    Pgr.(Earned_Hours := xFld10)
        end
    end
      • Rafael_Sanchis
      • vor 1 Jahr
      • Gemeldet - anzeigen

       Right Thanks

      Appreciate your help.