ID accessible from valuelist field?

A place for users and developers of the Xataface to discuss and receive support.

ID accessible from valuelist field?

Postby kedikatt » Wed Dec 28, 2011 4:41 am

I use __sql__ = "select partID, Part from parts" as a valuelist. I choose from the list in the field PART. Can I now access and use the partID of the selected Part to use as a pointer to another field in that record that I wish to update? I will use a before save action.
kedikatt
 
Posts: 18
Joined: Sun Dec 25, 2011 6:25 am

Re: ID accessible from valuelist field?

Postby Jean » Wed Dec 28, 2011 7:03 am

Kedikatt,
Please clarify your question.
Jean
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France

Re: ID accessible from valuelist field?

Postby kedikatt » Thu Dec 29, 2011 5:10 am

What I am wondering is, noticing that the sql to load the valuelist includes partID as an argument. Is partID also available to use, in for instance $record->val('partID')? Or is only the Part value returned as useable?
I have to ask instead of test it because I am not familiar enough with this application to easily write and test code to see if it is viable. Maybe it is not possible, maybe I would mess up the code, use the wrong functions, so I would not know if I could do it or not.
I think I have cobbled some code together to use it, if it is accessible.
kedikatt
 
Posts: 18
Joined: Sun Dec 25, 2011 6:25 am

Re: ID accessible from valuelist field?

Postby Jean » Thu Dec 29, 2011 5:23 am

Well, in fact in your list the id (partID) is the value and the value (partValue) is what is displayed in the list.
So the id is what is inserted into the database.
Hope this helps
Jean
Jean
 
Posts: 259
Joined: Wed Nov 07, 2007 1:30 am
Location: Pau, France


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 22 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved