You are viewing limited content. For full access, please sign in.

Question

Question

WebAccess search URL

asked on June 19, 2017 Show version history

So not sure why, but no matter what search we build with the URL syntax from the help file we cannot seem to get it to work.

We have the initial string of:

http://servername/laserfiche/browse.aspx?db=repositoryname#/?

This works and takes us to our repository.  Then we add search= to the end of that and put in our syntax.  We have tried a simple template name, doc name, field value, and may other things but nothing seems to work.  

For example we tried search={LF:templateid=4} and we get a syntax error

or search={[Contracts]:[Contract ID]="12"&{LF:Name="*",Type="F"}

Not sure what seems to be the issue.  Any ideas?

 

Thanks,

Chris

0 0

Replies

replied on June 19, 2017

Your base url seems to have an extra "/?" at the end, though I don't know if that's relevant.  Can you post one of your sample urls here?

0 0
replied on June 19, 2017 Show version history

Sure, what is odd is that if I use the link internally I get a warning says the template does not exist (which is expected since I dont have that template).  On the clients server I get the screenshots like in the post above.

http://servername/laserfiche/Browse.aspx?db=reponame#/?search={[Contracts]:[Contract ID]="100024"} & {LF:Name="*", Type="F"}

0 0
replied on June 19, 2017

Have you tried url encoding the query string?  Characters like "&" and "=" have meaning in URLs so you have to escape them.  What if you try a link like: http://servername/laserfiche/Browse.aspx?db=reponame#search= %7B%5BContracts%5D%3A%5BContract+ID%5D%3D%22100024%22%7D+%26+%7BLF%3AName%3D%22%2A%22%2C+Type%3D%22F%22%7D

1 0
replied on June 19, 2017

Brian's suggestion should work. I ran into the same issue when I was first experimenting with custom URLs and it started working correctly after I encoded the string.

0 0
replied on June 20, 2017

Had to remove the +'s but this seems to work.  We have done it before but we are simply trying to create an html item on a Forms that launches a search in WebAccess.  We have done it before but for some reason it is really difficult.  The Custom HTML item in forms seem to always try and autoformat while you are typing.  Here is what we have.  If I try to remove the & or anything it just removes things and tries to autoformat and not really sure where to go from here.  The link opens in a new window, I get to the repository, but the search does not complete

<a class="links" id="a2" onclick="window.open(href='http://servername/laserfiche/Browse.aspx?repo=reponame#?search={[Contracts]:[Contract ID]='+document.getElementById('Field58').value+'}&amp;{LF:Name=*, Type=F}&amp;view=search'); return false">Click to view</a>

0 0
replied on June 20, 2017

The search string in that example isn't encoded.  What happens if you url encode it?

0 0
replied on June 20, 2017 Show version history

Have tried multiple iterations and can never get it to work (usually it breaks the link all together as the formatting changes).  I'll see if the clients programmers can come up with an easier solution.

 

Thanks

 

Edit:  Also we are using this syntax at another client and it works. (non-encoded)

 

<a class="links" id="a2" onclick="window.open(href='/laserfiche/Browse.aspx?repo=dev#?search={[GBA]:[GBAID]='+document.getElementById('Field320').value+'}&amp;{LF:Name=*, Type=F}&amp;view=search'); return false">Click to view</a>

 

Could it be the version of webaccess?  10.0.5.  I again took the same code we tried there, replaced the server/repo name and field name to something we have internal and it works.

0 0
replied on June 21, 2017

Just thought I would update this as I seem to have it working.  The only part of the URL we had to encode was the = sign but only after the field name.  Not sure why that would be.

So the last part of the url is ?search={[template]:[field]%3D'+document.getElementByID('Field58').value

Not sure why only that had to be encoded but it seems to pass the variable.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.