January 31, 200719 yr Hello cannot get my head around this i want to search all my invoices and if the balance is <0.10 set the invoice state to "paid" i think my script is correct but alas it is not working. here is what i have.. and is this the best way to do this, the script willl load on log in and logout... thanks
January 31, 200719 yr Hi Robert my answer was about the calc into the If [ ] step... but, reading your post carefully, that script can't do what you wish without a Loop on all records. BTW: why not use a calculation field for Status with: Case( Balance.c < 0.10 ; "paid" ; ... ... )
February 1, 200719 yr Author that is a much better soulution here is what i used. Case(Balance.c < 10000 ; "paid" ;TextColor ( Status ; RGB ( 0 ;255 ; 0 ) ) ; Status = "sent in post"; TextColor ( Status ; RGB ( 0 ; 0 ; 255 ) ) ; TextColor ( Status ; RGB ( 0 ; 0 ; 0 ) ) ) i changed the calc to 10000 just to test and all works apart from the text color is now not changing can you please tell me, have i missed some syntax to make this work. the reason i used a script is because i did not have the confidence to change it from text to calc field thanks i have learnt a lot today.. :smile2: Edited February 1, 200719 yr by Guest
February 1, 200719 yr Try this: Case( Balance.c < 10000 ;TextColor ( "paid" ; RGB ( 0 ;255 ; 0 ) ) ; Status = "sent in post"; TextColor ( Status ; RGB ( 0 ; 0 ; 255 ) ) ; TextColor ( Status ; RGB ( 0 ; 0 ; 0 ) ) )
February 1, 200719 yr Author ahhh i see thanks again Case( Balance.c < 100;TextColor ( "paid" ; RGB ( 0 ;255 ; 0 ) )) & Case( Balance.c > 100;TextColor ( "Sent in Post" ; RGB ( 0 ; 0 ; 255 ) )) Edited February 1, 200719 yr by Guest figured it all out thanks
February 1, 200719 yr B) Didn't Status contain paid or Sent in post ?? Why IF balance.c > 100 = Sent in post ?? What IF balance.c = 100 ?? BTW: it is better to write your calc so: Case( Balance.c < 100 ; TextColor ( "paid" ; RGB ( 0 ;255 ; 0 ) ) Balance.c > 100 ; TextColor ( "Sent in Post" ; RGB ( 0 ; 0 ; 255 ) ) )
February 1, 200719 yr Author Didn't Status contain paid or Sent in post ?? Why IF balance.c > 100 = Sent in post ?? What IF balance.c = 100 ?? BTW: it is better to write your calc so: Case( Balance.c < 100 ; TextColor ( "paid" ; RGB ( 0 ;255 ; 0 ) ) Balance.c > 100 ; TextColor ( "Sent in Post" ; RGB ( 0 ; 0 ; 255 ) ) ) thanks i have now added the equal sign. Case( Balance.c < 100;TextColor ( "Paid" ; RGB ( 0 ;255 ; 0 ) )) & Case( Balance.c >= 100;TextColor ( "Sent in Post" ; RGB ( 0 ; 0 ; 255 ) )) ---------- if i use your statement i get an error, a operator is expected here + - * / and it does not work, i tried messing but could not get it to validate. Why IF balance.c > 100 = Sent in post ? the job automatically creates the invoice and is printed also all invoices that are created are always in $ never any cents. thanks for showing me i am using the example 100, i will change this to .1 in the future..
February 1, 200719 yr if i use your statement i get an error, a operator is expected here + - * / and it does not work, i tried messing but could not get it to validate. There was a typo. Daniele overlooked a semicolon. Case( Balance.c < 100 ; TextColor ( "paid" ; RGB ( 0 ;255 ; 0 ) )[color:red]; Balance.c > 100 ; TextColor ( "Sent in Post" ; RGB ( 0 ; 0 ; 255 ) ) )
February 1, 200719 yr Author Thanks John, and Daniele for your time this calc has saved me and others lots of time......
Create an account or sign in to comment