Dear folks, I've two fields in a table, field1 is an option field (and flowfield also) and field2 is a boolean field. Also there is a form on appear these fields. I'd like that when on filed1 option was, for example, "All" the field2 autofill as true. It's possible to do i?. Also I don't very clear is I've to do it on open form or in table.
Thanks for help.
0
Comments
Put this code in the AfterValidate of Field1
Hope this helps
Albert
Thanks for help.
IF F1 = F1::"All " THEN
F2 := TRUE
ELSE
F2 := FALSE;
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
The Field2 will automatically become TRUE or FALSE. You must put the coding in the form in the OnAfterValidate Triggr of Field1.
Albert
Thanks for help.
Field2 := Field1 = Field1::All;
-Mohana
http://mohana-dynamicsnav.blogspot.in/
https://www.facebook.com/MohanaDynamicsNav
Thanks for reply.
maybe put a CurrForm.UPDATE(FALSE); after the code
Albert
Edit Maybe also put the code in AfterGetCurrRecord of the form
Raja.B
Raja.B
This is validation logic, and it should be in the table's field validation code.
RIS Plus, LLC
MVP - Business Apps
When I get into the form field2 has became TRUE, that is correct, but the form has created me a new line (because it's a list form) exactly equal to the other line but with field2 on FALSE :shock: . I know it's very strange but this is that occurs. Any idea about it please?.
Thanks for help.
Why do you need this?
You can't, with this solution here, filter on the field2 because you set it to true if the flowfield (!) field1 has the option "ALL".
So on list forms, for example you must enable the flowfield field1 to set the field2 <- but this will not be transmitted to the table self, because there is no modification. You can only filter on field1. So you doesn't need a field in the table you only need a Checkbox on the form.
So the question is: Why do you need this whats the reason????
Do yourself a favor and put this validation code in the table.
RIS Plus, LLC
MVP - Business Apps
Albert
I'll try to explain because I want to do this. The reason is because in this form I put a customer and after inform serveral fields; when I don't need this customer I've created a boolean field that cancel this line and then this customer is not taken into account for other processes.
When a customer is blocked as All (in Customer table) my form don't let insert this customer. The problem is that I can insert a customer but this customer can be blocked as "All" after, then obviusly can't be taken into account for other preccess; then I need something that automatically look for is this customer is blocked and cancel field ticks automtically.
Sorry if I have not explained well.
Thanks for help.
If you want to get better at this, then listen to the people that you asking advice from. Just saying "that doesn't work" is of no help for us to figure out what you might have to do differently. Maybe you can share with us what code you are using, in which trigger, and what exactly the error message is. Those can all be clues to troubleshoot your problem.
One more time: this type of validation code should be in the table
RIS Plus, LLC
MVP - Business Apps
i am not sure if i understand exactly what you mean, but let me see if i have it straight:
you have some fields on the sales header that trigger certain downstream processes. the system will not allow a sales order to be created for a blocked customer, so your downstream processes should only be seeing customers that are not blocked. However, since you can create an order AND THEN block the customer, your downstream processes do end up seeing orders that they should not.
if this is the case, i think you should put some code in the OnValidate of the Blocked field of the customer table. this code would cycle through the sales order for this customer and change the flagging fields as necessary.
so, you would initially set these flags with code OnValidate trigger of some field in the Sales Header table, and modify them from the OnValidate of Blocked from the customer table.
Is this what you want to do?
For example - down the road - another form might be used to activate that field and if you forget to add your code - the 2nd part will not work. If for whatever reason you need to go directly to the table to make a change the 2nd part will not work. so you can put the code on the table ONCE. or remember to add the code everywhere you access that field & never make a change directly in the table.
If it's not working then your simply doing something wrong. Don't bail on it beacuse you got the form to work.
http://www.BiloBeauty.com
http://www.autismspeaks.org
Thanks for your help and time.