?
Solved

CRM 4 - How to change the time format from minutes to hours\days

Posted on 2009-05-13
5
Medium Priority
?
785 Views
Last Modified: 2012-05-06
Hi,
In CRM 4, you are able to create contract lines and apply allotted time purchased to them, the allotment time is in minutes, so all reports and every thing else that is linked with them is also in minutes.  Is there a way to have the display show hours+mins instead of just minutes.
0
Comment
Question by:timpoynter
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 11

Expert Comment

by:rakeshAgarwal
ID: 24383790
Hi

1. You can create two fields hrs and minutes
2. write onchange event for both the field  which will calculate values  in the  total minutes.
3. You  can change the assosciated view ( related contact lines to display hours and minutes)

4. You have to change reports manually to do this

Regards
Rakesh
0
 
LVL 6

Expert Comment

by:processguru
ID: 24434956
Are you talking about the Allotments Used and Allotments Remaining? These are the out of the box attributes, and are of type Int. Perhaps one of these attributes has been customized so that the label is Allotted time in minutes?

If it's just a matter of your reports showing hrs + minutes instead of just minutes, then I would leave the attribute alone in CRM but adjust the formatting of the attribute value in the report. You can use an expression in the report to adjust the way it is shown. For instance if your attribute were AllottedMins your expression could be:

IIF(Fields!AllottedMins.Value < 60, Fields!AllottedMins.Value + "Mins", (Fields!AllottedMins.Value / 60) + " Hrs" + MOD(Fields!AllottedMins.Value / 60) + " Mins")

This expression (check the syntax because I'm going from memory here...) would return "59 Mins" or "1 Hrs 23 Mins" for example depending on if the value is less than 60 or not...
0
 

Author Comment

by:timpoynter
ID: 24440123
Hello processguru,

Yes they are Allotments Used and Allotments Remaining, but I have checked the attributed and they are geyed out, I assume as they are system entitys they are not editable,  is that correct?

The advice for the report was very valuable, Thankyou.

0
 
LVL 6

Accepted Solution

by:
processguru earned 2000 total points
ID: 24440748
I believe once an attribute is created, you can't change the type of that attribute - since any records already created would then not be in the correct type format. This is why when you open those attributes the type is grayed out.

If you would like the CRM Form to indicate allotments in Hrs and Minutes as well as your Report, you can do as rakeshAgarwal suggested, which is create yourself two new attributes for each (used and remaining) and move the originals off to a different tab so that they are still available for scripting but not immediately visible to the user. Then you can run an onChange script for the original attributes that breaks that value out into Hrs and Mins populating your two new attributes with these values.

There are two ways you can run an onChange script for attributes:

1. In the attribute itself on the form:
Customize : Contract Line : Forms and Views : Open Form : Select attribute and click Change Properties : Events Tab : onChange

2. In the onLoad script of the form:
Customize : Contract Line : Forms and Views : Open Form : Form Properties : Events : OnLoad : Edit

I have had better luck simply putting my scripts in the onLoad of the form. Define your function, and then call it when the desired event occurs:


function OnCrmPageLoad()
{
   crmForm.all.allotmentsremaining.attachEvent( "onchange" , CalculateAllotments );
} 
 
function CalculateAllotments()
{
// add logic here to calculate values for new attributes and set their values
}

Open in new window

0
 
LVL 6

Expert Comment

by:processguru
ID: 24440776
Oh, and don't forget to call your OnCrmPagLoad() function too...
0

Featured Post

NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This is a walkthrough guide I wrote whilst upgrading my on-premise MS Dynamics CRM 3.0 deployment to 4.0. This covers the actual installation of the product to a working level for my system, I ran into a lot of issues that the steps below fixed so h…
Automatically creating a Trello card using data from a Microsoft Dynamics CRM record turned out to be an easy project that yielded great results.  Here's how I did this for an internal team at General Code.
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question