Extended Searches (Unwanted Query Links)

If you have questions or if you want to share your opinion about Aware IM post your message on this forum
john
Posts: 113
Joined: Tue Jul 25, 2006 10:48 am
Location: UK

Extended Searches (Unwanted Query Links)

Post by john »

Hi

I have looked through the forum and did find a similar post to this one (Unwanted Query Links) but I didnt really understand the answer. My appolagies for this.

Basically I will require users to login to my system and be able to view particular instances of another business object depending on there credentials. I have dealt with this fine by having a unique identifier (for the business object) that starts with one of the the users credentials (unique) followed by an incremented number. My searches are filtered according to this information. When the results are dispalyed however the logged in agency is able to extend the search and ruin all my good work.

Is there a way to stop this. I think the print icon and the export icon are great but its just this extended search I would like to make un-available

Best Regards
John
aware_support2
Posts: 595
Joined: Sun Apr 24, 2005 2:22 am
Contact:

Post by aware_support2 »

Hi John,

"Unwanted query links" suggests to run a process instead of a query. It assumes that the users will not just see the query results, but do something with them. For example, select an item in the list to view its form, or select a few items and perform an operation on all selected items. Unlike queries, with such a process the extended search and other options will not be shown.

However, based on your description I would suggest a different approach. Instead of specifying restricting conditions in a query, you can add a protection rule to the object used in the query, for example:

If Agency <> LoggedInEmployee.Agency Then READ PROTECT Agency FROM Employee

The condition of this rule should be the reversed of the one you use in your query for filtering results. The advantage of this approach is that the system will automatically hide the restricted instances from the users everywhere including results of any queries, reports, etc. You can then safely remove the filtering conditions from your query and let the users perform extended search. They will not see the restricted instances.

You can find more details on READ PROTECT in the Aware IM User Guide.
Aware IM Support Team
john
Posts: 113
Joined: Tue Jul 25, 2006 10:48 am
Location: UK

Post by john »

Hi

Thanks very much for that, with a bit of juggling round that gave me the idea to get exactly what I wanted. I have the query working and the extended search does not pull up any unwanted records so he can stay.

Just a small problem, nothing major. When and "Agency" does query "Employees" the record count at the top counts all records in the system rather than the ones visible. Is there a way of sorting this or getting rid of it?

In the mean time I may have a look at running a process instead

Thanks
John
aware_support2
Posts: 595
Joined: Sun Apr 24, 2005 2:22 am
Contact:

Post by aware_support2 »

Hi John,

The record count shows the number of instances found by the query and visible to the user. This number can be smaller than the number of all instances in the system.

You can sort the displayed query results by specifying an attribute name to sort on.
Aware IM Support Team
ab042
Posts: 326
Joined: Mon Jul 17, 2006 4:11 am

Post by ab042 »

I believe John is correct. It should be showing the instances found by the query but it doesn't appear to be working.
Unless of course I'm doing something wrong, which is always a possibility.

As an example: I have a rule very much like the above that has a READ PROTECT statement on the Business object to restrict records available to the user. This restriction is working great, with one a small problem.

When I perform a Query on the BO that has the restriction. I get the correct records displayed but a very wrong count.

The RECORDS COUNT in the title bar is the total records in the object.
Example: Results for XXX search 1 to 25 of 4860 (as if this is Page 1 of 195 pages of data)

When in fact only 5 records are shown and that is correct. It even has the page advance buttons to go thru the 195 pages as if there is more. Of course selecting it and nothing else is displayed. Very, very complicating for the user.

Besides releasing information to the user on the record counts that shouldn't be available to them. The counts should be the results of the query not the total records with all the non-existing pages. Besides your releasing information to the user on the record counts that shouldn't be available to them.
ab042
Posts: 326
Joined: Mon Jul 17, 2006 4:11 am

Post by ab042 »

UPDATE to my post, that may be helpful.

I just learned if I do a query that includes logic for the search it will show the number of records for that search. Not the records, but the record counts for the search. Regardless if the user has access to the records or not via the READ PROTECT.

So if your looking for BROWN and 5 records have BROWN and you have access to them you see the 5 records and it shows 5 records.

If you do a search for TOM and 25 records have TOM and you don't have access to them you see NO RECORDS however the count shows 25.

If you want to see ALL records you have and you leave the query blank it will show only the records you have access to. But the count will be the total number of records and the number of pages as if they exist when in fact they don't.
john
Posts: 113
Joined: Tue Jul 25, 2006 10:48 am
Location: UK

Post by john »

Hi

I just wanted to post that what ab042 is exactly the problem I am having but I think he explained it better than me.

I am only working at the minute with very small amounts of data (for testing purposes) so I have not experienced the multiple pages problem yet but this will also be an issue for me going forward.

FAO: Support
You mentioned running a process instead and this would take away some of the options in the title bar. I assume this includes the record count? I havent actually tried it yet. However it is nice for users to be able to print and export things to CSV as we will hopefully be using this information to populate other databases

Do you have any other suggestions on this matter?

Sorry to be a pain
John
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

The invalid record count is the unfortunate limitation of READ_PROTECT. We cannot fix it easily.

The record count issue notwithstanding, the READ_PROTECT approach is definitely the one we would recommend as the solution for John.

So, I guess, the question is whether you, guys, can live with the limitation of the record count?
Aware IM Support Team
ab042
Posts: 326
Joined: Mon Jul 17, 2006 4:11 am

Post by ab042 »

On a scale of 1-10, 10 being very bad. I would place this issue as a 2 for me at the moment. Although I would suspect it to become a bigger issue once we import our 300,000+ records and give users access to the app using different read protect rules.

I can live with the limitation and I'll keep you posted if it become an issue.

One quick option may be for you to just remove any reference to record counts if the BO has a read protect in effect?

The way it is currently, I believe users are going to be calling the help desk saying they are loosing records. Or that the computer is not showing all the records, etc.

If the count is not accurate, I would prefer it to not be displayed. In fact, I'm not sure I ever need a record count to be displayed unless I place it in a report somewhere.
john
Posts: 113
Joined: Tue Jul 25, 2006 10:48 am
Location: UK

Post by john »

Hi

I have just realised that you can create a custom presentation for the business object and use this instead of the standard one to display your query results. This means you dont have to have a Results Count at the top of the page (also the extended search is not neccessery either).

I have been playing around with this for a while now and it seems (at this stage) to be a viable option (although it is a bit long winded to get something that looks as nice as the forms provided).

As I would like to give the users the option to export and print I have come up with this solution. I was going to drop a couple of image objects at the top of the page (Print and Export gifs found in one of the subfolders of AwareIM) and hyperlink them to a Process (one to print and one to export).

My question is:
Can you see this being a solution to my problem?
Do you have any hints on the code for getting the currently displayed document to print and export (anything like the buttons available on the standard form would be great)? I know that may sound like a bit of a daft question but I dont want to spend too much time on this if somebody can tell me now its not going to work. I discussed the result count limitation with my boss and he didn't really like it. So I could do with coming up with something as quick as possible to get me moving again.

As a side note I have also noticed that when I hyperlinked to the business object to view that particular instance of the obect, I only have the option to edit and not view, which surprised me a little. To solve this I will just have to turn these particular links off, but this is a shame as it would be nice for the user to be able to view a selected object with this method.

Sorry about the length of my post I know its going to be a chor reading all that!

Best Regards
John
aware_support2
Posts: 595
Joined: Sun Apr 24, 2005 2:22 am
Contact:

Post by aware_support2 »

> Can you see this being a solution to my problem?
Yes, this can work even better than the generic system functionality. Once you made the effort to design an object presentation, you can reuse its design to create a report. You should use exactly the same query for the report and invoke the report from the presentation via a hyperlink for Print operation as you planned. The report will be generated in printer-ready PDF format that will look almost identical to the on-screen presentation except that it will be nicely paginated.

For Export link you can invoke an operation that generates a document from a template. You can create the template as a plain text file containing a tag with function LIST in it. This is a very useful function that iterates through multiple instances and outputs their data on separate lines. The query used for LIST should again be the same as the one used for the presentation.

> ... when I hyperlinked to the business object to view that particular instance of the obect, I only have the option to edit and not view ...
You can use a process for the hyperlink that will have a single rule in it:

VIEW MyObject NOEDIT
Aware IM Support Team
john
Posts: 113
Joined: Tue Jul 25, 2006 10:48 am
Location: UK

Post by john »

Ok I am a little stuck. I got the
View Temp NoEdit bit working a treat (thanks for that) but I am still struggling to export an object. It says operation successful in Operation Mode but it doesnt actually do it.

I have the code:
EXPORT Temp TO 'c:\TEMP\Test.csv'
Now obviously this is wrong but I am confused as to how?

Also is it not possible here to replace "Temp" the (name of my business object) with something that just references what is currently on the screen, so I can use this process for all of my exporting needs. The way I invisage this at the moment is I will have to create a new process for everything I want to be able to export?

I hope this makes sense
John
john
Posts: 113
Joined: Tue Jul 25, 2006 10:48 am
Location: UK

Post by john »

Sorry but I am going right back to the start of the feed now . .

When I read protect my business object I cant enter new instances of the object as access is denied! Perhaps I haven't done it properly in this case but I thought I would mention it (I did copy the code you gave me and made it fit my objects, so nearly word for word). I have only just realised as I have attempted to put e few new temps into the system and thats the message I got.

As I am now using my own forms for my reults this no longer matters as I dont have the extended search on my results page anymore which is what my original question was about? Perhaps this solution should have been mentioned earlier? Just a thought, maybe something for future reference.

My previous comment to this one still stands as I am still stuck with the exporting.

Thanks again
John
aware_support
Posts: 7525
Joined: Sun Apr 24, 2005 12:36 am
Contact:

Post by aware_support »

Regarding export - please try to replace backward slashes in the directory name with forward slashes:

EXPORT Temp TO 'c:/TEMP/Test.csv'

Regarding READ PROTECT and creation of new instances. If you want to enable creation of new instances you can modify your READ PROTECT rule:

If NOT (Agency IS NEW) AND Agency <> LoggedInEmployee.Agency Then
READ PROTECT Agency FROM Employee
Aware IM Support Team
john
Posts: 113
Joined: Tue Jul 25, 2006 10:48 am
Location: UK

Post by john »

Sorry I should of said I have already tried the code with forward slashes. I have also (just to double check) copied and pasted the code you left here and it didnt work either

Also my other question. . .
In this code do I have to reference "temp" or is theire a way of just referencing what is currently displayed on the screen? So I could use the same code for all of my forms?


Thanks
John
Post Reply