Pages

Saturday, 14 April 2012

Info path 2010 on Ipad

From today I will be  working on rare combination of products Microsoft and Apple. to starts with Info path 2010 forms on I PAD browser . thanks to share point 2010 for having better html output to support multiple browser


Day 1 
1. Basic browser  infopath form works good in IPAD . thanks to SP 2010

Day 2
1. Will target application in two phase 1st create infopath application for client in windows system for offline capability  and online version (browser) for IPAD.
2. Phase 2 will add offline capability in IPAD. this going to be interesting  options here are
        a. Create or buy any infopath Ipad App like SharePlus
        b. Create a ipad app for application mean not a infopath but a ui application which will read and write infopath xml to sharepoint library . but downside of this is it will be specific to Application.


Day 3.
Notices a issue in info path browser forms in safari (IPAD)  not sure whom to blame MS or Apple.



You can't change text color or hi light a test with given ribbon controls. very minor issue .

I will skip some around 10 days it went smooth without any issue

Day 13
     Notices one more  issue in infopath browser form in Safari both  desktop and iPAD
       Description : My info path form have Submit button . when you hit submit button with some validation  error in form ( required field  validation) infopath will prompt a error popup . which is normal but once you are back to form  from error popup  last Rich text box field  which i was filling just before hitting submit button  will be blank.
     agian not sure whom to blame MS or Apple.

Wednesday, 11 April 2012

InfoPath Design Copy Past Issue


Today while working with infopath forms i feel sometime when I try to copy  and past some text or control across the view or to different location in a  same view it never past the content i have copyed. many people do system restart and it work but when i dig a bit its a strange dependency

Solution 
if you close all your open  IE window  copy past starts working normally .

Don't know what this have to do with IE . but certainly there is some relation between  on IE and info path one more such example if if you make you your IE offline your info path will also get into offline mode .

Friday, 9 March 2012

Move SharePoint List Item (SPListItem) To Sub Folder



Below is a sample code to move SPlist item  from Root Location to sub folder. as every list item have unique url they can treated as File(SPFile). With SPFile Object we know how SPFile.Move() works.

In this sample code will try to move SharePoint list item from root folder to subfolder during ItemAdded Event.


/*
* /Move  List Item to folder ( not Document library folder )
* with sahrepoint 2010(not sure if poosible in MOSS 2007 )
* Key point sahrepont create unique URL for every list item also . it will look like 
* http:///sites//Lists//1_.000    where 1 is SPitem ID
* 
*/
          
SPWeb web= properties.Web;
//Folder123 is Inside root location of List
string DestinationFolderName="Folder123";

// Source item outside folder Folder123 
SPListItem listitem = properties.ListItem;

SPFile listitemFile = web.GetFile(listitem.Url);

//Create New Destination  URL ../Lists/Folder123/1_.000
string NewDestinationUrl=listitemFile.Url.Replace(listitem.ID.ToString()+"_.000",DestinationFolderName+"/"+listitem.ID.ToString()+"_.000"); 

//Move Item Insite Folder123
listitemFile.MoveTo(NewDestinationUrl);

Monday, 20 February 2012

Sharepoint 2010 Date Column Validation with [Today] Date

with new SP 2010 Column validation . 1st thought that came to my mind is date field validation with respect to today's date. then quickly create a date column TestDate and  and add the validation formula as below .
=[ TestDate ]>=[TODAY]

Then it will give you a error.
after some hit and trial I found actual expression should be
=[ TestDate ]>=TODAY()


Yapee......

Tuesday, 14 February 2012

WP e-Commerce digital product Download link on google checkout

When you are working with WP e-Commerce plugin for word press linked with Google Checkout for payment .and your shop is for  Digital Product and you feel you need more from this plugin then you are in right place . I have many issues  while configuring this plugin for one of my shop
1. Unable to display download link for digital products  after checkout .
2. No links to download digital product after Google checkout .
3  WP e-Commerce  add multiple  entries to  for single transaction
 4.Google checkout send Pending for shipping mail to user which in confusing .

Solution:
the problem is plugin is not sending google information about the product . it just sends its pricing details.  to fix this go ahead and modify  phugins PHP files

Step 1 Go to Location "..\wp-e-commerce\wpsc-merchants"
Step2 . Open    GoogleCheckout-XML.php
Step 3. Go to Line number  182  ( just above   $cart->AddItem($cart_item); )
Step 4.Add below code to it just before  line $cart->AddItem($cart_item);
  
//Extra code  send media download url to google checkout  
   $siteurl = get_option('siteurl');
   $previous_download_ids = array(0);
   $product_id = wpsc_cart_item_product_id();
   $link = "";
   //$product_data = $wpdb->get_row("SELECT * FROM `".WPSC_TABLE_PRODUCT_LIST."` WHERE `id`='{$product_id}' LIMIT 1", ARRAY_A) ;
   $wpdb->query("UPDATE `".WPSC_TABLE_DOWNLOAD_STATUS."` SET `active`='1' WHERE `product_id` = '$product_id' AND `purchid` = '{$purchase_log[0]['id']}'");
   
   $download_data = $wpdb->get_results("SELECT * FROM `".WPSC_TABLE_DOWNLOAD_STATUS."`
       WHERE `".WPSC_TABLE_DOWNLOAD_STATUS."`.`active`='1'
       AND `".WPSC_TABLE_DOWNLOAD_STATUS."`.`purchid`='".$purchase_log[0]['id']."'
       AND `".WPSC_TABLE_DOWNLOAD_STATUS."`.`product_id` ='".$product_id."'
       AND `".WPSC_TABLE_DOWNLOAD_STATUS."`.`id` NOT IN ('".implode("','",$previous_download_ids)."')",ARRAY_A);
     
     $link=array();
     if(sizeof($download_data) != 0) {
      foreach($download_data as $single_download){
       if($single_download['uniqueid'] == null){// if the uniqueid is not equal to null, its "valid", regardless of what it is
        $link[] = array("url"=>$siteurl."?downloadid=".$single_download['id'], "name" =>$single_download["filename"]); 
       } else {
        $link[] = array("url"=>$siteurl."?downloadid=".$single_download['uniqueid'], "name" =>$single_download["filename"]);
       }
      }
     }
   foreach($link as $single_link)
   {
    // $product_list .= "\n\r ".$single_link["name"].": ".$single_link["url"]."\n\r";
    $cart_item->SetURLDigitalContent($single_link["url"], null, wpsc_cart_item_name());
    break;
   }
      //End of extra code  Vijay
Step 4. Now you are done .

What the above line of code will do ?
1. Create entry in WPSC_TABLE_DOWNLOAD_STATUS table unique id for download url .
2. Activate the URL
3. Send download URL information to Google to be displayed in Google checkout page after transaction complete. user really dont have to come back to your site to get the download link
4. Along with download URL Google will treat this product as digital digital product so no shipping issue  .
5. on top of all these this download  url information will be there in Google checkout mail send to buyer .

I hope wp-ecommerce will add this oprion to there code .


Friday, 5 March 2010

Updating site the site content type failed. Infopath 2007

Suddenly one day while publishing an InfoPath form with 40+ fields promoted as column to a SharePoint library I found it started throwing error msg “Updating site the site content type failed”.
After doing some research on it I found basically this issue is due to inc in number of column promoted to library .

1. when we publish InfoPath forms with more than 30+ column some time it take more than 30 sec(time taken for .xsn file to get copied into sharepoint site not the entire publish wizard) . and problem is here in infopath client process time out is hard-coded for 30 sec . this is why we get this error.

Solution for this :
1. MS have fixed this 30 sec hardcoded issue in SP2 of MS Office clients ((MS Office SP2 Download))


2. If By any chance you cannot upgrade to SP2 then only solution for Is remove few promoted column till it publish successfully. or check for network speed if it is slow enough to increase the publish time more than 30 sec, switch to higher network speed.

Tuesday, 13 January 2009

MOSS 2007 'Hello world' WebPart

In order to develop moss 2007 webpart you will need

1. Visual Studio 2005/2008 or later.


2. You will also need network access to a Windows 2003/2008 server with SharePoint 2007 (WSS or MOSS) . One can also install Visual Studio 2005/8 on the development server.


3. Administration rights on your SharePoint server and also administration rights on SharePoint web application.




Step 1: Create a Class Library project in vs 2005


2. Add a reference to System.Web




3. create a simple Web Part that will print "Hello World!" . bellow class will inherits from the WebPart class in System.Web.UI.WebControls.WebParts. In order to render the Web Part we need to overrides the Render method. A HtmlTextWriter instance is passed into the Render method and can then be used to write markup to the page output.

Code:
using System;
using System.Collections.Generic;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
namespace HelloWorld_Webpart
{
public class HelloWorld :WebPart
{
//test Hello world webpart
protected override void Render(HtmlTextWriter writer)
{
// base.Render(writer);
writer.Write("Hello World from Vijay");
}
}
}

4. Attach ur class library with a strong name key
5. Add the statements
using System.Security;
and
[assembly: AllowPartiallyTrustedCallers] to AssemblyInfo.cs file.

6. builds the project and copy the dll( HelloWorld Webpart.dll ) to C:\Inetpub\wwwroot\wss\VirtualDirectories\37459(Port no of web application)\bin
7. Add the webpart detail as safe control entry in webconfig file as
Reflector tool(free download)