You need to sign in to do that
Don't have an account?
johncusackjr
Input Field for Queries
Hi,
I'm trying to implement a custom search screen for a custom object based on fields.
And i'm planning to use inputField to get the field query. inputField should display correct widget based on the type (if it's date, date picker, if a user lookup user selector etc.) But it does not display anything for read only fields (like Last Modified Date etc.). What might be the reason and also how can I implement this?
Thanks,
John
Hi,
I didn't mean that you have to create any new fields, but to just 'borrow' the field from other object (or any unused field of same type in the same object)
Eg. I use the StartDateTime field from Event object so the VF page will generate a corresponding date time widget.
-Hengky-
All Answers
Hi,
The obvious reason is because it's a read only field.
Workaround is to use another date/datetime field in your custom object (or any object that have the same custom field type) for the page to generate the corresponding widget, and then just 'map' the inputted value to the Last Modified Date field in the query.
-Hengky-
Thanks but this does not solve the issue. Because customer will be allowed to add custom fields and search based on those also. And those fields might be read only also and managing and filtering those newly created fields is another headache. So, creating widgets by ourselves is the only way for now.
John
Hi,
I didn't mean that you have to create any new fields, but to just 'borrow' the field from other object (or any unused field of same type in the same object)
Eg. I use the StartDateTime field from Event object so the VF page will generate a corresponding date time widget.
-Hengky-
You might be interested in looking at the code for the component that I created that does a similar task. I have added pick list and look-up support but haven't added support for a date picker yet.
However, you can pass in an object and it will dynamically display all filterable fields with appropriate options. Much like the list view filter screen or the report filter screen.
The blog post can be found here and has a link to the code which is on git hub.
Thanks for the information. This will be very useful but datepicker is also important. Actually Salesforce should have a new component like inputField that supports searching/filtering via it.
John