- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2023 11:16 AM
I have a requirement where we don't want to convert a demand into a project unless the capital budget or operating budget has a value entered.
I've set them to mandatory via the dictionary but from what I can see it isn't pulling that setting.
It looks like both get their data from the Capex and Opex budgets.
What is the best way to check these values and ensure at least one of them is greater than the defaulted $0.00?
Figured maybe check against these values within the Create Project onClick script.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2023 08:37 AM
The two fields do exist on dmn_demand in my instance. the following script logic works in a UI Action I have defined on dmn_demand form named "Check Budget"
function checkDemandBudget() {
// var capital = parseFloat(g_form.getValue('capital_budget')); // added
// var operating = parseFloat(g_form.getValue('operational_budget')); // added
var capital = g_form.getValue('capital_budget'); // added
var operating = g_form.getValue('operational_budget'); // added
var capitalValues = capital.split(';');
var operatingValues = operating.split(';');
var capitalVal = parseFloat(capitalValues[1]);
var operatingVal = parseFloat(operatingValues[1]);
var total = capitalVal + operatingVal;
alert ("capital = " + capital + ", operating = " + operating + ", total = " + total);
}
The first two lines do not result in a number, since the two fields are defined as type: Currency.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-29-2023 12:54 PM
This did the trick, I was able to use the cap/oper values from the split array to create a check within the Create Project function.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-24-2023 03:04 AM
see if this help...
You can control the visiblity of 'Create Project' button to show only if both the fields are not empty and a ui policy to make capex and opex field mandatory wen demand is approved state.
☑️ Please mark responses as HELPFUL or ACCEPT SOLUTION to assist future users in finding the right solution....