Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Trying to conditionally set view of a subgrid based on Option set on form

$
0
0

Hi I'm trying to get a subgrid on my form to change views depending on a option set selection.

I am using

function fnChangeViewOfSubgrid(ExecutionContext) {"use strict";
	var oFormContext = executionContext.getFormContext();
	var Practice = oFormContext.getAttribute("new_practices").getValue();
	var viewSelector = oFormContext.getControl("Opportunities").getViewSelector();
	if(Practice != null) {
		Switch(Practice) {
			Case 100000005: var PracticeView = {
				entityType: 1039,
				id: "4F671F67-9D35-EB11-A813-000D3A347311",
				name: "Engineering Practice - Active Opportunities"
			};
			viewSelector.setCurrentView(PracticeView);
			default: var PracticeView = {
				entityType: 1039,
				id: "00000000-0000-0000-00AA-000010003006",
				name: "Closed Opportunities"
			};
			viewSelector.setCurrentView(PracticeView);
		}
	}
}

But it isn't working.

I've tried various online javascript validators but they are saying I'm missing semicolons? But I don't see it?

Does anyone else see what I'm doing wrong or have a better way?

Thanks,

Terry


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images