Adding Demographics in Valence - desire2learn

I have a quick question in regards to adding demographic data in D2L/Valence.
It looks like when you want to add Demographic data to a user, you need to send a UserId and a list of EntryValues.
The EntryValues are comprised of DemographicsEntry which is a Name (string) and Values (array)
Does that name have to match an existing DemographicsField field? If not, can I pass a FieldId when adding a DemographicsEntry to a user to attach that data to a specific field?

One way to think about it is that all users will have values for a defined set of demographics fields, and you can define those fields (that is, you can add fields, if you want). Whenever you want to update a user's demographics data, you must provide values for all the demographics fields; so, first fetch a user's current set of data, alter the values of the fields you want to alter, and then PUT back the updated block.
If your user has no demographics data, then you'll get a 404 for the GET to fetch their field values. In this case, you'll need to fetch back all the legal fields, and then use those to compose up a block of demographics data that you do want to PUT to the user.

Related

How do I get MS-Access form entries to save to a table (or query)?

We have two teams working on system related issues and my Access database has one table for each teams open issues. I have created a query that matches issues from each list based on the system name. The query is returning potential matches correctly.
From there, I need to be able to review each "match" and select yes or no on a dropdown to confirm if both teams are working the same issue in order to quickly and easily reduce redundancies. I would prefer to review each result in a form format and have figured out how to add a dropdown box with the yes/no options; however, once I've validated each item, I'd like to filter the results down to only show the items that have been designated as "yes".
That's where I'm stuck. The form is not currently saving the results, including the dropdown info, to a table from what I can see.
How can I get the form to load to a table (or query) in order to filter out the "no" responses?
Try converting your query to an append query or an update query. Create a new table that this query adds data to, and in that table create a new field called "YesNo" or something like that. Put that new field from your table as a control source for your dropdown and should add a value in the "YesNo" field in your new table based on what you select. I'm not sure what value will be added to the table, I did something similar with a check box, when it's clicked it adds a "-1" and when it's unclicked, it adds a 0. Then I run a report that selects records based on the value in that field. I'm assuming the dropdown would work in a similar way but not a 100% sure. Hope I understood your issue, I'm no expert at access but I ran into the opposite issue recently where I didn't want the form to save the results.

Unique random code for user content and how to avoid multiple user accessing same data in entity

Using swift 3 IOS10 and core data. I was trying to generate a unique code or ID for user content and I did not use UUID as it's too long I need short memorable one- I generated an alphanumeric code by doing this: created an entity to hold a start up numeric code say 1000, saved it to core data table and every time a new user comes in I read the code from the database, add some equation let us say addition to making sure it's unique, then add some random characters to it for more security. my question is how can I guarantee that if multiple users accesses this area at the same time they will not get the same code number read from the database. is there anything can block the DB record once any user reads it so prevent multiple users reading same data from the table at same sec?

How to fetch the last entry of each entity in core data iOS

I am making a chat application in iOS. I saved the last conversation of every friend. My core data entity has 3 fields - jID, message and timestamp. I don't set indexing on any field.I just want to fetch the last message of each jID. So,please help me and also tell me whether to set indexing on any field so that fetching process would be appropriate.
You could also add a one-to-one relationship between your entity and the last conversation (you will have to maintain it yourself, if you reveal your model I might be able to be a bit more specific).
A property that is used to filter data, and is used to access elements by, should probably be indexed.
This mean that you probably would want your jID and timestamp indexed.
If you want to fetch the last object, you'll need to have them ordered. Timestamp would be fine for this. And if you want to fetch the last object, reverse the ordering and just fetch the first instead.
If you want to use jID, the ids will have to be in some kind of order.

MVC and Entity Framework - inserts, updates, best practice

I'll try to be short and clear with this question.
We have an asp.net mvc app that uses entity framework 4.
Our business model is relatively straightforward:
We have an object (which corresponds to a table) called Photo(s).
That photos table has a handful of columns that match up to properties on the object.
Description,Title,Date etc.
It also has a number columns that reference foreign keys for other tables:
AuthorId,LicenseId etc...
The author and license tables are complex in their own right, with multiple fields (Title,Summary,Date etc.)
I have multiple clients using this application to view their photos. I would like each client to dictate what fields they see when viewing the photos, as well as what fields they see when editing those fields.
My thought is to have tables setup saying client-a should see Field1,Field2 and Field3 when viewing their photos - and client-b should see Field1,Field4 and Field5. But some of these fields are not simply columns in the main photos table, they may be fields in a child table. so Field1 might be: Table.Photos.Title -> which corresponds to an object as: Objects.Photo.title...
but Field3 might be: Table.Licenses.LicenseSummary -> which corresponds to an object as: Objects.Photo.License.LicenseSummary
I'm trying to figure out the methodology that we would use to have a very data driven environment so in the DB I can say, display this object/property (for viewing or editing) and then it would know how to map to whatever table it needs to pull that information. also, during editing... give it some way to pull a list of available values if it is that type of property, and not just a text field.
I'm looking for an example of what this might involve, our model is actually more complex than this, but this is just an idea of what we are trying to accomplish. I don't know if what I'm trying to do is normal, perhaps it involves reflection? This is a new area for me.
If the clients are defining their own custom fields, I would simply give them a Key/Value pairs table.
PhotoID FK
Key string
Value string
Display bool
Note that this essentially amounts to EAV, which comes with its own set of difficulties.
If it's just about permissions on existing fields, you need to capture that information:
PhotoID FK
ClientID FK
FieldName string
Display Bool
You can use this information to inhibit the display of fields in the View. The easiest way to do that would be to use a loop in the View itself, writing the field to the output only if Display is set to true.

Best way to save/store customer purchase order data?

I have a custom membership provider which I extended - added a couple of fields, first name, last name, adress, zip code and city.
now, these fields reside in the aspnet_Membership table so that I can easily access them when using the static Membership asp.net class.
now, I want to be able so save customer purchase order data (first name, last name, adress, zip code and city) to the database.
should I in my order model/table use a new set of fields - first name, last name, adress, zip code, city or should I create a relationship between my asp_Membershihp table and my Orders table?
Also, If i have dupe data, once a users asks for his account to be removed I wont have any orphan rows in my Orders table if I use the first method.
so, which is best, to have the user data, first name, last name, adress, zipcode, city in only one table and create a relationship between aspnet_Membership table and Orders table OR create the dupe fields in my Orders table with no relationship to the aspnet_Membership table? Pros cons?
Thanks!
/P
In this scenario, i would rather have the relationship.
Also being the data you are storing Orders (i assume at least, from the name :)) i would maintain a separate set of data on the Order, so one would optionally be able to specify different billing/shipping data than it's Identity on the site.
Another valid reason for duplicate at least some data on the Order table is to have all the necessary data relevant to an Order in the table, thus avoiding problems if the Client request his data to be deleted, and maintain the original values for that data on the order if the customer data were to change in time.
If you are able to, though, you should not actually delete User data, but have a field in which you specify if the User isActive or isDeleted.

Resources