- 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-22-2023 11:53 AM
is it not working?
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2023 12:13 PM
Clicking "Create Project" while both capital budget and operating budget were "$0.00" did not generate an error and moved to creating the project which should not happen.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2023 09:08 PM
Above will not work as no fields with name capital_budget and operational_budget are present on demand table.
Thanks and Regards,
Saurabh Gupta
- 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.