How to sum scheduled work hours for a user? - dynamics-crm-2013

I wonder if it's possible to sum up a user's scheduled work hours?
I have customized the user entity and added a field that I want to show the user's total defined work hours in for the current week. But I don't know how to access the entity containing work hours. The problem is that I'm in an online organization and I can't access the database.
I've tried downloading SDK and of course googling. Since I'm a beginner I haven't found anything useful.

I've found an example for selecting time spans of working hours of a certain user. It's found in the SDK but, given that the example is written as a console application in C#, it might be perceived as complicated an unnecessarily complicated.
Also, it's mentioned that there's a field on the user entity, I assume that for this particular task, JavaScript might be more suitable and such an example I haven't seen.
This page presenting the source code is on MSDN. The bottom line is that you create a service and then execute the below.
QueryScheduleRequest scheduleRequest = new QueryScheduleRequest
{
ResourceId = GetRegardedUserId(),
Start = DateTime.Now,
End = DateTime.Today.AddDays(14),
TimeCodes = new TimeCode[] { TimeCode.Available }
};
QueryScheduleResponse scheduleResponse
= (QueryScheduleResponse)_serviceProxy.Execute(scheduleRequest);
For more information on how to handle the requests to scheduling and working hours see this article and for service appointments look over here.

Related

JQL query that shows the tasks which have new comments on them

I work for a university and my group uses JIRA to maintain our technology helpdesk. We often send messages to customers and wait days to hear a response. I am looking for a filter that will show all the open tasks which are assigned to me and have a new comment from someone other than me. This way I don't have to look through all of my tasks, I can easily tell from this filter, whether any of my tickets now require a response from me.
So far I have this search:
assignee = currentUser() AND status != Done AND
updatedDate > startOfDay(-1d) AND updatedDate < endOfDay(-0d)
It doesn't look like Jira provides a way to access number of comments, last comment date, etc. The closest thing I could find in their reference was Comment which only checks the text of a comment.
Possible Alternatives
Add yourself as a watcher of the Jira issues and setup email notifications. This is what I do to manage my Jira issues. I setup a Jira folder in my email and an automated filter to move all Jira notifications into it. Then I just look through that folder multiple times per day. The downside is you'll keep more notifications than you actually need or care about.
Use Jira's REST API. If you or someone at your school has some programming knowledge, you could probably use the Jira API. Potential solution:
Use the search endpoint to get a list of issues. You can pass JQL to the API to filter the issues.
Use the get issue endpoint to get the details of each issue returned from the search. Within those details are all the comments on the issue, including the time the comment was posted.

Writing Rules both in Firebase and in your Code

Firebase suggests we write security rules in both our firebase rules section online at their console for (database/storage) in addition to the rules that we have in our code (swift/java, etc). Why is this? I feel like this would be repetitive?
This is very common in a client-server architecture.
The server must validate the data to ensure that no invalid/corrupt data every gets written to the database.
The client should validate the data to give the user the best experience.
Think of an example here: say that you have a travel site where the user selects the start and end date of their journey. A common validation will be that the end date cannot be before the start date. In Firebase database security rules this could be:
{
"journeys": {
".validate": "newData.child('startAt').val() > now &&
newData.child('endAt').val() > newData.child('startAt').val()"
}
}
We did an extra check here, you can also not book travel before now. This is much simplified, but hopefully illustrates the server-side aspect.
On the client-side you'll typically show a calendar. When the user opens that calendar, you want to ensure they can't select dates before today. You'll also want to ensure that the end date can only be after the start date. If you've ever used a travel site where this last bit wasn't implemented, you'll know how annoying it it. Annoyed users go to other sites.

Xcode 6: parse online calendar

I am currently creating an app, in which the user is able to book devices (which are provided by a json file) for a certain time period (start date - end date). I was planning to use a online calendar, such as http://30boxes.com/welcome.php to check if the requested device is currently in use by another user at this period of time.
What might be the best strategy to parse that online calendar?
just noticed this website has an API, which makes it super-easy to set and get the calendar data. I feel stupid right now: http://30boxes.com/api/

Trac plugin to send email number of new and closed tickets and their details based on define schedule

I am looking for a way or a plugin so that trac sends me email about the number of new or closed tickets (and some information about these tickets also ) for a specific duration lets say for the last three days.
Basically I need to know how many tickets have been created in last week and how many of them have been closed at the end of week.
Of course the email only should be sent to the admin and not to all the users.
For additional Trac funcionality we have Trac plugins, yes. And the first place to look for them is trac-hacks.org .
The excellent TagsPlugin in use overthere already delivers some hints on resources tagged with notification or notifications. The most comprehensive and mature solution is certainly TracAnnouncer with a just reworked configuration interface providing a highly sophisticated opt-in and opt-out subscription system. Unfortunately digest notification are not integrated today.
Still there are other plugins, that fill in the gap, i.e. check the XMailPlugin. It claims to do configurable instant, daily and weekly notifications, so this may be for you. Since this is a relativly new plugin, you should expect some pending issues, but the author might be very open to your suggestion. If you're becoming a heavy user giving valuable test feedback and a bit lucky too, asking kindly could be enought to make things happen.
There's a slightly different way to solve this problem that doesn't require any plugins. First, create a custom "timeline" view that displays the information that you want. In your example, this would be all "opened and closed tickets" starting from "today" and going back three days. When viewing this custom view, you should see a link at the bottom of the page that says "RSS Feed" (on my system, the resulting URL looks something like this: http://myserver/timeline?ticket=on&max=50&authors=&daysback=3&format=rss). Click on this link to subscribe to the feed using your web browser, email client, or other program capable of reading feeds. Now, you can view the results live at any time. What you can do at this point is only limited by the capabilities of your feed reader app, but most can at least be configured to notify you when the feed is updated.

How to decide whether to split up a VB.Net application and, if so, how to split it up?

I have 2 1/2 years experience of VB.Net, mostly self taught, so please bear with me if I seem rather noobish still and do not know some of the basics. I would recommend you grab a cup of tea before starting on this, as it appears to have got quite long...
I currently have a rather large application (VB.Net website) of over 15000 lines of code at the last count. It does not do retail or anything particularly complex like that - it is literally just a wholesale viewing website with admin frontend, catalogue / catalogue management system and pageview system.
I don't really know much about how .Net applications work in the background - whether they are all loaded on the same thread or if each has its own thread... I just know how to code them, or at least like to think I do... :-)
Basically my application is set up as follows:
There are two different areas - the customer area and the administration frontend.
The main part of the customer frontend is the Catalogue. The MasterPage will load a list of products but that's all, and this is common to all the customer frontend pages.
I tend to work on only one or several parts of the application at a time before uploading the changes. So, for example, I may alter the hierarchy of the Catalogue and change the Catalogue page to match the hierarchy change whilst leaving everything else alone.
The pageview database is getting really quite large and so it is getting rather slow when the application is first requested due to the way it works.
The application timeout is set to 5 minutes - don't know how to change it, I have even tried asking this question on here and seem to remember the solution was quite complex and I was recommended not to change it, but if a customer requests the application 5 minutes after the last page view then it will reload the application from scratch. This means there is a very slow page load whenever it exceeds 5 minutes of inactivity.
I am not sure if this needs consideration to determine how best to split the application up, if at all, but each part of the catalogue system is set up as follows:
A Manager class at the top level, which is used by the admin frontend to add, edit and remove items of the specified type and the customer frontend to retrieve a list of items of the specified type. For example the "RangeManager" will contain a list of product "Ranges" and will be used to interact with these from the customer frontend.
An Item class, for example Range, which contains a list of Attributes. For example Name, Description, Visible, Created, CreatedBy and so on. The form for adding / editing loops through these to display relevant controls for the administrator. For example a Checkbox for BooleanAttribute.
An Attribute class, which can be of type StringAttribute, BooleanAttribute, IntegerAttribute and so on. There are also custom Attributes (not just datatypes) such as RangeAttribute, UserAttribute and so on. These are given a data field which is used to get a piece of data specific to the item it is contained in when it is first requested. Basically the Item is given a DataRow which is stored and accessed by Attributes only when they are first requested.
When one item is requested from a specific manager is requested, the manager will loop through all the items in the database and create a new instance of the item class. For example when a Range is requested from the RangeManager, the RangeManager will loop through all of the DataRows in the Ranges table and create a new instance of Range for each one. As stated above it simply creates a new instance with the DataRow, rather than loading all the data into it there and then. The Attributes themselves fetch the relevant data from the DataRow as and when they're first requested.
It just seems a tad stupid, in my mind, to recompile and upload the entire application every time I fix a minor bug or a spelling mistake for a word which is in the code behind (for example if I set the text of a Label dynamically). A fix / change to the Catalogue page, the way it is now, may mean a customer trying to view the Contact page, which is in no way related to the Catalogue page apart from by having the same MasterPage, cannot do so because the DLL is being uploaded.
Basically my question is, given my current situation, how would people suggest I change the architecture of the application by way of splitting it into multiple applications? I mean would it be just customer / admin, or customer / admin and pageviews, or some other way? Or not at all? Are there any other alternatives which I have not mentioned here? Could web services come in handy here? Like split the catalogue itself into a different application and just have the masterpage for all the other pages use a web service to get the names of the products to list on the left hand side? Am I just way WAY over-complicating things? Judging by the length of this question I probably am, and it wouldn't be the first time... I have tried to keep it short, but I always fail... :-)
Many thanks in advance, and sorry if I have just totally confused you!
Regards,
Richard
15000 LOC is not really all that big.
It sounds like you are not pre-compiling your site for publishing. You may want to read this: http://msdn.microsoft.com/en-us/library/1y1404zt(v=vs.80).aspx
Recompiling and uploading the application is the best way to do it. If all you are changing is your markup, that can be uploaded individually (e.g. changing some html layout in an aspx page).
I don't know what you mean here by application timeout, but if your app domain recycles every 5 minutes, then that doesn't seem right at all. You should look into this.
Also, if you find yourself working on various different parts of the site (i.e. many different changes), but need to deploy only some items in isolation, then you should look into how you are using your source control tools (you are using one, aren't you?). Look into something like GIT and branching/merging.
Start by reading:
Application Architecture Guide