0
votes

I am trying to use Acumatica web services to "Export" from screen CR302000 (Organization > Customer Management > Contacts).

Using a Filter with a FilterCondition.Contain condition I can limit the results to only those with Phone1 field containing a certain string.

Now I want the phone number I'm filtering on to contain a wildcard. In the web interface using % as a wildcard character works. But when using the web services this doesn't work (no rows are returned).

My Filter:

Filter[] filters = new Filter[]
{
    new Filter()
    {
        Field = new Field()
        {
            FieldName = context.DetailsContact.Phone1.FieldName,
            ObjectName = context.DetailsContact.Phone1.ObjectName
        },
        Condition = FilterCondition.Contain,
        Operator = FilterOperator.And,
        Value = "283%9534"
    }
}

Which becomes this in the SOAP request:

<Filter>
    <Field>
        <FieldName>Phone1</FieldName>
        <ObjectName>ContactCurrent: 1</ObjectName>
    </Field>
    <Condition>Contain</Condition>
    <Value xsi:type="xsd:string">283%9534</Value>
    <OpenBrackets>0</OpenBrackets>
    <CloseBrackets>0</CloseBrackets>
    <Operator>And</Operator>
</Filter>

Does anyone know if filtering with wildcards can be achieved using the web services API?

Update: The % wildcard almost works if I don't include a ContactSummary.ServiceCommands.EveryContactID command. It returns exactly one result that matches the wildcard search. But I need every result that matches, which is why I include EveryContactID

Update 2: Wildcard works fine for screen CR301000 (Leads) with LeadSummary.ServiceCommands.EveryLeadID command. Is this a bug in CR302000?

Update 3: Summarising the conversation in the comments of the accepted answer, CR301 and CR302 should both be able to filter by contact telephone with a wildcard, but due to some unknown bug, CR302 can't use wildcards.

1

1 Answers

0
votes

This happens because you're trying to filter on a field which is not part of the primary view. In CR301000 (Leads), the Contact is the primary view, so your filter works. More explanation on this is provided here: Using filter with Customer screen in Acumatica API