Can't sort queue items in CRM 2011? - dynamics-crm

I'm utterly baffled by this and I think I must be doing something wrong. Is it possible that MS actually neglected to add sorting ability to queue items? Here's my queue item view of Service Activities:
I must be missing something? How can people use queue items without sorting?

You need to add the Entered Queue column to your view (it's part of the Queue Item entity).
System views can only sort on columns on the view being shown, not on related columns. In your example above every column is part of the "Regarding" relationship, which may be a related Contact/Case/Activity/Opportunity/whatever. There's no guarantee that the regarding record even exists for each queue item, so it's not possible to sort by it.
"Entered Queue" is in the default view - just add it back and sort by that, and you'll get items added to the queue the longest time period ago float to the top of the list as you'd expect.

Related

Model-driven PowerApp: Best practice to display subgrid of records with no appropriate primary column name

Background
Each Dataverse table contains a primary name column. When displayed in a subgrid, clicking on the primary name column will navigate to the form so that the user can edit that row. Most subgrids in my application work this way.
The Problem
I have a Course form with a list of participants displayed in a subgrid. The subgrid displays each student's name (as a link) and the grade received in the course. There is no appropriate primary name column for this Participant table. To edit the participant record, the user must select the row in the subgrid, then click the subgrid's Edit button. As a result, this UI is different from all other subgrids in the application and I know that user's will click the student name to try to edit the participant record and be confused when they are presented with the student record.
Am I missing something? Is there a better way to handle this?
It's a common problem I face quite often. Here is usually what I would do.
Make sure the Primary Name Column always contains relevant information to the user to be able to quickly identify a record. Sometimes it requires copying information from one or multiple other columns into the primary column.
In your case that would probably means concatenating the student's name and grade.
How to do that?
Common to all solutions below
Use one of the following solution to copy the content of one or several fields into the primary column.
Make sure the solution you select also updates the content of the primary name column when one of the copied field is updated.
Remove or hide the primary column from the form, the name of the record will be displayed at the top of the form anyway and you probably don't want users to play with it.
Display the primary name column in every subgrid.
I would recommend not adding the fields copied into the primary column in the subgrids to avoid confusion.
Solution 1 - Classic Workflow
Create a classic workflow that runs when a record is created / updated
Pros:
Very quick to put in place
Runs synchronously (users will see the name updated in real-time)
Cons:
Not very practical if you need to add business logic (using different fields as source depending on a certain condition for example)
Solution 2 - Power Automate
Create a Flow that runs when a record is created / updated
Pros:
You can implement complex business logic in your Flow
Cons:
Runs asynchronously (users will have to refresh the page after the creation of a record to see the record's name)
According to Power Automate licensing that flow would certainly be considered as an "enterprise flow" and you are supposed to pay 100$ / month. That specific point must be taken with a grain of salt. I had several discussions with Microsoft about it and they haven't given me a clear answer about what would be considered an enterprise flow.
Solution 3 - Plugin
Create a plugin that executes when a record is created / updated
Pros:
You can implement very complex business logic in your Flow
It can run synchronously
Cons:
Pro-code (I put it as a con since Model-Driven App is a low-code / no-code approach but there is nothing wrong about pro-code per say)
Developing a new plugin for each entity where you need this logic is kind of overkill in my opinion. I would consider developing something very generic that would only require some sort of configuration when the logic needs to be applied to a new table.

Add New Opportunity from Account subgrid auto-fills every single Account lookup on Opportunity

Title basically sums it up.
I have an Account screen, with a sub-grid of Opportunities (by the "parentaccountid" field of Opportunity). When I click + Add New on that Opportunity grid, it autofills parentaccountid on the new record form. That's normal.
BUT I also have 5 other Lookups to Account on Opportunity, with different/specific meanings. What's weird is that it's setting ALL of those Lookups to the Account record I started at (Account record that had the Opportunity subgrid where I clicked +).
Is this expected behavior?
Anyway to change this?
I'd expect CRM to only autofill the field that defines the association for that subgrid (i.e. only auto-fill parentaccountid in this case, leave the other 5 Account lookups blank)
I never experienced this, but I believe this is due to some OOB relationship mapping according to a community thread. Read more
Try to find the mapping under N:1 relationships, and if possible remove the mappings. Otherwise you may need to use the Business rule, script or plugin to remove the auto-mapped values.
Edit:
This explanation makes sense and it is expected behavior as per product deisgn.
Since there is an out of the box parental relationship (opportunity_customer_accounts), all those additional account lookups are automatically mapped to that same "parent" (accountid field), and, since they have already been mapped automatically, you can't map them to another field

Redis data structure design for inbox

My website allows users to communicate using conversations.
In the conversation-inbox page a user can see all the users that have contacted him, including a preview of the latest message from the specific user. The page is order by the date of the previewed message.
It looks roughly something like this:
UserA "Some message.." 2016-3-3
UserB "Other message.." 2016-3-2
UserC "..." 2016-2-15
etc..
I was wondering what is the correct combination of the Redis data structures to use to model this efficiently.
At first I thought about having a sorted set of the users (i.e. UserA, UserB, UserC), but this would mean I would have to have a loop to get the latest message from each user.
Is there a better way, avoiding the loop?
Thanks!
You'll need two data structures for each user's inbox: a Hash and a Sorted Set.
The Sorted Set's scores can be all set to 0 as we'll be using lexicographical ordering anyway (but there's no harm in setting them to the actual timestamp of the message, at least in the context of this answer). The members of the Sorted Set should be constructed in the following manner:
<date in YYYYMMDD>:<from user>:<message>
This will let you easily pull that view and page through it with ZREVRANGE.
But that's only half of the story - when userX is sent a new message from userA, you'll need some way of finding and removing userA's previous message from userX's inbox - that's why you need the Hash.
The Hash is used for looking up the latest message from a given user to userX. For each of userX's friends, keep in the Hash a field that is the sending user's ID (e.g. userA) and whose value is the inbox's Sorted Set member that represents the latest message from that user (same "syntax" as above). When a new message arrives, first fetch the previous message from the Hash, remove it from the Set, and then add the new message to the Set and update the Hash's field.
To make sure that Hash and Sorted Set are consistent, I recommend that you look into wrapping them together in a transaction. You can use a MULTI/EXEC block, but my preference is a Lua script.

RethinkDb changefeeds not working when including `.pluck`

I have a changefeed that works fine until I use the pluck() projection. If I use pluck, it doesn't pick up changes form inserts and deletes in my followers embedded collection.
r.table('users')
.getAll(name, {index: 'followers'})
//.without('password', 'phone')
.pluck('name', 'online') // using pluck doesn't pick up changes in insert/delete from followers
.changes({includeInitial:true});
I could use the without command but that seems more error prone as I would have to keep updating that list anytime I added fields to the user object.
Updates to user's online property gets picked up in the changefeed in either scenario.
Why does pluck not show changes to the followers set/collection property?
I'm not 100% sure, but I think this is because when you add the .pluck('name', 'online') to the end, and then you update the followers array, the changefeed logic applies the pluck and then compares the old value to the new value, and since neither of the plucked fields changed it decides that it's a "trivial" change and drops it. (In general ignoring trivial changes is what you want, since one of the main goals of .pluck.changes is to only be notified when the specified fields change.)
I think this probably isn't the desired behavior, though: it's probably more useful to only drop trivial changes if they don't cause the row to enter or exit the subscribed range. I opened https://github.com/rethinkdb/rethinkdb/issues/5205 to track that change.
This isn't supported right now. Check this ticket and this.

Square-Connect Item or Variation id(s) already exist

I was messing around with the Square Connect API, and after uploading some items and finding out they had incorrect pricing (I was sending the amount in dollars, not cents) I decided to delete all of the items and start over. I am passing in item ids so that I can cross reference the items with our in-house database. Unfortunately, it appears that after I've deleted an item, I can't recreate it with the same old id. How can I fix this?
Unfortunately, item and variation IDs can never be reused for a given merchant. I will update the documentation to better clarify this limitation.
As a couple of potential solutions for your issue:
You could recreate your item library with item IDs that all have the same prefix, followed by the corresponding ID in your in-house database. Then prepend or remove the prefix when translating between IDs in your two systems. Of course, this solution is still susceptible to the same root issue, so you'd have to make sure not to delete any items.
Store the ID mapping in the user_data field of your item variations. You can set the user_data field with the Update Variation endpoint.

Resources