Prevent user from viewing all records?

Prevent user from viewing all records?

I have a report that is meant to be used by vendors to view only the records that are assigned to them.
All the vendor information is stored in a separate application, so I need to call a function to get the current user's ID (not the zoho user ID).

The report settings criteria doesn't support using function calls, so instead I'm embedding the report in an html page like this:
  1. if (thisapp.Global.CurrentUserIs("Vendor"))
  2. {
  3.       personID = common.getLoggedInPersonID();
  4.       query = "Assigned_Vendor.ID=" + personID;%>       
  5.       <div elName='zc-component' viewLinkName='Open_Corrective_Actions' params='zc_Header=true& ... &zc_ColMenu=false&<%=query%>'>Loading View...</div>
  6. <%}

The report is supposed to look like this, with only the records that belong to the user:

However, if I try to search for something, or use the show/hide columns menu, this happens:

It displays the search that was used to select that user's records and allows the user to clear the search, which causes the report to show all the records.

Is there any way to prevent the user from viewing the records that they shouldn't be able to access? Preferably without sacrificing the ability to search at all?



      Zoho Campaigns Resources


        • Desk Community Learning Series


        • Digest


        • Functions


        • Meetups


        • Kbase


        • Resources


        • Glossary


        • Desk Marketplace


        • MVP Corner


        • Word of the Day


        • Ask the Experts


          Zoho CRM Plus Resources

            Zoho Books Resources


              Zoho Subscriptions Resources

                Zoho Projects Resources


                  Zoho Sprints Resources


                    Zoho Orchestly Resources


                      Zoho Creator Resources


                        Zoho WorkDrive Resources



                          Zoho CRM Resources

                          • CRM Community Learning Series

                            CRM Community Learning Series


                          • Tips

                            Tips

                          • Functions

                            Functions

                          • Meetups

                            Meetups

                          • Kbase

                            Kbase

                          • Resources

                            Resources

                          • Digest

                            Digest

                          • CRM Marketplace

                            CRM Marketplace

                          • MVP Corner

                            MVP Corner




                            Zoho Writer Writer

                            Get Started. Write Away!

                            Writer is a powerful online word processor, designed for collaborative work.

                              Zoho CRM コンテンツ




                                ご検討中の方