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

Infopath 2010 Make control read only if it contains data

Hello,

I am running SharePoint 2010. I have a list with several Lookup columns. One of the Lookup columns if called 'Air Card'. I would like to create a InfoPath that disables the control for 'Air Card' if it contains data. If it is empty then I want the control to be enabled.

And this is where my problem starts. I created a rule as the one displayed in the screenshot below hoping that the field would be disabled if it contains data. if it does not then it would be enabled. This is the function I try to accomplish but now everytime try to add or edit the list item the control is disabled. I tried several other for the confition like 'matches pattern' etc but none of them keep to be working.
If the trick is that the field is a Lookup field ?

Please help.
Thank you
Mc2102 Scrrenshot of Infopath rule
0
Mc2102
Asked:
Mc2102
  • 2
  • 2
1 Solution
 
meindertjanwCommented:
Are you using the InfoPath client to make the form?
If you're building the form in SharePoint, try using InfoPath.

In InfoPath there is a rule to hide or disable fields when a predefined condition is true. If the field will not be disabled, the rule isn't correct...

You can also put the field in a section. Show the section only if the field is empty...
0
 
Mc2102Author Commented:
Yes I am trying to use Infopath and the the type of rule you are talking about but the column is now permanently disabled. I believe that has something to do with the fact that the field is a Lookup column and even if the column looks empty it is not.

This sections you are mentioning...is that within Infopath or SharePoint designer?
0
 
meindertjanwCommented:
The sections are InfoPath sections. There you have Optional sections, choice sections and just sections...

But I think you will get the same problem, because when the field is never empty, the rule won't work...
But you can give it a try...

With Xpath you can do a lot of data manipulation...Like filling the field with a default value when it's empty or having a value that it looks empty. Be creative and find a good solution...
0
 
Mc2102Author Commented:
Thanks
0

Featured Post

Get quick recovery of individual SharePoint items

Free tool – Veeam Explorer for Microsoft SharePoint, enables fast, easy restores of SharePoint sites, documents, libraries and lists — all with no agents to manage and no additional licenses to buy.

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