- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2018 05:21 AM
Is it possible to change a Field Type from Decimal to Integer? It does not appear to be a choice when I click on the magnifying glass next to the Type for an existing "decimal" field.
thanks,
Richelle
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2018 05:30 AM
Hi Richelle,
No, you can;t change the Field Type from Decimal to Integer it will through an error

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-21-2018 07:06 AM
Thanks for sharing. I'm a bit confused because the BR is running on demand task which means it's going to trigger when task records are updated (which is typically correct) and your query looks right, but you are updating "current" which is the task record that's updated. Ouch, you just wiped out it's individual contribution number and replaced it with the sum of all individual tasks, making your new total wrong, and not on the parent record.
First, make sure this is an AFTER/UPDATE BR. Rule #1 - don't use "current.update()" in a BR. If you are, then you need to rethink your strategy. You don't need them. This is documented in our technical best practices on the developer site.
Inside the "if", you need something more like this... I'm going to use u_demand as the parent table as I don't know the real parent table name.
if (additional.next()) {
var dmn = new GlideRecord('u_demand');
if (dmn.get(current.parent)) {
dmn.u_count = additional.getAggregate('SUM');
dmn.update();
}
}