Hi Guys i have a question.
Is it possible to filter a text field based on lookup field?
Ex: when a lookup value is selected based on that a tech filed value should be populated, is it possible?
please give possible resolution.
Thank you.
*This post is locked for comments
I can suggest you to store additional information (district, sales rep, district manager, manager) on territory entity. Then you need to add Javascript function on change attribute of territory field on the form that will fetch exact territory with additional data via Web API query. After you get your territory with data you can easily populate those fields like Aric suggested in the upper post.
My favorite tool for generating Web API queries is CRM REST Builder by Jason Lattimer, so you can check it on the link:
If you need additional information about my suggestion feel free to ask.
Thank you Aric. I will try this
Should be simple enough:
Use the following to get the text value of the lookup:
function setTextFields()
{
var lookupText = getLookupName("new_lookupcontrolname");
if (lookupText != '')
{
Xrm.Page.getAttribute("new_textfieldcontrolname").setValue(lookupText);
}
}
function getLookupName(fieldName) {
var field = Xrm.Page.getAttribute(fieldName);
if (field != null) {
var fieldId = field.getValue();
if (fieldId != null)
return fieldId[0].name.toString();
else
return '';
}
}
Hope this helps.
Territory will be a Pick List. We will populate District, Sales Rep, District Manager & Manager (These columns are always disabled) based on Territory.
Yes it is possible by executing simple Javascript SDK functions. You can explain you case more in detail so maybe we can drop some code samples.
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,253 Super User 2024 Season 2
Martin Dráb 230,188 Most Valuable Professional
nmaenpaa 101,156