• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1407
  • Last Modified:

Infopath 2010 - Set default value issue

Hello,

I am running a SharePoint 2010 and working on building a SharePoint list for inventory purposes. I a list with different content types. There is one column which is being added to all content types of the list.

I am trying to figure out a way to add a default value through the InfoPath form which does NOT use the default value of the SharePoint list. If I configure  the default value  in the InfoPath  form of one of the content types, then it configures this value as the default value of the SharePoint list. This becomes an issue when I work on the forms of the other content types. As soon I open the InfoPath form of the other content types, then InfoPath detects a change in the SharePoint list (because the default value of the column has changed) and wants to refresh the information from the SharePoint list.  I have to deny each time because I do not want the new default value being written into the field within my InfoPath form I am working on.

So my question is: Is there another way to write have a default value in a InfoPath form field which does not utilize the default value setting of the SharePoint list? I tried already with rules but for some reason if I add a rule in one form then it is being added to the other forms as well.
I hope someone can help.
Thank you
Mc2102
0
Mc2102
Asked:
Mc2102
  • 3
  • 3
1 Solution
 
meindertjanwCommented:
You can make a rule when the InfoPath form opens. If field is empty fill with value, else do nothing.
Then you do not need a default value, but the value of the field will be filled in by a rule. The rule triggers when the form opens and the field is empty.

Defining rules when opening a form can be find in the form properties.

Good luck!
0
 
Mc2102Author Commented:
Hello meindertjanw,

thanks for your response. I already had this idea as well but since all content types within the list use this field I am not sure how I should configure the rule so it fills in diffrent strings depending on what type of item I am adding.

Thank you
Mc2102
0
 
meindertjanwCommented:
Can't you specify that in the content types? For every content type a different default value?

Or give the content type a field with the content type name and let infopath determine from the value in the field which value needs to be the default one or filled in...
If you hide the field from views etc... the user will not be bothered with it.
0
NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

 
Mc2102Author Commented:
meindertjanw:

Your first approach was completely correct. Adding a rule which is being executed when the form opens totally did the trick and does not interfere between the different forms. I believe when I tried to create a rule doing this I did not create a rule which executes when the form opens but instead I created a rule which is being attached to the field. So when I added a 'Form Load' rule under the 'Data' tab within InfoPath everything works like a champ and this rule is being applied to each content types form.

Thank you so much for pointing me into the right direction.

Thank you
Mc2102
0
 
meindertjanwCommented:
Nice! Thanks for the points!
0
 
Mc2102Author Commented:
I did some more testing and even creating a rule specific just for one of the fields does no interfere with a rule for the same field in an other form. Not sure what I did wrong the first time but as staded before live is good now.
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now