Today I’m going to show you how to make your code in InfoPath much much better. Consider the two examples below.

The second example (getsetgoodsample.cs) is obviously easier to read. This code is very clear and maintainable. So how did I do that?

First add the getter and setter codes for string and boolean to your project. I usually create a GetSet.cs file and add the codes below.

What you have now are codes you can reuse in every InfoPath project. You can use it to your fields that you wish to have a getter/setter.
Now creating the getter/setter your DocumentNumber and IsNew is easy. Just add the following files to your project.

Be sure to check out my InfoPath Starter Form which contains all the codes to jumpstart your next InfoPath project.

There are no comments so far

Leave a Comment

Don't worry. We never use your email for spam.

Don't worry. We never use your email for spam.

Contact us

We're not around right now. But you can send us an email and we'll get back to you, asap.

Questions, issues or concerns? I'd love to help you!

Click ENTER to chat