0

Formula for combine two Alerts Date's

Hi I need combine this two Alerts in the same Formula 

1 - These Formula 

if FechaR5 < FechaR4 then
    alert("Fecha Real 5 no puede ser menor que Fecha Real 4")
else
    "ok"
end

2- And These For Holidays 

let curRec := this;
let xDate := cnt(select FERIADOS where Fecha = curRec.FechaR5);
if xDate > 0 then
    let result := dialog("⚠️", " Esta Fecha es FERIADO. Procedemos ?", ["Si", "No"]);
    if result = "No" then FechaR5 := false end
end

4 replies

null
    • Rafael Sanchis
    • Rafael_Sanchis
    • 2 yrs ago
    • Reported - view

    I try this but don't work.

    let curRec := this;
    let xDate := cnt(select FERIADOS where Fecha = curRec.FechaR5);
    if xDate > 0 then
            let result := dialog("⚠️", " Esta Fecha es un Dia FERIADO. Procedemos ?", ["Si", "No"]);
            if result = "No" then FechaR5 := false end
        end and if FechaR5 < FechaR4 then
            let result := dialog("⚠️", " Esta FECHA menor que la anterior. Procedemos ?", ["Si", "No"]);
            if result = "No" then FechaR5 := false end
        end

    • Fred
    • 2 yrs ago
    • Reported - view
    let curRec := this;
    let xDate := cnt(select FERIADOS where Fecha = curRec.FechaR5);
    if xDate > 0 then
            let result := dialog("", " Esta Fecha es un Dia FERIADO. Procedemos ?", ["Si", "No"]);
            if result = "No" then FechaR5 := false end
        end and if FechaR5 < FechaR4 then
            let result := dialog("", " Esta FECHA menor que la anterior. Procedemos ?", ["Si", "No"]);
            if result = "No" then FechaR5 := false end
    end
    

    You have too many "ends" on line 5 and 6.

    I am unsure where the "and" on line 6 is supposed to be linked to.

      • Rafael Sanchis
      • Rafael_Sanchis
      • 2 yrs ago
      • Reported - view

      Fred 

      No,  I eliminate the end on line 6 and don't work only work for the first dialog the final 4 end is automatic place.

      let curRec := this;
      let xDate := cnt(select FERIADOS where Fecha = curRec.FechaR5);
      if xDate > 0 then
          let result := dialog("⚠️", " Esta Fecha es un Dia FERIADO. Procedemos ?", ["Si", "No"]);
          if result = "No" then
              FechaR5 := false and if FechaR5 < FechaR4 then
                          let result := dialog("⚠️", " Esta FECHA menor que la anterior. Procedemos ?", ["Si", "No"]);
                          if result = "No" then FechaR5 := false end
                      end
          end
      end

      • Rafael Sanchis
      • Rafael_Sanchis
      • 2 yrs ago
      • Reported - view

       Fred

      Now work

      if FechaR5 < FechaR4 then
              alert("Fecha Plan 5 no puede ser menor que Fecha Plan 4")
          else
              "ok"
          end and (
              let curRec := this;
              let xDate := cnt(select FERIADOS where Fecha = curRec.FechaR5);
              if xDate > 0 then
                  let result := dialog("⚠️", " Esta FECHA es un Dia FERIADO. Procedemos ?", ["Si", "No"]);
                  if result = "No" then FechaR5 := false end
              end
          )

Content aside

  • Status Answered
  • 2 yrs agoLast active
  • 4Replies
  • 50Views
  • 2 Following