Wednesday, December 24, 2014

Inline Approval Function

This is helpful you to work with InfoPath form approval for Approval task using Flexi task or request task actions.

1.       Create Web Service to get “SharePointTaskId

·         Manage data connection à Addà Create a new connection à Receive data àSoap Web service à enter following link
 



·         Select “GetRunningWorkflowTasksForCurrentUserà Next à Finish

2.       Create a web service to get Task ID and Outcome
·         Manage data connection à Addà Create a new connection à Receive data àSoap Web service à enter following link
·         Select “ProcessTaskResponse3à Next



With Flexi Task Action :
·         Select “ProcessFlexiTaskResponse2” 



·         Put Task list name : eg -->“Personnel Requisition Workflow Tasks”

You have to configure Task Outcome values in InfoPath Form as “Approved” or “Rejected”

3.       Sumbit button function

·         Add rule for Disable Submit button





·         Add Sumbit rule  à
·         Set field value for outcome : Set outcome form ProcessTaskResponse3/ProcessFlexiTaskResponse2 Web service.





·         Set Task ID : Set spTaskId form ProcessTaskResponse3/ProcessFlexiTaskResponse2 Web service.




·         Set SharePointTaskId form “GetRunningWorkflowTasksForCurrentUser” Web service.





·         Set Query Data


·         Set HasTask false :



·         Send Update



·         Finally Close the form action .

4.       Set Form Load function
·         Query by task  -Set fileUrl à to form variable





·         Set Query connection :


5.       Set Set hask task = true
·         Check condition FileUrl is not blank and  TaskType = "Approval"(for ProcessTaskResponse3) or TaskType = "MultiOutcome" (for ProcessFlexiTaskResponse2)

·         Set variables for task type






·         Set Has task variable = true()





6.       Error
·         If you are getting this kind of error check the web service links and verify




Workflow end configuration for Flexi Task.

<ProcessFlexiTaskResponse2 xmlns="http://nintex.com">
      <comments>string</comments>
      <outcome>string</outcome>
      <spTaskId>int</spTaskId>
      <taskListName>string</taskListName>
    </ProcessFlexiTaskResponse2>




Workflow end configuration for Request Approval Task. Please notify that you have to put below outcomes only.

<ProcessTaskResponse2 xmlns="http://nintex.com">
      <comments>string</comments>
      <outcome>None or Approved or Rejected or Pending or Cancelled or NotRequired or Continue or Delegated or Custom or OverrideApproved or OverrideRejected or OverrideContinue</outcome>
      <spTaskId>int</spTaskId>
      <taskListName>string</taskListName>
    </ProcessTaskResponse2>


Thursday, December 18, 2014

BCS: There are no addresses available for this application



I have a virtual machine (Windows 2008 R2) which I'm setting up for Sharepoint 2010 development.

I am trying to set up BCS.

In central administration, I have added a new service application of type (Business connectivity services), and this application is showing as "started".

When I click on the service in the list I receive the error "There are no addresses available for this application."



The problem occurs because Business Data Connectivity Service is stopped. To start BCS Service
Go to Central Administration --> Application Management --> Under Service Applications
Click Manage services on server. Start business data connectivity service.

Perform iis reset.

Wednesday, November 12, 2014

Reports on your Nintex Workflows

Nintex Workflow Reports webparts, available with the Enterprise versions of Nintex Workflow (2010/2013).

Accessing and Enabling the Nintex Reports


1. Open Central Administration and click on Manage Reports in the Nintex Workflow Management section. A list of the available reports will appear.
2. To enable a report, check the Enabled box.

To add a Workflow Reports Webpart to a site


Open the Site, click on Edit Page and then the Insert tab.
Web Part -> Categories -> Nintex Workflow 2010 (2013) -> Workflow Report Viewer
Now you can edit the webpart and select the Nintex report you wish to display.


Workflow Performance Reports


12 Month Usage Summary 
3 Month Usage Summary
30 Day Usage Summary 
Approver Performance Statistics
Completed Workflows
Errored Workflows 
Overdue Workflows 
Workflow Actions 
Workflow Performance 
Workflows by Site
Workflows in Progress 

Monday, October 27, 2014

Log4net quick learning

log4net


The greatest logging tools out there for .NET is log4net. It’s a tool to help the programmer output log statements to a variety of output targets. There are a three parts to log4net. 
          Configuration -
          Setup
          Call


Logging Levels


1.         OFF - nothing gets logged (cannot be called)
2.         FATAL
3.         ERROR
4.         WARN
5.         INFO
6.         DEBUG
7.         ALL - everything gets logged (cannot be called)

These levels will be used multiple times, both in your code as well as in the config file. There are no set rules on what these levels represent (except the first and last).


Configuration


Configuration is doing in the app.config or web.config file.  There are a few pieces of information that need to be placed in the config file in order to make it work properly with log4net. These sections will tell log4net how to configure itself. The settings can be changed without re-compiling the application.
Root
You need to have one root section to house your top-level logger references. These are the loggers that inherit information from your base logger (root). The root section is the minimum level to log. 

<root>
      <level value="INFO"/>
      <appender-ref ref="RollingFileAppender"/>
    </root>


Additional Loggers


An additional logger that placed in config file to log to the console messages that occur inside the OtherClass class object:

<logger name="Log4NetTest.OtherClass">
      <level value="DEBUG"/>
      <appender-ref ref="ConsoleAppender"/>
    </logger>


ConfigSections


This section is to identify where the log4net configuration is housed.

<configSections>
    <section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
  </configSections>


Appender (General)


It specifies where the information will be logged, how it will be logged, and under what circumstances the information will be logged. 

<appender name="ConsoleAppender" type="log4net.Appender.ConsoleAppender">

The Code


Once you have a reference to the log4net DLL in your application, there are three lines of code that you need to know about
1.         One-time entry that needs to be placed outside of your class. I usually put it right below my using statements in the Program.cs file.  Or 
[assembly: log4net.Config.XmlConfigurator(Watch = true)]
2.         It does a System.Reflection call to get the current class information. This is useful because it allows us to use this code all over but have the specific information passed into it in each class. 
3.         The actual call to log some piece of information.

log.Debug("Application started"); or  log.Info("Info error logging", ex);  …etc.

Download DLL , add reference to your Project and have a try !!!

Friday, October 3, 2014

Extract Info Path embedded attachments and send it as Email attachment.

  •       I have created Info Path form with two controls (title and attachment), and published it to my form library.





  •  Query the current item using XPath to get the title and save this in a workflow variable

  •  Query the destination library to get the URL where the attachment has to be added.





 ·         Copy your attachment (specified in XPath) in the URL (varTxtFileAttachmentUrl) saved in previous action i.e. Query List.








  • Now you can attach Attachment to the email you are sending.






Friday, May 30, 2014

How to apply a background Image in InfoPath Form

Open your InfoPath Form. Then follow the below steps.

Page design -> Properties -> Check Use a background Picture -> Browse the picture you want to set for background and click on OK


























  

Set Image as Form background

Extract the InfoPath CAB file into a directory using the File – Extract Form Files function.
Once the files are extracted into a directory they will contain the following files. Notice the Manifest.xsf file.

Using Notepad (or another text editor) hand edit the view1.xsl to place the image within the InfoPath solution. Add the following line to the <body> element.

style="background-image:url('image001.jpg')"


 Once this is done you can right click and select “Design” on the Manifest.xsf form. This open the InfoPath form in design mode and the background image is visible. 



Wednesday, May 7, 2014

How to open Document Library Item/InfoPath Form in New Window ???

Document libraries are collections of files that you can share with team members on a Web based on Microsoft Windows SharePoint Services. 

Create document library and uploaded files in it or open existing file, its opening in the same browser. There is no inbuilt feature in SharePoint to set it to open in new window.
SharePoint uses window.location to navigate to the new link, So the link always open in current window instead of a new window.
As a solution, you can override the STSNavigate function to change the behavior; here is the code sample to override it in AllItems.aspx.

<asp:content contentplaceholderid="PlaceHolderAdditionalPageHead" runat="server">
       <SharePoint:RssLink runat="server"/>
      
       <Script>
       function STSNavigate(Url){
              window.open(STSPageUrlValidation(Url),"_blank");
       }
       </Script>
</asp:content>

Instead of this you can add content editor web part and add java script code to it.

Thursday, April 3, 2014

Access SQL Server data through InfoPath Form



1.       Create Data Connection Library in your site.


 








2. Data connection settings must be stored in a UDC file in a data connection library. So create and store .udcx file.

3.       Manage connection in InfoPath. Receive data -> Database -> Select Database -> New Source-> SQL Server -> Fill server name and Log on Credentials.
 

 
4.       Select Database and table you want to get data. Next and click on finished.


 
 
5.       Then Manage data connection -> Select data connection you created and click convert to connection file. Give path to data connection library.





















6.       Then manage data connection -> add -> Search for connection on a MS SP Server -> Manage site -> Give site details.-> select .udcx file -> Finish

7.       Design Your InfoPath Form.
8.       Rules -> Click New -> Action
9.       Click Add -> Query for data. Select the table and click OK.














10.   Click Add -> Set a fields value . For the Field give the customer first name field which is ‘field2′


 





11.   Click Filter Data -> Add . Create a filter such that The customer ID you input in the form is equal to the customer ID in the database. Click OK for everything.
















12.   After all changes publish your Info Path form. Now to check the form click preview or press F5. Enter a cutomer ID (provided it’s in your SQL database) and click the button.







Note: The amount of data that was returned by a data connection has exceeded the maximum limit that was configured by the server administrator. Form elements, such as drop-down lists, may be blank.

Click on General Application Settings in Central Administration
Click on Configure InfoPath Forms Services under InfoPath forms Services
Change the Response Size in kilobytes (Increase the number).