1

I have a 2 Travel Form with Calendar view used within the company one is used by everybody and other is used by executives and the management would like to color code the Calendar to differentiate between executives and everybody else in company I have created InfoPath and have simple columns which gets the userinfo like First Name/Last Name,Title, DeptName, DeptNo, Date of Travel/Return Date, Destination, Source location and Trip(Funded/NonFunded) Visa Status for international Travel(Have Visa/No Visa)

Now business wants when a normal user submits the form it should be green in color and when executive submits the form it should be black in color.How can I accomplish this. enter image description here

By default SP 2013 its all blue in color.

2

Definitly want to use calendar overlays, another great walk through here, http://davidlozzi.com/color-code-sharepoint-calendar/ including changing the colors to match whatever scheme you want.

I think the bigger issue you're going to have will be identifying executives. From what I can see in your InfoPath form you're not specifying the executiveness of a user. You may be able to pull that from the User Profile Service, and store it as a field in the form, and then use that to create your views. Or use a separate list to list all of the executives and use a lookup to pull in their data, then create your overlays with that.

Color coding a calendar is easy, your requirement for executive or not is the though part.

2

You can create jQuery, JavaScript code to achieve this when the views are getting changed. When the executive logs in apply that listview, e.g. executiveview, based on the CategoryColumn you have created in the site / list level.

When a normal user logs in, genericview show this view based on the normal category of user. And apply the color coding JavaScript / jQuery to these views.

The colors are controlled by the css classes ms-acal-color1 to ms-acal-color9.

You can override to the style as below, then add the style into a content editor web part in the calendar view.

<style type="text/css">
    .ms-acal-color1 {
        background-color:lime !important;
     }
</style>

Below links may help:

Conclusion is to use Calendar overlay. You need to make several views for different category and give different color each view genericview for normal user and executiveview for executive user.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.