Can I use any other column name than id in my xamarin forms app? - azure

As the title suggest, I was wondering if it was possible to use any other column name for the index than id?
The documentation for creating a Mobile Backend in Azure and Xamarin Forms app stipulates that the index column must be id all lower case for the API to return data. What if your index column is called something else, for example idx_index.
My issue is that my database already exists and there are a lot of tables. I'd like to avoid having to rename the index columns in the database if I can.
Is there anything I can do that would help me avoid this problem or does it look like I'll need to rename my columns to id?

No - you cannot use any other name other than id. This is in-built into the SDK and you would need to alter both the server and client SDKs (and compile new ones) to support something else. This is a non-trivial update.

Since my database already existed all the column naming was set. To get around this problem when it came to Azure and it's expectation of a column called id I simply cast the column names in some custom views which were specific to my mobile app. For example:
SELECT index_idx as id,
name,
location
FROM mytable

Related

Kentico - Unable to find a custom user column

I just took over a project from a developer who has already left an organisation and I'm doing some maintenance work in the project. I can see the following code in a custom web part
CurrentUserInfo CurrentUser = MembershipContext.AuthenticatedUser;
DateTime ExpirationDate = CurrentUser.GetValue("aps_expirationdate", DateTime.Now);
The strange thing is, I cannot seem to find this custom field 'aps_expirationdate' anywhere in the system or in the database.
I checked the following places but couldn't find it.
Checked Membership module 'User' class and 'User - Settings' class
Checked 'User' module
Did a manual Sql Search in the database to find a table with a column name 'aps_expirationdate'
but I cannot seem to find this column anywhere and the other strange thing is, when I debug the code it does return a date value. No bugs in the code so, cannot say that this is an invalid column name. Where else should I look?
Based on what you've put in your initial question, it sounds as if the column was added manually and not through the Kentico UI. In order for the data access layer or the Kentico API to know that field exists, the definition has to be stored within the Kentico module class and not just in the database.
Here's what I'd do to correct this:
Find what table the field exists in. If you want the custom field to be part of the User or User Settings objects then they need to be added to either the CMS_User or CMS_UserSetting table.
If the field does not exist in either the CMS_User or CMS_UserSetting table, then go to the Modules app in the Kentico UI.
In the Modules App, go to Membership > Classes > Users > Fields and add the aps_expirationdate field.
If you have data in the field aps_expirationdate in the other table, write a query to copy it from the other table to the CMS_User table.
Now the API call as noted above will work.
If the field is already in the CMS_User or CMS_UserSetting table, then you will have to do the following:
In SSMS, rename that field to aps_expirationdate_old.
In the Modules App, go to Membership > Classes > Users > Fields and add the aps_expirationdate field.
Assuming you have data in the aps_expirationdate_old field in the CMS_User or CMS_UserSetting table, write a query to copy it from the other table to the CMS_User table.
Your last bullet point states you "Did a manual Sql Search in the database to find a table with a column name 'aps_expirationdate'". This contradicts what you state at the end of your question which states "I cannot seem to find this column anywhere". If you cannot find what table the aps_expirationdate exists in, then check out the following SO answer to find that column in a given database.
https://stackoverflow.com/a/4849704/698678

Data Dictionary Storage and Retrieval with MongoDB and Node.js Application

I have the following requirement in my project.
It is a reporting application so mainly will be storing data about my entities once and most of the times will be retrieving it and showing them on the webpage as different reports. I am using node.js and mongodb for this project.
The data is in the form of excel. There are more than 2000 columns and each column has one short code like s0a_1, s0a_2, s1a_1, s1a_2 etc. Each column code is mapped to a long meaningful text. For example, s01_1 -> What is the name of the person ? , s01_2 -> 'Project Name' etc. And for each column there will be a corresponding value which is a number most of the time.
In my reports, I need to show long meaningful text and corresponding value.
So, what is the best way to achieve this ?
We can think of the following ways:
Create a collection in mongo and store shortcode/text as key value pair and each time I replace short code with text before sending response to the client.
Store in a property file as key value pair
Use redis for this specific purpose
Any help will be appreciated.
Thanks.

How to use view parameter "Keys" for date fields at Domino Data Service REST API

Domino REST API doesn't return any view data if I use date at query parameter "Keys". In case of Extension Library REST Control we can use NotesDateTime() or #Date() to make it work.
But I don't know how to use the same at Domino REST API call. Anybody knows how to use date as key?
This is the the sample url,
https://demodomain.com/demo.nsf/api/data/collections/name/viewName?sortcolumn=DateField&keys=1999-03-24T22:16:17Z
I looked at the source code for the Domino data service. The view entries resource (/{db}/api/data/collections/name/{view}) always assumes the keys parameter is a string. So apparently it's unable to match any value in a date column.
This behavior could be improved. Meanwhile, you could work around the limitation by creating a separate sort column with the TEXT representation of the same date. Use the new column name in the sortcolumn parameter and the view entries resource should be able find rows that match the keys parameter.

SharePoint Web Parts can not be connected via hyperlink fields

In short:
I'm trying to filter an XSLTListViewWebPart based on what is selected in another XSLTListViewWebPart. Using a String field as connection this is working fine. Using a hyperlink field no data is displayed.
In more detail:
I have two lists, say Accounts and Projects. Both have a hyperlink field accountURL.
All accounts have different accountURLs. Different projects can have the same value for accountURL. Both are displayed on a page using the XSLTListViewWebPart.
The simple goal is to filter the Projects list based on which item is selected in the Accounts list using the accountURL field. So I established a web part connection using the acountURL as a filter. Alas, when an item in the Accounts list is selected no items are showwn in the Projects list although I double checked that there are matching values.
When using a string field instead of a hyperlink field for accountURL everything works like a charm. Problem is, I need the hyperlink field.
Is this desired behaviour? Do you have any suggestions for a workaround?
(I already tried converting the hyperlink field to a string field via a calculated column which did not work out either.)
All was and is to be done in the web interface or SP-Designer. Coding a WSP is not an option for this problem. As I'm not quite familiar with the correct terminus technicus I use field and column interchangeably.
All help is greatly appreciated.
Ben
Someone on the Microsoft forum suggested the following workaround which does its job well:
Add a hidden text column to both lists.
Use a workflow which is triggered on item creation and update to copy the value of the hyperlink column to the hidden text column.
Connect both webparts using the hidden column as filter.
Nonetheless, I still wonder whether it is possible to use hyperlink columns or other special columns for filtering. I also had the problem that I cannot use a person column as lookup.
Does anyone know if whether there ist some kind of overview
which column types can be used for filtering/formulas/lookup/...?
Cheers,
Ben

Auto number column in SharePoint list

In a SharePoint list I want an auto number column that as I add to the list gets incremented. How best can I go about this?
Sharepoint Lists automatically have an column with "ID" which auto increments. You simply need to select this column from the "modify view" screen to view it.
You can't add a new unique auto-generated ID to a SharePoint list, but there already is one there! If you edit the "All Items" view you will see a list of columns that do not have the display option checked.
There are quite a few of these columns that exist but that are never displayed, like "Created By" and "Created". These fields are used within SharePoint, but they are not displayed by default so as not to clutter up the display. You can't edit these fields, but you can display them to the user. if you check the "Display" box beside the ID field you will get a unique and auto-generated ID field displayed in your list.
Check out: Unique ID in SharePoint list
If you want to control the formatting of the unique identifier you can create your own <FieldType> in SharePoint. MSDN also has a visual How-To. This basically means that you're creating a custom column.
WSS defines the Counter field type (which is what the ID column above is using). I've never had the need to re-use this or extend it, but it should be possible.
A solution might exist without creating a custom <FieldType>. For example: if you wanted unique IDs like CUST1, CUST2, ... it might be possible to create a Calculated column and use the value of the ID column in you formula (="CUST" & [ID]). I haven't tried this, but this should work :)
I had this issue with a custom list and while it's not possible to use the auto-generated ID column to create a calculated column, it is possible to use a workflow to do the heavy lifting.
I created a new workflow variable of type Number and set it to be the value of the ID column in the current item. Then it's simply a matter of calculating the custom column value and setting it - in my case I just needed the numbering to begin at 100,000.
it's in there by default. It's the id field.
If you want something beyond the ID column that's there in all lists, you're probably going to have to resort to an Event Receiver on the list that "calculates" what the value of your unique identified should be or using a custom field type that has the required logic embedded in this. Unfortunately, both of these options will require writing and deploying custom code to the server and deploying assemblies to the GAC, which can be frowned upon in environments where you don't have complete control over the servers.
If you don't need the unique identifier to show up immediately, you could probably generate it via a workflow (either with SharePoint Designer or a custom WF workflow built in Visual Studio).
Unfortunately, calculated columns, which seem like an obvious solution, won't work for this purpose because the ID is not yet assigned when the calculation is attempted. If you go in after the fact and edit the item, the calculation may achieve what you want, but on initial creation of a new item it will not be calculated correctly.
As stated, all objects in sharepoint contain some sort of unique identifier (often an integer based counter for list items, and GUIDs for lists).
That said, there is also a feature available at http://www.codeplex.com/features called "Unique Column Policy", designed to add an other column with a unique value. A complete writeup is available at http://scothillier.spaces.live.com/blog/cns!8F5DEA8AEA9E6FBB!293.entry
So I am not sure I can really think of why you would actually need a "site collection unique" id, so maybe you can comment and let us know what is actually trying to be accomplished here...
Either way, all items have a UniqueID property that is a GUID if you really need it: http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.splistitem.uniqueid.aspx
Peetha has the best idea, I've done the same with a custom list in our SP site. Using a workflow to auto increment is the best way, and it is not that difficult. Check this website out: http://splittingshares.wordpress.com/2008/04/11/auto-increment-a-number-in-a-new-list-item/
I give much appreciation to the person who posted that solution, it is very cool!!

Resources