This solution selects the default value on the creation of a new form record. It does not update existing records with no value selected to the default value.
Here is how to set a default value for a lookup:
Open the form in infopath.
Click the "File" tab ->
Click the "Form options" button in the "Advanced Form Options" section ->
Select the "Advanced" category (see screenshot 1) ->
Click the button "Edit Default Values" ->
Click the "+" on "myFields" ->
Click the "+" on "dataFields" ->
Select the lookup field you wish to set a default value for by clicking on it (see screenshot 2)->
Enter in the default value for the lookup field. Remember that the default value here is the ID of the record, not the name. See screen shots below ->
Click "OK" then "OK" again and first test functionality using "preview" button in infopath ->
Verify your lookup is now populating with a default value ->
Publish the form.
Screenshot 1, Advanced Form Options from file tab
Screen shot 2, Setting ID of default value

No comments:
Post a Comment