• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Question about AutoValidation and Posting data

Uniphix

Active member
#1
I have a system where I have something like:

fields.name
fields.member.phone_number
fields.member.email
fields.location.city
fields.location.country

I keep getting errors like this The field 'member.email' was not recognised.

I would like to know how I can do this and do it right. The thing is that fields.name is from one DataWriter where the other two are from another two data writers. I also have some fields that are NOT part of the datawriter and are handled prior before saving such as total members and the amount which is calclated right before its saved... Well it doesn't have a field name The field 'cost_per_member' was not recognised.

Any idea on how I can do this?
 

Uniphix

Active member
#3
I am using Beta 3, but this has nothing to do with 'custom fields' this is fields that i am using for a different system :) I can start a conversation if need to be since some of this is private related.
 

Uniphix

Active member
#6
Here is a good example of the situtation I am having.

You see I have "Trip" and "Trip Locations"

Now a Trip Location has it's own DataWriter, and Trip has it's own as well, but the problem is I want to be able to validate one trip location which is added prior to creation of the first trip. Then when created they can add more trips... Now there may be a chance where I want multiple trips added at the time of creating a trip. Now I am not sure how about to do this...

I've noticed that in User there are many different list of xf_user stuff but those seem to be linked to each other and is required...

So how would I go about doing this for multiple locations and validating them???
 

xfrocks

Well-known member
#7
If your field is not in database, you should opt out it from AutoValidation.
If you still want to validate it somehow (check for locations before trip etc), you will need to do it in the DataWriter using _preSave(). You can throw an exception and user will see that as an error message.

Hope this helps.