Thursday, March 22, 2012

How to clear all data in repeating table with rule in infopath 2007

Repeating Table Structure
Your repeating table structure looks like an right image, suppose you want to clear all data from "JobHistoryRow" on button click with rule. If you apply simple rule for that, you will get warning message.
Now move to the solution. You need to add one group field and one string field in your data source by using Add a Field or Group link. Suppose group field name is "group1" and string field name is "age". Now open the rule window, click on "Add Action" button, action should be "Set a field's value". This action will take 2 parameters one is Field and second is Value. You will set Field is equal to "age" and Value is equal to "group1", save the rule and close your manifest file.

Now open your manifest file in "XML Editor" and search your that rule by name, suppose your rule name is "Clear Repeating Table". You will see "targetField=my:age", here we need to change "my:age" with "my:JobHistorySection/my:JobHistory/my:JobHistoryRow", save the form and close.

Now please open your manifest file in designer and open the rule "Clear Repeating Table", you will see the changes in it. Now time to publish the form and check the rule. It's working fine in my case.


 




2 comments:

  1. Good Work ather.... :) I also have a web dev blog http://3dreaction.blogspot.com

    ReplyDelete