Announcement

Collapse
No announcement yet.

Simple search site help

Collapse
X
 
  • Filter
  • Time
Clear All
new posts

    Re: Simple search site help

    Yes, this is possible. When creating the QueryObject, instead:

    RangerMSP.ObjectQuery<RangerMSP.Account> accountSearch = new RangerMSP.ObjectQuery<RangerMSP.Account>();

    one can call:

    RangerMSP.ObjectQuery<RangerMSP.Account> accountSearch = new RangerMSP.ObjectQuery<RangerMSP.Account>(linkOR);

    Hope this helps.

    Comment


      Re: Simple search site help

      I'm not sure I understand, sorry not a very experienced .net programmer

      Comment


        Re: Simple search site help

        Not really sure what you are saying with turning this into an OR statement.

        Dim ticketSearch As New CommitCRM.ObjectQuery(Of CommitCRM.Ticket)
        Dim tickets As New List(Of CommitCRM.Ticket)

        ticketSearch.AddCriteria(CommitCRM.Ticket.Fields.D escription, CommitCRM.OperatorEnum.opLike, "%" & Ctxt.Value & "%")
        ticketSearch.AddCriteria(CommitCRM.Ticket.Fields.R esolution, CommitCRM.OperatorEnum.opLike, "%" & Ctxt.Value & "%")
        ticketSearch.AddCriteria(CommitCRM.Ticket.Fields.N otes, CommitCRM.OperatorEnum.opLike, "%" & Ctxt.Value & "%")

        Comment


          Re: Simple search site help

          When create the ObjectQuery you can pass it with a parameter that sets it to OR, unlike the default AND.

          In any case, we've discussed it here and it seems like achieving what you're trying to do may be much easier with using the ODBC API that lets you query the database directly using SQL. With a single query you can merge results between database tables, perform joins, include advanced boolean conditions and anything else the SQL language supports.

          We recommend that you check ODBC API and see how it works for you. You can then continue using the API libraries, discussed above, to edit existing records, insert new ones, etc.

          Hope this helps.

          Comment


            Re: Simple search site help

            Thanks. I was thinking the same thing. Using a SQL script would be more beneficial in this case. I currently don't have plans to update/add records through the API (though that could change) so a readonly query is ideal.

            Comment


              Re: Simple search site help

              Have you created a Linkedserver to CommitCRM db?

              Comment


                Re: Simple search site help

                We're not following you on this one, please elaborate.

                Comment


                  Re: Simple search site help

                  Using the above examples how would I pass it that OR parameter I have searched around and am not seeing this anywhere.

                  Comment


                    Re: Simple search site help

                    Once you initialize the object with the OR condition, all query criteria that you add will have an OR condition between each other.

                    Comment


                      Re: Simple search site help

                      Thats my issue I cannot find how to initialize the OR condition. Using VB.net the info you gave me is not working. I cannot seem to find any info about (linkOR)

                      ticketSearch.AddCriteria(Ticket.Fields.Description , OperatorEnum.opLike, "%" & Ctxt.Value & "%")(linkOR)
                      ticketSearch.AddCriteria(Ticket.Fields.Resolution, OperatorEnum.opLike, "%" & Ctxt.Value & "%")

                      Comment


                        Re: Simple search site help

                        The OR should be added/set when the RangerMSP.ObjectQuery object is created and not with each criteria added. Then the condition between all of the different criteria that you add is OR.

                        Hope this helps.

                        Comment


                          Re: Simple search site help

                          Like so?

                          Dim ticketSearch As New CommitCRM.ObjectQuery(Of Ticket)(linkOr)

                          Comment


                            Re: Simple search site help

                            This should work:

                            Dim ticketSearch As New RangerMSP.ObjectQuery(Of RangerMSP.Ticket)(RangerMSP.LinkEnum.linkOR)

                            Comment


                              Re: Simple search site help

                              What would cause the application to not be able to load the CmtDbEng.dll? I have tried to disassemble the DLL with dotPEEK and it is "not supported". Commit is working fine, so I am assuming the DLL's are fine as well.

                              Comment


                                Re: Simple search site help

                                It's hard to tell. This is probably not related to the dll itself. One thing though - try running your app from the folder the dll is found under ../ThirdParty/... folder, and do not simply copy the dll elsewhere as it has other dependencies to other dlls, etc. that are located in the same folder.

                                Comment

                                Working...
                                X