Adding custom fields to RadScheduler Appointments - telerik-scheduler

I have a RadScheduler. It is now displaying all appointments in the database. I need to display only current loggedin customer's appointment details. I got a field in my database for the customerId. How i will add it to the Appointments in RadScheduler.
Many Thanks

Imo the RadScheduler itself is architectural not the right place to filter your appointments. Rather filter your bound DataSource for the correct appointments. Easy one with Linq, could be something like datasource.all(appointment => appointment.customerId == context.loginId)

Related

Add a sub grid and view for field update

I have added a field to the Contact entity called Website Downloads. This field is updated every time a client clicks on our website but what I want to do is have a sub grid within the Contact form that shows what this entry is each time it's updated. Then I ideally need this in a view with the contacts name and a list of the downloads so I can do an advanced find on the field. Any ideas please. PS I have tried to add a new entity that links to this field but the problem is you cannot do an OR on an Advanced find for 2 separate entities so back to square one.
Already tried a new entity but this won't work as you cannot do an OR on an Advanced Find for 2 entities.
I think you are on right track. You need a related entity to capture all the website hits, then you need a rollup field on contact record to sum up the hits.
So the associated records can be listed in a subgrid on contact form, also Advanced find queries can be done.
Rollup field can be an OOB field but it has timely job to calculate, if you want immediate rollup result it can be a custom field & plugin to accumulate.

Dynamic parameters for views in Dynamics 365

I have a Account Relationship entity with two lookup fields called Recipient Account and Guide Account. I would like to be able to go on an Account and see all records where the Account Relationship's Recipient Account and Guide Account are set to the account I'm viewing.
In CRM, I can definitely create a view to fetch all account relationships on the Account Relationship entity and then inside the Account entity's form I can include the view with the data source set to Related Records Only and the entity set to Account Relationship (Recipient Account). But I can't do both in a single view.
Through what mechanism can I have it all be in one view? One thing I was considering was creating separate grids, one for Recipient Account and another for Guide Account. But I want to know if there is a mechanism where I can combine all records that have "Recipient Account = Current Account or Guide Account = Current Account" that is basically the query I want to run.
You could use connections. It's pretty flexible and will fulfill your needs as long they stay simple. That's the only viable option I see aside from using two views.
Keep only one subgrid of Account Relationship N:N intersect entity (either Guide account or Recipient account relation)
Register RetrieveMultiple pre-operation plugin to intercept the query & pass the custom fetchxml query by incorporating or filter
Fetchxml has to be built something like explained
Try this unrecommended if you wish but two grids are better choice. This alternate solution also you can try.

MS CRM Online Custom View - Need to show specific records in View for specific users (based on team)

I have entity "Work Order" for which I have defined many custom views. Work Orders can have records with statuses as "active ,cancelled, closed, inprogress, submitted" etc. My requirement is - currently logged in user who belongs to a specific team "sales representative" should be able to see all records on view.This can be done easily, but If current logged in user does not belongs to "sales representative" team, she should not be able to see "cancelled" records on view but all other record should be visible to her. How can I achieve this using custom filters if it is possible? Or by code changes?
It is possible to do this with custom code. Without questioning the "why" you'd like to do this (possibly it's sensitive information or something?), you can achieve it using a RetrieveMultiple plugin registered on the pre-operation event. Within this plugin one of the input parameters passed in is called "Query" and will have a QueryExpression. You can simply add a filter to this query in the plugin and the relevant rows will be filtered out. Something like this:
var query = (QueryExpression)context.InputParameters["Query"];
var condition= new ConditionExpression()
{
AttributeName = "statuscode",
Operator = ConditionOperator.NotIn,
Values = { 2, 3 } // Or whatever codes you want to filter!
};
query.Criteria.AddCondition(condition);
To check the current user you can grab the user id from the plugin context and retrieve the necessary info you would like to check.
Doesn't sound like this is possible with advanced find alright. You may be able to achieve it using security roles though. If you could assign cancelled work orders to a specific team, and then organise your security setup so that users who are not sales representatives can't see work orders from that specific team, then it might work. Unfortunately you would have to reassign the cancelled work orders which is not always an option.
Otherwise, you might have to go with a separate view for cancelled work orders, out of the box advanced find should allow you present a blank grid of you are not on the right team. But now obviously you are not presenting a whole view of the work orders.
In general I would go with the security option, and just make it work. Any other option is just a stop-gap. Users can always create custom views, so if you don't lock down access using security roles, the data is still accessible in indirect ways.

How to show records related to upper records too in a subgrid?

How can I build a subgrid that displays related records both of the current record and records above it, and can it contain complex conditions ?
One of my requirements is this:
I want to put a subgrid in Account form showing the related Contacts of the current Account, and also include the Contacts related to Accounts above the current one if a Two Options attribute of the contact is set to Yes.
Specifically, I'm looking at the Company Name on Contact to establish it's related to an Account.
I'm at a loss and start to doubt it's doable.
Not an out of the box solution but if you don’t mind losing the sub grid command bar functionality you can use the following concept that displays a fetchxml inside a sub-grid.
Step 1 - would be to get all related accounts ids using a fetch or odata
Step 2 - construct a fetchxml with OR filter to get all contacts

Product slug not working in CRM 2013 Email templates

I have a business requirement that execs are really wanting to see. In our lead and email templates we have a few of our products listed. The products themselves are pretty stable but the prices are of course subject to change.
I'm OK with hard coding the product name into email but I was hoping the price could be a slug that get's resolved.
We only have one price list so nothing to worry about there.
I see no way to get access to the product and or price list entities through the data field values dialog.
So my thought was to create the 2-4 fields in the lead and opportunity entities. Then create a background workflow that takes the price from the price list and sets those fields.
Then when an email is generated I can access those hidden fields as they will be available through the lead or opportunity entity.
Any thoughts, concerns, better approaches?
Unfortunately CRM's email template system is not capable of what you describe out of the box. As you have discovered it will only permit you to insert placeholders from, or assocated with, the primary entity. It won't let you insert fields from other entities. What you suggest as a workaround is possible but it's not an ideal solution as you'll have these 2-4 redundant fields on each record type that contain duplicated data from the price list.
If you have any experience with creating custom workflow activities using the SDK then the best solution here is to create a custom activity that accepts either an draft Email or Email template as a input parameter, instantiates the email if required, loads the price list data, and performs your own custom placeholder replacements.
I've done this on a few projects in order to pass multiple entity records into the template, or to insert complex tables into emails by loading data from relationships. See the screenshots below for an example of how I've configured the email template and dialog process to pass both an 'Account' and 'User' record into the email template.

Resources