Coming soon: Your brand new Help Center & Community! Get a sneak-peek here

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.emailAddress,a0.number2 from contact a0 where (((( = ? and a0.emailAddress = ?)))). Error:[Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid column name 'emailAddress'. ('abc', '')


        SearchEngine seContact4;
        //  seContact4.addField("contact.userdef_id.string06");

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

        if (seContact4.countRows() > 0) {

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

RE: byPassNetserver fails


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());

Von: 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 ?




Von: 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")

Von: Michel Krohn-Dale 28. Nov 2019