Simplicty and flexibility!


SetState Problems working with choice field


Started by Graham Brown
Search
You will need to Sign In to be able to add or comment on the forum!

SetState Problems working with choice field

Using SetState works perfectly using the following where the field test is a Yes/No field

if (test = Yes, SetState("Field",3),SetState("Field",0))

I can make all the 0,1,2,3 options all work in the above formular.

However if the Yes/No  test field is replaced with a multiple Choice field with a drop down box it does not work ie..#

If test has options of Rent, Deposit, Fee

if (test = Rent, SetState("Field",3),SetState("Field",0))

it does not work>

Any ideas why

 


Written by Graham Brown 17/07/13 at 17:48:28 Dataease [{8}]FIVE

Re:SetState Problems working with choice field

Download Sample


Hi again.

1. SetState switch 3 and 0 is not a pair. 0=will hide the field and 3 will enable it, but 3 will not show it.The matching pairs is 0 and 1 (Hide,show) 2 and 3 (Disable, Enable).

It is no point disabling it if it is hidden as it will be disabled by default.

2. When you use a Dropdown the value does not change until you leave the field so the trigger of the virtual field will not be fired until you leave the field. So if you want the same effect as with the Checkbox you need to use Radiobutton.

See updated sample.



Written by DataEase Tech Support 18/07/13 at 08:21:39 Dataease [{8}]FIVE

Re:Re:SetState Problems working with choice field

Thank you.

In an if statement what is the order for combining:

 If (setstate("field",0) & Set(colour( )


 


Written by Graham Brown 18/07/13 at 14:14:45 Dataease [{8}]FIVE

Re:Re:Re:SetState Problems working with choice field

The brilliance of functions is that you can call them in any way you like as long as they get triggered ;-)

Of new functions in DE8 we try to give no return (empty string) if they are made to "do a job" rather than the normal function stuff of going away do some computing and come back with a result.

We have created this new functionality "as function" when in the strictest meaning they are not as they don't make any meaning from where they are called.

However, it is the best way of sneaking in functionality anywhere.

As you will see from the samples we have loaded up here on the blog we combine them in many difference ways but "best practice" now is just to add them to stuff.

lets say we have some fields that we only want to manipulate if something happens and then we have some that will always be manipualated:

if (MyChoice=Rent,SetState("Customer",1) +SetColor("Customer","#ff0000","-1","-1")+ SetFocus("Customer"),SetState("Customer",0)) +SetLabelText("Heading","Sorry, there are no active rental customers!")+SetColor("Heading","#00ff00","#ff0000","-1")

The result of this derivation is completely meaningless, but we have got some nifty manipulation...;-)





Written by DataEase Tech Support 18/07/13 at 16:01:49 Dataease [{8}]FIVE

Re:Re:Re:SetState Problems working with choice field

Hi again Graham.

We have problems replying to your emails. We only get the following message after days of retries:

This message was created automatically by mail delivery software.

A message that you sent could not be delivered to one or more of its

recipients. This is a permanent error. The following address(es) failed:

 Graham@lane-browns.co.uk">Graham@lan[masked]

  retry timeout exceeded

------ This is a copy of the message, including all the headers. ------

------ The body of the message is 524413 characters long; only the first

------ 106496 or so are included here.



Written by DataEase Tech Support 22/07/13 at 13:20:59 Dataease [{8}]FIVE
DG3_ForumList