Ads

Showing posts with label Designer. Show all posts
Showing posts with label Designer. Show all posts

Thursday, 16 March 2017

Configure Business Data Connectivity Service (BDC) Permissions

If you need to assign permissions on the Business Data Connectivity Service you just created, and you can do that by going to Sharepoint 2010 Central Administration. Once there, go to Application Management, then Manage Service Applications.

Choose Business Data Connectivity:

And choose the Content Type you created in Step 1, then set the permission:

It will now open a window to let you choose users to give permission to, it can come from an Active Directory or Forms Authentication User, you can also assign different permisssions per user or group:

Choose what's applicable to you and hit OK. Now, everything is ready.

Create an External List in SharePoint 2010 using Sharepoint Designer & BCS

Next, you will be exposing that table operations you just configured through an External List. First is you have to go to your navigation and choose List and Libraries, then choose External List

Once you click that, you will be presented with an External Content Type Picker and you will be able to view the Content Type you created a while ago on step 1, choose that and hit OK:

Now name your new external list and give it a description:

At this point, it will now be available on the External List Library. Click your external list to view its properties.

At this point, it has created the needed forms which are the Display Item, Display List, Edit and New Form.


Create an External Content Type using sharepoint 2010 designer & BCS

Now fire up your Sharepoint Designer 2010 and if you don't have one, you can download it here, once you are in, open your Team Site, then choose external content type, then create a new one:

Once you click that, it will open the Content Type Definitions, now place your Content Type Name, then click External System to define your Database Connection:

Now click Add Connection:

It will ask you different data source types, you can choose from .Net Type, WCF Service and SQL Server. We are now interested in SQL Server which lets you connect to a SQL Server Database. But before we move ahead, I will discuss a bit on the other two types as this adds flexibility on the Data Connections you might need later on. First it is a .NET Type which allows you to connect to a .NET Assembly which might be a third party or you developed it on your own and the next type is a WCF Service which lets you connect to a Webservice or a Metadata Exchange.
Ok, back to choosing SQL Server Connection, choosing it will prompt you to set the connection parameters:

Once you set it, your database objects will now be available on the Data Source Explorer.

Now choose the Table you need to expose and right click on it and create the operation you need. In this case, we select all operations so it will do read item, read list, create, update and delete in one shot.

Now, it will ask you some Operation Properties and Parameters, we will just click through next during the whole process.

Now the Parameters Configuration, we will just click next for now, but in short this window will:
  • configure the Data Source Elements on that table
  • require a field on save
  • define the field as a time stamp
  • show the field on the picker if you use this as a reference field on another Sharepoint list
  • and lots more

Now the Filter Parameter - this will let you filter the results the external list is grabbing from SQL so that it won't be slow loading the Sharepoint page especially if you have lots of rows. But for now, we also click next and let the default values handle it.

Now at this point, you have created the needed operations for the table you have chosen.

Now save your work by clicking that diskette icon on top:

Friday, 17 February 2017

Initiation form in SharePoint designer workflows

It is the king of form used to get user inputs before stating of the workflow.

Lets create one workflow to claim expense for approval.
    If an expense amount is <= Max-Limit, then set Status = Approved
    If an expense amount is > Max-Limit then set Status = Not-Approved
Here we create a Max-Limit parameter that will be captured on each workflow start.

Steps:

  1. Create one custom list called "Expense"
    1. Columns like Description, Amount, Status
  2. Create one list workflow on this list
  3. Click "Initiation Form Parameters" in ribbon 
  4. In page add one parameter "Max-Limit" --> set values like default, min & Max
  5. Now in designer workflow create the logic like below

Now save and publish the workflow

Testing:
  1. Now add one item in list
  2. Then try to run the workflow. While you start it will show up one form to provide max expense parameter value. 





Wednesday, 15 May 2013

Use Custom Workflow Actions in SharePoint Designer

First open your site in the SharePoint Designer and create new workflow as shown in following figure.
new workflow

Then select the SharePoint list that the workflow should attached to and selects the start option of the workflow as following figure.


Now you can find the newly deployed custom action in the "Extras" category. Chose it and click the "Add" button. Then you have to specify the parameters if your custom action asked for them as follow.



Now everything is done and you can test your work flow. To do this, go to selected list and click on the arrow appear when you put the mouse on title of a list item. Then select the "Workflows" option.


Wednesday, 3 April 2013

Creating external lists in SharePoint 2010 using designer

Now with SharePoint 2010 it is possible to create a list from other external sources with the help of external content type and external lists.

You can connect with any external source and can create a list from that. In this example, I am going to show you how to create a list from the SQL server database.

The advantage is you not only can view, but also insert, update and delete as well using external content types.

You can create external lists from designer as well as browser. In this part we will see how to create it through the browser and then in next part we will see how to create with the help of designer.

But even to connect with a list from the external SQL server database, you must first create external content type from SharePoint Designer 2010.

So open the SPD2010 and click external content type and then create.



Click on the content type and see the screen that you get



You will see name, display name, namespace, version, office item type, and office sync. Office related options are useful when your external list resembles the fields of outlook options. Like if you have contacts external list which has fields similar to the contacts outlook option; or calendar options, then you can select these options. For us we are going to use generic list. Because our list is different and does not resembles any structure with outlook options.

Click on the click here to discover the external data sources option.



Now click on Add connection.



Select type SQL Server and specify database server and name.






Once you are done with this, it will discover the tables. As of now I only have one table and hence It is showing only one.



Now right click the table and select create all operations. Which will create insert, update, and delete operations.



As you can see following wizard comes up which shows you the operations being performed.



Have your at least one field set as map to identifier.



Click on next to set filter options. As you can see because external list table in our case may contains so many records and it is not advisable to return all records in one time and hence you can see by default warning message saying that you should at least mention limit as a filter parameters.

Add filter by clicking on add filter.




Click on Ok and then finish. Now we have our external content type set up.




Click on save button to save the content type to Meta store.

Now go to your SharePoint site and create external list.





Click on create, so the list will be create. Now check that you might get this message.



Open central administration.

Application Management -> Manage Service Applications -> Business Data Connectivity Service



Now select content type and link on set metadata store permissions. Following screen appears.



Now there is a possibility that you get blank section in the permissions for all Users (windows). Means you may not see any permissions listed in that block. Yes, and this is what I got. Well I also found a solution and the solution is to use PowerShell script.

PowerShell is a scripting language which is used to automate some tasks. It is same as how we write commands on the command prompt. But PowerShell has more power as name suggests.

Open run command prompt and type in PowerShell.exe and you get the PowerShell Window.



As you can see it starts with PS and it stands for PowerShell of course.

Now run these commands one after the other

$adminURL="HKLM:\SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\14.0\WSS\"
$key = Get-Item $adminURL
$adminurl = $key.GetValue("CentralAdministrationURL")
Write-Host "Central admin site "+ $adminurl
Add-pssnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue

Write-Host Updating BCS persmissions
$obj = Get-SPBusinessDataCatalogMetadataObject -BdcObjectType Catalog -ServiceContext $adminurl
$right = (1+2+0x10+4)
$claim = New-SPClaimsPrincipal -Identity 'c:0!.s|windows' -IdentityType EncodedClaim
Grant-SPBusinessDataCatalogMetadataObject -Identity $obj -Principal $claim -Right $right
Copy-SPBusinessDataCatalogAclToChildren -MetadataObject $obj
Write-Host Complete
Once you perform the above step, you get the permissions in the metadata permission property box. Now assign permission to appropriate users and click on OK.

Now open the site and open the Employees list. Ok, surprise, one more error and this time it is following.



This error comes because when we create external content type in SharePoint designer 2010, it takes the user’s identity as authentication mode.

So let’s change the authentication mode from User’s identity to BDC Identity.

Open SPD2010 and open the external employee content type we created.



And now, we get this



Wow, another error. It seems like we are facing so many problems. Well, after resolving problem and get the solution is indeed is a pleasure.

So let’s put a step forward to get a solution.

Now this time open Windows PowerShell modules by going to Start-Administrative Tools-Windows PowerShell Modules and use this script

$bdc = Get-SPServiceApplication | where {$_ -match "Business Data Connectivity Service"};
$bdc.RevertToSelfAllowed = $true;
$bdc.Update();



Now go to Employees external content type, open it and change it from User’s identity to BDC Identity and save it, this time it should not give you an error.

This should resolve this issue. As you can see we have set RevertToSelfAllowed to true through console. Because this property is by default set to false and it is disable in SPD2010. So we need to set it through the PowerShell.

And there we have it now. Open your site and open Employees List.



Click on New, enter the details



See, now we not only have the data in the list but also in SQL Server database.



But yes, one very important thing to note here is that external lists neither participate in any event handlers nor participate in workflows. So if you see its settings page, you will not see any workflow options.

 

Creating external lists in SharePoint 2010 – Part 2

Here we are with part 2. If you have not gone through part 1, then I recommend you reading part 1 first before proceeding. Once you are done with reading part 1, then come back and read this part 2 to understand it bit more.

Now remove the Employees list from the SharePoint site we created earlier. Now open SharePoint Designer 2010 and open the Employees external content types.

Click on create list and form.



Then give name of the list and description. System instance will be Employees because as of now we only have one external content type in my system.



Click on Ok, it will display creating Employees list



Go back to the SharePoint site and check that list has been created. Also make a note that it shows that list is external.



If you create InfoPath form, then it appears like this

Ads