cancel
Showing results for 
Search instead for 
Did you mean: 

Limit number of decimals using SFM Formula function.

Limit number of decimals using SFM Formula function.

Limit number of decimals using SFM Formula function.

We do a number of offline currency calculations using SFM Formulas and need a way to limit values to 2 decimals. This is possible in output documents using the ROUND and LNUMBER functions, but those are not yet available in SFM Formulas.

So, our work order total values sometimes have 3 decimals, even though the service report, and even the Salesforce page layout clearly only show 2 decimals. This sometimes causes discrepancies between the service report and the invoice which the customer receives.

It would be even better to control this at a Global Setting rather than having to configure each functionality separately in order to achieve consistency across the platform. We are currently on Autumn '17.

decimal​ decimal representation​ sfm formulas​ calculations​ offline​ Anita D'SouzaLisa MercerBrittany Taylor​ autumn 17​

Linking to similar 'Decimal' ideas:

What is the underlying problem do you intend to solve with this idea?
Ensure that work order total values are consistently displayed and calculated throughout the ServiceMax Platform and into our SAP ERP.
How is the problem being addressed today, if at all?
We are using the Round function in our output documents. Also we have limited the displayed values within Salesforce by making our custom field with only 2 decimal places.
Product Area?
Communities Work Order Management
What version of ServiceMax are you on?
Summer 17
12 Comments
Customer Success Team
Customer Success Team

@mmajerus6   Is this still happening in your current version?

 

@shivaranjini_g   What is the current status of this Idea?  Thanks!

Product Team
Product Team

@mmajerus6 Introducing new functions in formula designer is not is on the immediate roadmap. We will revisit this idea post GA of new designer.

Pastry Chef
Pastry Chef

Hello @shivaranjini_g. When is the GA of the new designer scheduled for?

Product Team
Product Team

@mmajerus6  New designer will be GA'ed in 19.3. Schedule yet to finalized, most probably end of the year. Upcoming 19.2 will be a beta release.

CC @Anita_Dsouza 

Line Chef
Line Chef

@mmajerus6@Anita_Dsouza  @shivaranjini_g @lisa_mercer 

Hi All, I spoke to Lisa earlier regarding a similar need to apply additional "rounding" function in SFM Formula as safety measure.  She advised that I present my observation to the group here before logging a new case.

In essence, I have a SFM formula to calculate duration based on start and end time.  The duration fields are defined as number (5,0) in SFDC so value should be rounded to a whole number in minutes.  This works well in all cases w/ exception of when the value is 55 minutes.  Never encountered anything like this before and can't seem to make any logical sense regarding such behavior.  Here's the formula but in a gist, it's simply doing a datediff of the start and end time, then converting back to minutes.  If the value is 55, then the value displayed in Output Doc and saved in SFDC is "55.00000000000001", ignoring the field definition of Number(5,0).

$F.IF( $F.AND( $F.NOTEQUAL($D.Work_Order.Shared_Departed_for_Site__c,''),$F.NOTEQUAL($D.Work_Order.Shared_Arrived_On_Site__c,'')), $F.MULTIPLY( $F.DATEDIFF( $D.Work_Order.Shared_Departed_for_Site__c,$D.Work_Order.Shared_Arrived_On_Site__c,'INDAYS') ,1440), $D.Work_Order.Shared_Travel_Time_new__c)

This is not worthy of using a life line but figure reaching out to community members may be helpful.  Thanks in advance.  BTW, we're on 17.3 using FSA 3.6.1.  The SFM Formula can be reproduced in web as well so problem is likely not isolated to FSA.

Sushi Chef
Sushi Chef

Our users have also been asking about this issue.

 

fyi @nikoruotsalaine  and @laurim 

Customer Success Team
Customer Success Team

@tony_mcdermott   FYI.

Pastry Chef
Pastry Chef

Hello @kevinyu-bsci

We had a related issue whereby the rounding was happening and looked good in the SFDC UI, but at the database level, we were passing extra digits via the integration with our ERP which caused some minor discrepancies between the Service Report delivered to the customer on-site and the invoice the customer received later on.

We realized that Salesforce enforces decimal points specified in field definitions only at the user interface (UI) level, not at the database or API level. Not sure why you're only getting this for 55 minutes... that's strange.

Customer Success Team
Customer Success Team

@kevinyu-bsci  and @mmajerus6  Shall we meet at Maximize and discuss over a snack or coffee/tea?  

Line Chef
Line Chef

@mmajerus6 @elina_ristila @lisa_mercer 

Thanks everyone for chiming in.  @mmajerus6 Great callout on how field type is only enforced at UI-level, never paid much attention till now......learning something new everyday.

As for now, applied rounding in service reports to avoid customer/business impact while the hunt continues.  Starting to see similar behavior w/ other values occasionally but 55 is the magic number 100% of time.

Love to meet everyone at Maximize.  I'm the Asian guy w/ glasses but will coordinate as the date gets closer.