Announcements
Hi All,
My requiremene is i have an optionset and a lookup in header in Case.I want to filter the lookup on the basis of optionset selected.
Thanks for any help!
*This post is locked for comments
Hi,
see this
www.aayushsingh.in/.../how-to-add-custom-filter-lookup-field.html
Write JavaScript on Change event of optionset and apply fetchxml filters for lookup,
Hi Arif,
I am getting this error : "An exception System.FormatException was thrown while trying to convert input value 'Package' to attribute 'new_twg_defectcategory.new_twg_problemcategory'. Expected type of attribute value: System.Int32. Exception raised: Input string was not in a correct format." Can you tell me why its coming ?
Hi CRM Beginner,
Post your whole code, if possible so that we are able to find what is wrong?
Thanks
Regards,
AW
Thanks All for replies...I resolved it..
Could you please share your the resolution here so that it can help others?
did you solve your error? if not please share your code and tell me complete requirement.
Yes Arif , thanks for replying..I solved it. Here is my complete code -:
function filter_Lookup_Fields()
{
if (Xrm.Page.getControl('header_process_new_problemcategory') != null)
Xrm.Page.getControl('header_process_new_defectcategory').addPreSearch(addFilter);
}
function addFilter() {
var problemcategoryoptionset ;
var fetchQuery;
try {
problemcategoryoptionset = Xrm.Page.getControl('header_process_new_problemcategory').getAttribute().getValue();
if (Xrm.Page.getControl('header_process_new_problemcategory') != null && Xrm.Page.getControl('header_process_new_problemcategory').getAttribute().getValue() != null) {
fetchQuery = "<filter type='and'>" +
"<condition attribute='statecode' operator='eq' value='0' />" +
"<condition attribute='new_problemcategory' operator='eq' value='" + problemcategoryoptionset + "' />" +
"</filter>";
//add custom filter
Xrm.Page.getControl('header_process_new_defectcategory').addCustomFilter(fetchQuery);
catch (e) {
Xrm.Utility.alertDialog('addFilter Error: ' + (e.description || e.message));
header_process_new_problemcategory is lookup? what is the type of field new_problemcategory?
Both are optionset
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Jump in, show your community spirit, and win prizes!
Expanding mentorship, skilling, and AI innovation
These are the community rock stars!
Stay up to date on forum activity by subscribing.
ScottDurow 2
GJones 1