byPassNetserver fails

First of all. Can somebody explain to me the real pros of using bypassNetServer? 

Will the queries run faster ?

I have the following code which goes through fine if I remove bypassNetServer and gives an error message if I put it back.

Is there another way of getting emailAddress when using byPassNetServer ?

Also, how will the addCriteria with some combos of OperatorOr work ?

What is by the way the function of "->" notation in CRMScript ? 

 

I get the following error: 

//DbODBC::FatalException: Query: select a0.contact_id,a0.name,a0.emailAddress,a0.number2 from contact a0 where ((((a0.name = ? and a0.emailAddress = ?)))). Error:[Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid column name 'emailAddress'. ('abc', 'abc@abc.no')

 




        SearchEngine seContact4;
      	seContact4.bypassNetServer(true);
        seContact4.addField("contact.contact_id");
        seContact4.addField("contact.name");
        seContact4.addField("contact.emailAddress");
        seContact4.addField("contact.number2");
        //  seContact4.addField("contact.userdef_id.string06");
        //seContact4.addField("contact.userdef_id.string05");

        seContact4.addCriteria("contact.name", "OperatorEquals", fullName, "OperatorAnd", 3);
        seContact4.addCriteria("contact.emailAddress", "OperatorEquals", email, "OperatorOr", 3);


        seContact4.execute();
        if (seContact4.countRows() > 0) {

            //log("4 Vi får treff på kontaktnavn : " + seContact4.getField("contact.name") + " med contact_id" + seContact4.getField("contact.contact_id"));
            return seContact4.getField("contact.contact_id").toInteger();
        }


RE: byPassNetserver fails

Hi,

Running SearchEngine queries thru NetServer will give you access to some virtual fields, ie emailAddress. These fields are constructed for you, but still able to get thru dotsyntax if you need for some reason to bypassNetServer. 
However if you bypassNetServer you are running queries outside sentry restrictions, and might get access to data you should not.

If you want overview of how your query will look when using criterias, run print(seContact4.buildSql());

Av: Michel Krohn-Dale 28. nov 2019

RE: byPassNetserver fails

Thank you Michel.

So I wont have any gain in performance when using byPassNetServer ?

It does not look like I have access to emailAddress when using bypassNetserver... What different do I have to do to achieve that ?

 

Ummair

 

Av: Ummair Tahir 28. nov 2019

RE: byPassNetserver fails

Well as you are querying without sentry when using bypassNetServer, it will be faster. But should be used with caution.

As I said, you only have access to virtual fields when querying thru NetServer. contact.emailAddress will be almost the same as seContact4.addField("contact.(Email->contact_id).email_address")

Av: Michel Krohn-Dale 28. nov 2019