Using JavaScript to Show/Hide multiple fields on the same form with same id name -


i have fields on same dynamics crm form. 1 account name , other field company. both share same field id name parentcustomerid. need show/hide these fields based on value of option set of field. can account name field show/hide company field not show/hide.

function showhidesourcefield() {

var type = xrm.page.data.entity.attributes.get("new_type").getvalue(); var source = xrm.page.ui.controls.get("new_source"); var accountname = xrm.page.ui.controls.get("parentcustomerid"); var company = xrm.page.ui.controls.get("parentcustomerid");  //type of contact unaffiliated if (type == 100000004) {      source.setvisible(true);     accountname.setvisible(false);     company.setvisible(false); 

you have 2 possibilities:

1) 2 different fields, , can check in form editor, example 1 name other parentcustomerid

2) same field added twice form, possible inside dynamics crm, in case first field parentcustomerid second parentcustomerid1, , can still check if same field inside form editor.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -