.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
Kaviya Balasubramanian
Imran Ghani
Post New Web Links

Infopath form timesheet question on rounding time and using code

Posted By:      Posted Date: October 13, 2010    Points: 0   Category :SharePoint
 

We have a timesheet form that has 4 time fields:  Start Time, End Time, Actual Time and Billable Time. 

Our Start Time, End Time and Actual Time buttons and field calculations work just fine, but we want the 4th field to calculate the billable time by rounding UP to the quarter-hour.

For example:

Start Time - 9:00am

End Time - 11:20am

Actual Time -  2:20

Billable Time - 2:30 (or 2h30min)

 

I'm new to Infopath and not sure how we would accomplish this.  What type of code would I need and can I even use code on that Billable Time field to accomplish this?

 

Thanks for any help you can give me!

 




View Complete Post


More Related Resource Links

Infopath form return XMl code during workflow task

  

1.     Review 7777.xml.

2.     Perform the specific activities required for this task.

Use the Edit this task button to mark the task as completed. (If you cannot update this task, you might not have access to it. Click here to request access.

Extracting Infopath form templates (with code behind) from a farm

  

Hi,

I am in the middle of a migration of MOSS 2007 on server 2003 R2 to server 2008 r2, to be in the position to migrate to SP 2010. I am trying to extract form templates (with code-behind) from the old farm to the new farm. I did not set this farm up myself, so I would have copies of everything that was deployed to the farm, but now I don't. I have tried grabbing the .xsn from the Form Templates form library, and the form comes over, but no code behind, it says, The VB or C# project for this form template cannot be found. I have also tried extracting the solution files, and changing the file ext to .cab and opening the file up, only to find nothing very useful.

I need to extract and open the code up because I believe one of the forms that sends emails dynamically, is pointing to an old exchange server, because the emails are not getting through, and the exchange server was recently changed.

Any ideas would be much appreciated.

 


Best way to Deploy InfoPath form with connection information and managed code

  
Hi, Whats the best way to deploy an InfoPath form with connection information and managed code. Is there way I can create a deployment package for this? Thanks in advance, San

Get ListItemID in code behind an InfoPath Form

  

I have a few cases where I'm using an InfoPath form in a SharePoint list (for instance, as the default content type, so that clicking "New" in a Document Library opens an InfoPath form in the browser).

In the form's code-behind I would like to programmatically create a new item in another list, setting a Lookup Field's value there to the ListItemID of the item associated with the open InfoPath form. But I can't find any way to identify the ListItemID (or GUID) of the InfoPath form.

Does anyone know how to get the ListItemID of an InfoPath form in a SharePoint list, from within the InfoPath form's code-behind?

Thanks!


InternalStartup method erro when publish InfoPath form with custom code

  

Hi All,

I created a SharePoint Form Library, and added a button in the form. Then, by following the steps of adding custom code. I was trying to add codes to the button click event in VSTA. When I try to publish this form to my SharePoint library, I got an error message say:

"The form template has been published to the server but it can only be opened in InfoPath Filler.

There is an error in the InternalStartup method of form code.

There may be additional error detials in the Design Checker task pane."

However, I did not make any changes to the InternalStartup. and then I tried to create another SharePoint Form Library Form in InfoPath Designer, and just add click event, but did not input any code, I got the same error. So I believe this is caused by either environment or the configuration of SharePoint Server. Could anyone help me out? Thanks!


Get Infopath form URL from code C#

  

Hi

I need to include a hyperlink on the print view of an Infopath form. Now this is all good.

The problem is that the form does not close when submitted and then gets emailed to where it needs to go, so the url does not refresh. What I have done is to request the url:

XPathNavigator xnMyForm = this.CreateNavigator();
      XmlNamespaceManager ns = this.NamespaceManager;

      string strURL = HttpContext.Current.Request.Url.ToString();
      xnMyForm.SelectSingleNode("/my:myFields/my:secHidden/my:txtURL", ns).SetValue(strURL);

And then I set the hyperlink to the txtURL datasource.

So what happens is that when the email is sent without closing the form and reopening it and clicking on the hyperlink, I just get a new blank form. Only when I close the form and reopen it do I get the form that was submitted.

How can I get the datasource to refresh with the new url that is created for the specific saved form? Is there a place where it is saved? I have checked in the xml source of the saved form but I cannot see anything there..!


is there a way to populate an infopath form with just plain code?

  

I'm what you consider a n00b - i've only done some basic stuff with sharepoint - debugged some stuff, but now i need to find if something's possible.

 

Here is what i have:
1) I have an infopath form that is hosted on our sharepoint site
2) I have a workflow that routes emails and all that fun stuff and allows end user to "complete" a workflow.

Currently users start workflows in their browsers.

Here is what i need to do:

I have created a webservice to which i will have my users send me information (same information as the infopath form collects today)

but with the twist that i will have some sort of a web app that will PUSH this information and "fill out" the infopath form thus starting the workflow process - this all to be done in the background.

My infopath forms information is stored as .xml files within sharepoint - and i'm not sure how i can create these without physically opening up the form in a browser - instead just send information to the form and POOF have it start the logic of the workflow.

Is this possible? 
Please point me in the right direction 


Infopath Form Services 2007 pass URL from one XSN to another without code

  

Is it possible to pass the current URL value in an opened Infopath Form to another Infopath form withouth using code? Basically I am trying to pass variables from one XSN to another & the requirements are such that I cannot combine the forms & I am unable to use C#.

Just wish I could get a handle on the Site Referrer value out of the box in Infopath without code. Javascript might be ok if I can embed it in the XSN file and then somehow call it from the XSN file on submit. Is that even possible? Or can this be done without code at all?


Problems with InfoPath form with code to deploy in SharePoint 2010

  

 

I try to deploy a form in sharepoint 2010 that will be used by the workflow as Task form. The form is deploy with the feature (in the folder of the feature). This form has strong assembly and it is installed in the GAC. However looks like the form look the assembly in the folder of the features how Can I make teh form to look the assembly in the GAC??

I use infoPath 2010, VS 2010 and SharePoint 2010.

Thanks for your help!!

 

Could not load file or assembly 'file:///C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Template\Features\[FeatureName]_Feature1\Forms\[AssemblyName].dll' or one of its dependencies. The system cannot find the file specified.


Deploying Infopath 2010 form with code to sharepoint 2010

  
I have created infopath 2010 forms with custom code and I want to publish these forms as the web browser form. I can preview these forms and everything is working fine.  But when I try to upload  (full trust option) these form templates in the central administration I get the error Object Instance is set to null. Does anyone have an idea what can be the cause of it?

Problems with InfoPath form with code to deploy in SharePoint 2010

  

 

I try to deploy a form in sharepoint 2010 that will be used by the workflow as Task form. The form is deploy with the feature (in the folder of the feature). This form has strong assembly and it is installed in the GAC. However looks like the form look the assembly in the folder of the features how Can I make teh form to look the assembly in the GAC??

I use infoPath 2010, VS 2010 and SharePoint 2010.

Thanks for your help!!

 

Could not load file or assembly 'file:///C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\Template\Features\[FeatureName]_Feature1\Forms\[AssemblyName].dll' or one of its dependencies. The system cannot find the file specified.


Infopath Question: XPath code to remove domain name from AccountID field in Person/Group Picker

  

I have an infopath email based submission form where I am using the Person/Group picker as a way for people to find people in the active directory to CC the form to. I was using the field "DisplayName" in the control and discovered that when you try to CC several employees, that it would disrupt the rules and you can't send the form.

I want to use the field "AccountID" but it includes the domain before the email alias (for ex. REDMOND\johndoe). Is there a formula code I could use to remove the domain from every email alias. Right now my CC formula is concat(SubmitterAlias, "; ", DisplayName)


how to change infopath form time (function now())

  
my infopath form has a default time now() for the field. my sp2010 server has correct time and time zone, for example 4:11pm EST now, but when open the form in sp2010 web browser form, it shows 1:11pm. any idea how to fix it?
however, if I do preview, it shows correct ime 4:11pm

two user edit infopath form same time.

  

infopath form with 2 field. Field1 and Field 2.

User 1 open the form and fill in Field1 ,but not yet click submit.

User 2 open the form and fill in Field2.

User 2 click submit. User 2 open the form and see the value of Field2.

User 1 click submit.

When open the infopath form, Field 1 was there ,but Field 2 was not. It is because xml of User 1 override xml of user 2.

On the submit event, i just basiclly do Dataconnections["SharePoint Library Submit"].Execute().

How to get around this?


Can this code be setup to run against the whole database instead of just 1 record at a time?

  

We have made some changes to this code to start capturing 1 new field of data and updating it as new records are added. But there is currently about 120,000 records more or less.. those records of course dont have the new field populated with anything..

We would like to run this logic that already in place and run it against the tables to update the fields 1 time. I think to make it easier, if it can be setup to expect the "valueTwo" variable, so that we can run it againt the individual codes instead of doing all the records at one time.. there are codes that only have a few records, so it would be best to test initially against the small code group.

thanks.

  
            strSqual = "insert into trans (trans_type_name, trans_date,sys_id,mod_user_id,show_ind, remoteCode, techName) values('" & valueTwo & "','" & TransDate & "',"&strSystemID&", 1,'T', '" & dbQuote(strUser) & "', '" & strTechName & "')"        
  
            getStaticRecordSet(strSqual)   
            'get the new transaction_id out for just inserted alarm   
            strSqual = "select max(transaction_id) as transaction_id from trans"  
            set rst = getStaticRecordSet(strSqual)

InfoPath 2007: Designing Form Templates With The New Features Of InfoPath

  

InfoPath 2007 is an XML forms designer and editor, and a fully featured and integrated member of the Office family. This article takes a sneak peek at some of its new features.

Scott Roberts and Hagen Green

MSDN Magazine August 2006


XML Comments: Document Your Code in No Time At All with Macros in Visual Studio

  

Starting in Visual Studio 2005, XML documentation support will become available in Visual Basic and C++ as it has been for C#. However, making full use of the many comment tags will take a little extra work In this article, the author shows how Visual Studio macros can be used to automate the creation of XML documentation and creates macros that write large sections of comments with just a keystroke.

Tony Chow

MSDN Magazine July 2005


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend