How Do/Can You Store Current Value of a Field without Code? - InfoPath Dev
in

InfoPath Dev

How Do/Can You Store Current Value of a Field without Code?

Last post 08-07-2009 05:40 PM by Patrick Halstead. 14 replies.
Page 1 of 1 (15 items)
Sort Posts: Previous Next
  • 08-06-2009 11:59 AM

    How Do/Can You Store Current Value of a Field without Code?

    To give you an idea of my situation:

    I want someone to be able to reopen a form and choose another Contact in the Contact Selector.  I want to store the AccountId information of the contact they previously selected as well as the AccountId information of the contact they have now selected.

    Thanks in advance.

  • 08-06-2009 01:22 PM In reply to

    Re: How Do/Can You Store Current Value of a Field without Code?

    Hi InfoPathIC

    Not sure I understand the scenario completely. You have an InfoPath form that you are using to edit/select a contact right? But, there are cases where you want to launch a new form and have it refer to previous contact but allow choosing a new one. Is that correct? If so, you can pass a parameter from the first form to the second using a link that you create using a rule and concatenate a query parameter on the end. Then, the form uses Input Parameters to get the value and set it. qRules 1.7 (free) lets you do that without code. Go to Qdabra.com->Products->qRules and download and read the docs on input parameters. Should be easy.

    Cheers!

    Patrick Halstead
    Project Manager at Qdabra
  • 08-06-2009 01:52 PM In reply to

    Re: How Do/Can You Store Current Value of a Field without Code?

    Thank you for your reply Mr. Halstead.

    Sorry about the confusing scenario.  I'll try to clarify it better:

    Essentially, I am making a Workflow where, initially, the requestor will be limited to choosing 1 contact.  After the form is submitted to SharePoint, I will wait say 1 day for the person selected in the Contact Selector to approve the form by pressing a Approve button in the form.  If they do not approve it within 1 day, I want the requestor to go back into the submitted form (on SharePoint) and choose a different approver in the Contact Selector.  I also want to keeping track of the AccountId of the contact previously selected so that he/she will have the ability to approve the form as well.

    So this is all being done within the same form, not 2 separate forms.

  • 08-06-2009 05:04 PM In reply to

    Re: How Do/Can You Store Current Value of a Field without Code?

    Oh, that's easy. Just add a repeating table or section to your form to keep the assignees name, date-time of assignment, and status. The repeating section can be hidden to the user (or read-only) and you can add a rule to automatically insert the new item when they submit with a new assignment. To insert automatically without writing any code we provide qRules. Go to Qdabra.com -> Products and QRules 1.7. This won't work in web-based forms now, so if you need a browser form solution, let me know. We're addressing this in 1.8.

    Patrick Halstead
    Project Manager at Qdabra
  • 08-07-2009 06:31 AM In reply to

    Re: How Do/Can You Store Current Value of a Field without Code?

    Thanks again for the response.  F.Y.I., I am creating a browser form solution.

    I am really a newbie using repeating controls in InfoPath.  I dont even know how to pull a given field out of a repeating table (i.e. row 2 column 2 - how do I get that value out of a repeating table?).  Also, I am not understanding how you would store the previously assigned approver's AccountId.  All of the ways I think of involve a reference to AccountId, which will change when they pick a new approver in the Contact Selector.  Is there a way to strictly copy the characters and not the reference to AccountId without code?

    Sorry for all of the questions.

  • 08-07-2009 08:23 AM In reply to

    Re: How Do/Can You Store Current Value of a Field without Code?

    Are you looking to potentially store a list of previously chosen approvers, or just a maximum of 2 (the current and original or current and previous one?)  If it's the former, you will need code or something like qRules [and qRules may be one of a kind :-)], but if it's the latter, you can just use ordinary rules.  Rules can be triggered by a button (drag a button onto your form and open its properties), or they can be triggered when a field's value changes (open the properties for that field).  When you add a rule, you should see an option for "Set a field's value."  You can use that type of rule to copy a set of values to an other location in the form's data source.
    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 08-07-2009 09:28 AM In reply to

    Re: How Do/Can You Store Current Value of a Field without Code?

    Thanks Jimmy for the response.  I have tried using rules but the value of AccountId won't store.  For example, I have tried:

    When AccountId is not blank

    Then Set Field1 = AccountId

    as well as tests using contains etc. but it won't store AccountId in Field1 for some reason.

  • 08-07-2009 09:39 AM In reply to

    Re: How Do/Can You Store Current Value of a Field without Code?

     To what field is the rule attached?  Or is it on a button?

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 08-07-2009 09:48 AM In reply to

    Re: How Do/Can You Store Current Value of a Field without Code?

    I have tried attaching it to both AccountId and Field1 (a text field). 

    All of the rules I have made are behaving strangely when I have been testing them.  For instance, I want Field1 to equal 0 if AccountId is blank.  I boot up the form, Field1 is not equal to 0.  So I infer that AccountId is not blank even though its default value is blank and it appears blank.  Next test, I want to set Field1 to 0 when AccountId is not blank.  I boot up the form and Field1 is still not equal to 0.  This is where I give up and ask the experts for help :D.

  • 08-07-2009 10:01 AM In reply to

    Re: How Do/Can You Store Current Value of a Field without Code?

    Rules only fire when their related field's value changes.  If you've just "booted up the form," AccountId's value will not have undergone any change and Field1's value will be whatever its default value is.
    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 08-07-2009 10:06 AM In reply to

    Re: How Do/Can You Store Current Value of a Field without Code?

    Right, right.  Sorry I didn't clarify that I had tested it when selecting a contact in the Contact Selector.  I have also dragged and dropped the AccountId field, which is behaving normally (changes to domain/user when a contact is selected).  However, Field1 does not change along with AccountId.

  • 08-07-2009 10:27 AM In reply to

    Re: How Do/Can You Store Current Value of a Field without Code?

    Alright, I just published the form and discovered that the field changes in the browser, but not when I preview it with the client.  Wierd stuff...

    Still, it has not solved my problem.  It is merely referencing AccountId.  So when AccountId changes, so does the field.  This is not always what I want.  I want to save the AccountId so that it is stored so that it wont be changed when AccountId is changed.  I want to do this without code for ease of publishing purposes.

  • 08-07-2009 10:33 AM In reply to

    Re: How Do/Can You Store Current Value of a Field without Code?

    Well, you could add the condition "When Field1 is blank" to prevent it from being overwritten once it is set.  For anything more complicated, you'll need to figure out some sort of form logic, involving buttons, etc., but it doesn't sound like you will need to use code.
    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 08-07-2009 10:56 AM In reply to

    Re: How Do/Can You Store Current Value of a Field without Code?

    Thank you for explaining that Mr. Rishe.  Good problem solving on using the is blank to make it so the field would only get populated once.

    I hope we can get by with only 2 approvers (when the form is being held up).  We are doing this so that if a manager is out of office, the form won't get held up as badly.

    Thank you Mr. Halstead and Mr. Rishe for your expertise and your time.

  • 08-07-2009 05:40 PM In reply to

    Re: How Do/Can You Store Current Value of a Field without Code?

    You are most welcome!

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (15 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.