Set defaults for Close Demand and Project calculation fields

MBarrott
Mega Sage

I've recently set the Category and Type fields to a Dropdown with -- None --. 

 

Although this is working, I'm running into issues with the Preferences tab. Previously, both Close Demand and Project calculation were defaulted to 'On creation of project' and 'Automatic' respectively. 

 

Since introducing the Dropdown with -- None -- I have noticed these are both empty. This causes the "Please select a project calculation type under preferences." error to occur unless manually changed. 

 

From what I could see this was tied to the DemandUtil script but I'm having difficulty having this default or ideally, automatically update once an option has been selected from the Category and Type drop down menus. 

 

Is at all possible? I can only think of many setting a blanket default value within the respective dictionaries. 

 

I amended the getCloseDemandOption and getProjectCalculationDefault functions but saw no improvement. The values came through with simple lowercase text and no dropdown options. 

 

/*DemandUtil.getCloseDemandOption = function(current){ // original
	if (JSUtil.nil(current.type))
		return 'on_creating_project';
};*/

DemandUtil.getCloseDemandOption = function(current){
		return 'on_creating_project';
};

DemandUtil.getProjectCalculationDefault = function(current){
	if (current.type == 'project' || current.type == '') // added OR condition
		return 'automatic';
};

 

0 REPLIES 0