Creating repeatable columns for a Sharepoint 2010 List - c#

I'm trying to create a list that allows me to store multiple instances of a single column.
Say I have a column names "steps" which is a single line of text, and I want the user to be able to add as many as possible.
Can I do this currently in Sharepoint Lists?
Bonus points for allowing me to do it in a LoopUp column, for more complex types.

You will need to create a "Custom Field Type" to do this. Then you can delimit your different lines somehow (the internal columns link Multi-lookup, multi-choice etc use ;# as a delimiter but you can use whatever)
http://msdn.microsoft.com/en-us/library/ms446361.aspx
http://msdn.microsoft.com/en-us/library/bb684919(v=office.12).aspx
http://sharepointmagazine.net/articles/customizing-the-user-experience-of-sharepoint-custom-fields-deep-dive-part-5-of-6

Related

How to add multitext values seperated by commas to optionset and lookup field in cm 2015 using c# plug-in

I have a plug-in. This plug-in should get the values seperated by commas from multitext field one by one and stores to an optionset field.
And also this plugin should get values(ids) from multitext field seperated by comma and searches the ids one by one in lookup field values. If found (the search operation should be done one by one in a loop;since there will be more thean one id to search), the value should be seen in the lookup field.
After theese opertaions the plugin should save the entity.
How can i do this in crm 2015 using c# visual studio plug-in? Can anyone help me please
So, in a nutshell, what do you want to do is to generate the CRM metadata dynamically from a comma separated input, like a CSV?
Have a look at the CreateOptionSetRequest and InsertOptionSetValueRequest in CRM, this will allow you to insert new option set values for a given option set.
Those will allow you to dynamically create an option set field, and populate option set values for that field, respectively.
For lookups, If I understood correctly, you can link records to each other using AssociateRequest messages.
Hope this helps

what is the best approach to store keywords inside database, language agnostic

My question title is self explanatory.
I'm aware that there is no exact answer on this subject cause it depends on many subjects but if you have time to share ideas and thought on how would you collect keywords, store them into db. Pseudo code would be just fine, or plain english.
Here's what I'm thinking
Collecting keywords from the user
User enters using some form (web or desktop) and sends them to the database.
txtKeyword1 = "one"; txtKeyword2 = "two"; txtKeyword3= "three";
How keyword is represent inside database
With TEXT field containing "one two three"
Problem
With using this approach I'm coming to the problem when I want to display keywords separated one from another. I was thinking to separate each word with ','(comma) but what if keyword has more than one word?
Should I use one more property inside viewmodel to represent separated keywords as List<string>Keywords property (once I come with solution how to separate them) or I should store this property directly inside domain object.
Please share you're thoughts.
Thank you
Please ask if you need more information.
It sounds like you want to have a one-to-many relationship of records and keywords. Best achieved by using three tables:
The first table should have the records, and no reference to the keywords.
The second table should be just single individual keywords.
The final table is a lookup table. For each keyword that a record has, this table has an entry for the index of the keyword and an index of the keyword.

How to generate dynamic multi-dimensional list or array and insert data accordingly based on a dynamic SQL Server table in c#?

I want to create a dynamic 2-dimensional array (or any other structure) based on a dynamic database table in C# or T-SQL, which means the data source (which is a database table) is dynamic too.
EDIT:
Table structure:
For example:
If User1 meets the condition of Admin and Group1, it will be inserted into (Admin, Group1). And the users are constantly added in with different user type and group. So, every cellular can have as many as users.
And the problem is I don't know how many user types and groups there are, because new user types and new groups are added constantly too.
For now, I think I need to parse every data to find if it meets the existing conditions. If yes, insert it into the specific condition; if not, create a new condition and insert data into it.
But I don't have any idea about how to implement it? Do you have any ideas or algorithms?
Thanks very much for any suggestion or information.
I've solved this statically with Tuple, but not dynamically. I think I should re-fresh my tuple list periodically. But at least, it works now!
Any suggestions are welcome! Thanks!

FileHelpers -- Only read Nth Columns

I am using FileHelpers to read a CSV file that have hundreds of columns but I only need the first twenty or so, so while creating the mappings in the class I only put those twenty columns.
When do the parsing, I get the following exception
Delimiter ',' found after the last field 'CompanyDivision' (the file
is wrong or you need to add a field to the record class)
I read in other answers that a hack for this is to put dummy fields for the rest of the columns you don't want to read but, as I said, I have hundreds of those.
Is there a way to configure the engine to stop after a certain number of columns? or is there a way to extend or modify the engine to do this?
You can try adding an array dummy field:
private string[] mDummyField;
With that the rest of the fields will be in that field. You must use the last version of the library.

How to Use some DataTable for a Client Report?

I have a client report (RDLC) with these specifications. and I am using VS 2008 to implement this
I have a DataSet with 4 Different DataTable for each section. and note that all of the report located in a List in order to print a large group of Data with one request.
Description
all of the report located in a List // to print some different data with one request
At top (in the list) we have a rectangle which include some Textbox to represent common Information
At Middle I have 2 different List which include some TextBox To represent List of Professor and Managers ( it also has to show their Picture, with Name and etc)
Then I have another List to represent The Organizations Information. ( it use some TextBox inside of a List to represent All of the Organizations Information)
As Client Report work with One Dataset. I provide four DataTable for my different Report Sections.
Each DataTable Has an ID for Grouping
The Common DataTable ID use to group the entire of the list for another Object (Here University)
How Can I implement Such a report, While I can't use Different DataTable for grouping because If I do such a Thing I can Display only the First Field of the groups
Any Help is Appriciated
Thank you in advance
The simplest way will be to create an unnormalized data-view by joining your four data tables and then bind your report to it. You have group on ID (that is common to all data tables).
Yet another option would be to use sub-reports but IMO, its more complicated/inefficient to use them instead of above option.

Categories