How to refresh view in this scenario?

Hi,

I am opening a document , and changing the claim number on the form, then clicking on Add New button.

The button should check if the claim number which I am changing already exists in the database and post the message “Claim Number already exists” …my claim number should be unique.

I have the following code in the Add New button:

@If(leadclaim = leadclaim_1;@Success;@IsError(@DbLookup(“”;“”:“”; “UniqueView”;leadclaim;0)); @Success; @Prompt([Ok];“Unique Field”;“Claim# already exists”) & @Command([EditGotoField];“leadclaim”) & @Return(0));

@Do(@PostedCommand([FileSave]); @PostedCommand([FileCloseWindow]); @PostedCommand([Compose]; “”; “Add New Claim”))

If the claim number is unique, the button wil save the current form and open a new form.

But when I try changing my claim number for eg:

first it is 555, am changing it to 556, this 556 already exists…so am getting a pop up msg…but if i change back to the same claim number to 555…then also am getting the pop up msg…

But actually the 555 claim is only once in the database…

so how to refresh the "Unique view "?

What other code will I write under the Add New button to refresh the view…? Pls help…

Thanx in advance !!

Subject: How to refresh view in this scenario ?

Without looking at your code or what you’re doing that closely, you’ll need to do a non-cached lookup, so the @dblookup looks like:

@dblookup(“Notes”:“NoCache”;“”;“UniqueView”;leadclaim;0)

See if that makes a difference.

Dan

Subject: RE: How to refresh view in this scenario ?

thanks a lot…it works perfect…