Ifelse sentence issues

Dear All,

I?m trying to create this sentence

	if({lunes}!= '0.00')
	 {
	 	sc_field_disabled("martes=true; miercoles=true; jueves=true; viernes=true; sabado=true; domingo=true");
	 }
	 elseif ({lunes}== '0.00') 
	  {
		 sc_field_disabled("martes=false; miercoles=false; jueves=false; viernes=false; sabado=false; domingo=false");
	  }	
	
             elseif ({martes}!= '0.00')
	 {
		sc_field_disabled("lunes=true; miercoles=true; jueves=true; viernes=true; sabado=true; domingo=true");
	 }
         elseif ({martes}== '0.00')  
	  {
		 sc_field_disabled("lunes=false; miercoles=false; jueves=false; viernes=false; sabado=false; domingo=false");
	  }
	
         elseif ({miercoles}!= '0.00')
	 {
		sc_field_disabled("lunes=true; martes=true; jueves=true; viernes=true; sabado=true; domingo=true");
	 }
  elseif ({miercoles}== '0.00')
	  {
		 sc_field_disabled("lunes=false; martes=false; jueves=false; viernes=false; sabado=false; domingo=false");
	  }	 

     elseif ({jueves}!= '0.00')
	 {
		sc_field_disabled("lunes=true; martes=true; miercoles=true; viernes=true; sabado=true; domingo=true");
	 }
  elseif ({jueves}== '0.00')
	  {
		 sc_field_disabled("lunes=false; martes=false; miercoles=false; viernes=false; sabado=false; domingo=false");
	  }

      elseif ({viernes}!= '0.00')
	 {
		sc_field_disabled("lunes=true; martes=true; miercoles=true; jueves=true; sabado=true; domingo=true");
	 }
  elseif ({viernes}== '0.00')
	  {
		 sc_field_disabled("lunes=false; martes=false; miercoles=false; jueves=false; sabado=false; domingo=false");
	  }

     elseif ({sabado}!= '0.00')
	{
		sc_field_disabled("lunes=true; martes=true; miercoles=true; jueves=true; viernes=true; domingo=true");
	 }
  elseif ({sabado}== '0.00')
	  {
		 sc_field_disabled("lunes=false; martes=false; miercoles=false; jueves=false; viernes=false; domingo=false");
	  }

 	elseif ({domingo}!= '0.00')
	 {
		sc_field_disabled("lunes=true; martes=true; miercoles=true; jueves=true; viernes=true; sabado=true");
	 }
  elseif ({domingo}== '0.00')
	  {
		 sc_field_disabled("lunes=false; martes=false; miercoles=false; jueves=false; viernes=false; sabado=false");
	  }

when I probe the first IF it works but the others doesn?t work.

I don?t know if I writting bad the sentence or something like that.

If anybody can help me I?d apreciate it.

Thanks in advance for your help.

Hi,
you have to check every variable/field in a separate If…else structure.

if({lunes}!= ‘0.00’)
{
sc_field_disabled(“martes=true; miercoles=true; jueves=true; viernes=true; sabado=true; domingo=true”);
}
else
{
sc_field_disabled(“martes=false; miercoles=false; jueves=false; viernes=false; sabado=false; domingo=false”);
}

if ({martes}!= ‘0.00’)
{
sc_field_disabled(“lunes=true; miercoles=true; jueves=true; viernes=true; sabado=true; domingo=true”);
}
else
{
sc_field_disabled(“lunes=false; miercoles=false; jueves=false; viernes=false; sabado=false; domingo=false”);
}

and so on.

jsb

I modified the code as you said but is weird only works for the 2 last fields

Well, since you are overwriting all your actions from the steps before it will always be {sabado} and {doming} who determine
the status of all the other fields. If you don’t want this, you have to go a different approach.

jsb

Thank you so much, I already could fix it, I created if and else for each day in different method and I applied the method for each day only