# Clean a Filter in a Form

**URL:** <https://www.dynamicsuser.net/t/clean-a-filter-in-a-form/24618>\
**Category:** Developers Forum\
**Created:** [February 25, 2010, 4:40pm UTC](https://www.dynamicsuser.net/t/clean-a-filter-in-a-form/24618 "2010-02-25T16:40:09Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![illo29081970](https://avatars.discourse-cdn.com/v4/letter/i/7ea924/32.png) [@illo29081970](https://www.dynamicsuser.net/u/illo29081970)\
**Post date:** [February 25, 2010, 4:40pm UTC](https://www.dynamicsuser.net/t/clean-a-filter-in-a-form/24618/1 "2010-02-25T16:40:09Z")

</div>

I am trying to execute one filter in a form but I get one error message. I think this filter is closed by a bad filter option.

How can I clean a filter data in a Form. There is any C/AL function to do do that??

---

<div class="post-metadata">

**Author:** ![thomasbrodkorb](https://avatars.discourse-cdn.com/v4/letter/t/2acd7d/32.png) [@thomasbrodkorb](https://www.dynamicsuser.net/u/thomasbrodkorb)\
**Post date:** [February 25, 2010, 4:46pm UTC](https://www.dynamicsuser.net/t/clean-a-filter-in-a-form/24618/2 "2010-02-25T16:46:19Z")

</div>

This function is called “RESET”

But in the end it depends on what exactly you are trying to do. What error message do you get?

---

<div class="post-metadata">

**Author:** ![illo29081970](https://avatars.discourse-cdn.com/v4/letter/i/7ea924/32.png) [@illo29081970](https://www.dynamicsuser.net/u/illo29081970)\
**Post date:** [February 25, 2010, 5:30pm UTC](https://www.dynamicsuser.net/t/clean-a-filter-in-a-form/24618/3 "2010-02-25T17:30:32Z")

</div>

The error is that there is no Referenece to service header.

I am trying to execute form 5915, and for a resource filter (a specific one) i get the message:

"The service header does not exist, identification fields and values:

Document Type=, order="

This is one error on Form 5911 AfterRecord on validation:

ServHeader.GET(“Document Type”,“Document No.”);

The service order was already processed and does not exist in service header in fact.

---

<div class="post-metadata">

**Author:** ![DaveT](https://avatars.discourse-cdn.com/v4/letter/d/958977/32.png) [@DaveT](https://www.dynamicsuser.net/u/DaveT)\
**Post date:** [February 25, 2010, 6:17pm UTC](https://www.dynamicsuser.net/t/clean-a-filter-in-a-form/24618/4 "2010-02-25T18:17:10Z")

</div>

Hi,

This looks like custom code. To stop the error use

IF NOT ServHeader.GET(“Document Type”,“Document No.”) THEN

ServHeader.INIT;

But why is the code there?
