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

Quote Connector Advanced Product Search

Hi,

I'm creating a Quote Connector to our NAV ERP. I have been working on creating a custom search for the Product and although I do appear to have it working, I have 2 extra fileds I have not coded for and want to remove them if possible?

My code for adding the two fields is as below:

public override FieldMetadataInfo[] GetSearchableFields()
{
var fields = new List<FieldMetadataInfo>();

fields.Add(new FieldMetadataInfo()
{
Access = FieldAccessInfo.ReadOnly,
DefaultValue = "",
DisplayDescription = "NAV Product Code",
DisplayName = "NAV Product Code",
FieldKey = "NavCode",
FieldType = FieldMetadataTypeInfo.Text,
ListName = "",
MaxLength = 20,
Rank=1
});

fields.Add(new FieldMetadataInfo()
{
Access = FieldAccessInfo.ReadOnly,
DefaultValue = "",
DisplayDescription = "NAV Product Description",
DisplayName = "NAV Product Description",
FieldKey = "NavDesc",
FieldType = FieldMetadataTypeInfo.Text,
ListName = "",
MaxLength = 20,
Rank = 2
});

return fields.ToArray();
}


When I got to my custom search, I see the following:

How do I remove/disable these fields as this is not relevent in NAV?

Also, when I was starting to add fields to the custom search, I inistially added Code and Description, but these seem like pre-defined fields, is this correct and do they relate to the Object 'ProductInfo' used in the connector.

Finally, I would like to use one of the extra fileds in the 'ProductInfo' object. How do I get this field to be displayed on the Add/Edit Product screen?

Cheers

Rich

 

RE: Quote Connector Advanced Product Search

Hi Rich,

quick question, what class does your connector override?

 

Best regards,

Tor Thorbergsen

Af: Tor Thorbergsen 11. okt 2017

RE: Quote Connector Advanced Product Search

Hi Tor,

My Class overrides SuperOffice.CRM.QuoteConnectorBase.

I have also added the entry in CanProvideCapability(string capabilityName) for CRMQuoteConnectorCapabilities.CanPerformComplexSearch which returns true.

Cheers

Rich

 

Af: Rich Hacker 12. okt 2017

RE: Quote Connector Advanced Product Search

Hi Rich, afraid I don't have an answer for you, but I do see the same issue. I'm playing around with a simple Quote Connector, and the same two searchfields pop up here as well.

Af: Frode Lillerud 2. nov 2017

RE: Quote Connector Advanced Product Search

 

Hi !

Is this the result of your quote Product dialog settings? These fields appear in all connectors if selected.

Quote Settings

Best regards

Af: Tony Yates 3. nov 2017

RE: Quote Connector Advanced Product Search

Hi, yes, that dialog looks about the same here:

 

Here you see that the setup is basically just a standard setup.

If I go to the Quote-Find dialog in Win or Web, I see these four fields:

In my code I've only added the top two, but have no idea why "Subscription" and "Subscription unit" also appear.

Here is the dummy-code I'm using to get the searchable fields in my connector:

        public override FieldMetadataInfo[] GetSearchableFields()
        {
            List<FieldMetadataInfo> fields = new List<FieldMetadataInfo>();
            fields.Add(new FieldMetadataInfo()
            {
                DisplayName = "Name",
                DefaultValue = "Dummy",
                FieldKey = "Name",
                FieldType = FieldMetadataTypeInfo.Text
            });

            fields.Add(new FieldMetadataInfo()
            {
                Access = FieldAccessInfo.ReadOnly,
                DefaultValue = "",
                DisplayDescription = "The Code",
                DisplayName = "Code",
                FieldKey = "Code",
                FieldType = FieldMetadataTypeInfo.Text,
                ListName = "",
                MaxLength = 20,
                Rank = 1
            });
            return fields.ToArray();
            //return base.GetSearchableFields();
        }
    }
Af: Frode Lillerud 3. nov 2017

RE: Quote Connector Advanced Product Search

Frode,

I spoke with Tor Thorbergson (who I believe is responsilbe for the Quote connectors) at expander world and he said he managed to re-create the same issue. He could not explain exactly why this was, but assured me it was nothing wrong with my code.

Cheers

Rich

Af: Rich Hacker 3. nov 2017

RE: Quote Connector Advanced Product Search

Not my domain exactly but for what it is worth, here is my guess (with some help from looking at the code)
I think this is what we called "Advanced product search".
By default, the FindProductViaConnectorProvider will be involved.
Though we cannot know beforehand what the columns are, we do however assume the existence of a quite a few. So, this provider pushes a number of standard columns, 26 of them.
But only 2 of these columns are of type "canRestrictBy". They are defined with a RestrictionType.
These 2 columns are:_colSubscriptionUnit and _colIsSubscription.

My guess is that these 2 are merged in.
( I don't have a usefull life connector to trace this!)
May be the trick is to plugin your own Find provider based on FindProductViaConnectorProvider and then filter out unwanted columns.

Just a gutt feeling. I may be on thin ice. If so I am sure someone more knowledgable will put me in place.
Sorry if this doesn't help you straight out of the box.
/Conrad

Af: Conrad Weyns 3. nov 2017

RE: Quote Connector Advanced Product Search

Conrad is essentially correct; the problem was that these two subscription columns wrongly got restrictions.

 

When we create such providers we need to both express which fields we can search by, but also which fields we will (potentially at least) show in the resulting output.  When we expressed the output columns (which are the same for all connectors unless you decide to write your own archive provider) these two columns got tagged as searchable by mistake.

 

We have today fixed the issue and tested the result successfully. We expect the fix to go public in about three weeks time (at least for online, unsure about onsite).

 

Thanks to Marek Vokáč for help to find this bug 😊

Af: Tor Thorbergsen 3. nov 2017

RE: Quote Connector Advanced Product Search

Fantastic,

Thank you everyone for your input with this.

Cheers

Rich

Af: Rich Hacker 3. nov 2017

RE: Quote Connector Advanced Product Search

Yes, thanks a lot guys!

Af: Frode Lillerud 3. nov 2017