In the context where we have Projects that contain Tasks (two Apps), which one is better and why?
In the Projects App, add a relation field to its children Tasks.
In the Tasks App, add a relation field to its parent Projet.
On the Podio API POV, you would get the field values (1) or the referenced items (2).
I would add the relation field to Tasks for the simple reason that you can then create the relation when you create each task. Otherwise you have to go back and edit the project every time you want to create a new task.
Related
I'm using the WorkFront / AtTask API and when looking up Tasks, I'd like to filter them down to the Projects that contain specific Roles.
using /TASK/search/?fields=project:roles it will show me the Roles, but then I'm not sure how to filter on those.
Accessing a tertiary object directly (fails)
I tried /TASK/search/?project:roles:ID=aaaaaaa but the API returns (422) Unprocessable Entity.
Access from the parent object (works)
task -> project -> /PROJ/search/?roles:ID=aaaaaaa works, but involves sub-queries to the API that are costly and slow.
Access from secondary object's ID fields (works)
/TASK/search/?project:ownerID=bbbbbbb since it references a field of a secondary object and not yet another object. But I've only been able to make this work with single-instance references and don't know how to access the ID fields of collections without referencing them as objects.
So how could I filter or access down to a secondary object's collection? I can view them in a single API query, but can't seem to filter.
Task > It's Project > filter by Role
This functionality is not available in Workfront, neither through the API nor through built-in tools like Reports. This is due to a constraint on the database side of things. After seeing this question I spoke with my enterprise support team at Workfront and received confirmation of this from the DBAs.
The solution that you provided is the best you can do - split this query into the front and back half of your parameters and filter results within your code.
The best solution I can think of thus far is:
Pull the list of acceptable projects based on role.
/PROJ/search/?roles:ID=aaaaaa&...
Save the list of projects in memory
Pull the list of Tasks in question
/TASK/search/?...
Remove the tasks that don't have a project ID from step 2
This way it's only 2 queries and the project query should have a minimal impact in terms of size and number of entries.
I currently have a view on the Queue entity, that includes a Category attribute for an Email, Phone Call, and Appointment:
The Category attribute in all entities is a lookup to the same Category Entity Type.
I want to be able to combine them all in a single column on the view:
The current only way I can think of, is to create a dummy Category Field on the Queue, and write a plugin to sync it with the category of the activity, or write a plugin on the retrieve multiple that hydrates the column. Are there any other possibilities? Also, the business is asking to do this in lots of different situations, so if there is a more "meta" way of handling it, that would be great to.
This is an IFD CRM if it matters.
The documentation for the Dynamics security model (msdn.microsoft.com/.../gg334673.aspx & msdn.microsoft.com/.../gg328567.aspx) states that in order to relate two records together a user needs Append To and Read privileges on the parent Entity and Append and Read permission on the child Entity.
In practice it seems like a Dynamics CRM 2013 subgrid will not let a user relate records unless they also have at least user level Create privileges on the child Entity. Using the Dynamics SDK to relate two records together works as expected, however when in the Dynamics UI, clicking on the '+' button to begin in a subgrid to relate two records together does nothing unless the user has Create privileges.
Curiously I've also noticed that while clicking on the '+' button does nothing, if I refresh the page afterwards I always get one of those "Dynamics has encountered an error" popups, perhaps this is a bug with Dynamics?
At any rate this is a pretty breaking problem for us as we have plenty of “reference data” Entities in an N:N relationship that users should be able to relate existing records with, but not create new records.
Is anyone else aware of this problem? Is there some kind of workaround or setting that I'm missing?
(Link to issue on Dynamics CRM forums: https://community.dynamics.com/crm/f/117/t/119729.aspx)
When you click on the "+" on the sub-grid your sub-grid may create a new record or may give you an option to associate a record, depending on how your child entity is configured. For completeness, I'll detail how to either get the option to associate or to create a new record.
To Give an Option to Associate
On the child (e.g. Contact) The look-up to the parent record (e.g Account) cannot be required. If the look-up is required CRM will automatically create a new form (Contact in this example) and pop it into a new tab/window. If this is your issue and you need the look-up to the parent to be required, you may want to make the look-up to the parent non-required and then require the field using on-load javascript.
To Create New Record & Pop into new Tab / Window
Require the look-up to the parent on the child account, or;
Hide the "Add Existing" button on the child record using your ribbon editor of choice
I raised this issue with Microsoft and they have formally recognized it as a bug. The fix is due to be released in Update Rollup 2.
It's a known bug and already fixed in update rollup 2
So in my app I have an Entity called Cards and another called Transactions.
The Transaction entity have the attributes: Date, Location and Amount. So if a user spends his money in 10 locations, I need to have 10 entries in the Transactions for a single card.
I just started working with Core Data and it's getting messy.
I also use MagicalRecord to work with Core Data.
I was able to CRUD the cards entity, adding, updating etc... is all good.
The thing is, I need to add the transactions to a card and don't know how to start with this relationship. How to add transactions to the card and then fetch the card with all the transactions?
Any insight would be much appreciated.
If I understood you right, then you establish a relation between them.
Card -> Transaction is a To-Many relation. See the right hand pane in xcode for this option.
Add an inverse. Always add an inverse. So you have a not To-Many relation
Transaction -> Card
Right? There is only one card for each transaction?
The rest of the answer depends on how you access the data. I suggest to create a model class for each entity. You know how? Click on the entity then go to file/new/file, select core data then NSManagedObjectSubclass and it will be created for you. This class has methods for adding related items.
myTransaction.card = myCard;
respectively
[myCard addTransactionsObject:myTransaction];
Assuming of course that myCard and myTransaction are the classes and that your to-one relation is named card and the to-many relation is named transactions.
Just set a one-to-many relationship from Card to Transaction Entity, and then simply get all of your (previously added by [card addTransactionsObject:newTransaction] call) transactions using that relation: card.transactions.
Don't forget to add an inverse relation fromTransaction to Card!
So I'm using Core Data in an existing iPhone app, and I've set up two entities: Person and Item. The root view of my app's navigation (currently) shows a list of people, and you drill down from there to items. In short, the hierarchy looks like this:
Person -> Item
I want to add a new entity above Person in the hierarchy, called List:
List -> Person -> Item
Additionally, I want the user's first List to be created for them on startup, and for any People the user's already added to be assigned to that list.
I'm familiar with Core Data's lightweight migration & versioning feature, so I think I know how to add the new entity and relationship, but I'm not sure how to:
Create a List record on app start if they've never had the Lists feature before
Set all existing People records to belong to that new list.
One quick and dirty way would be to add some code to my app delegate's applicationDidFinishLaunching method that performs the migration by (1) checking to see if there are any Lists, (2) if not, creating the default one, (3) fetching all existing People from my data store, (4) setting each Person's list attribute to the newly created default list, and finally (5) saving those changes.
My question is: is there any faster or easier way to do all of that?
That's pretty much what you'd want to do. Use an NSFetchRequest to see if any Listss exist. If not, create one. Then do another request to get all the Persons. Here, instead of assigning the list property of each Person, I'd create an NSSet containing all your Persons and assign that to the List's people property. You did create an inverse property, right?
This is actually a pretty lightweight operation, all tolled, so I wouldn't worry too much about performance. Unless you've got hundreds or thousands of Person objects, your user will probably won't even notice.