Good morning everyone!
We are trying to set up a custom Dynamics action to get contacts via phone number and whether they're active or not. This requires the use of two separate filters, and we've had a couple struggles with this. We've worked around them, but want to know if there's a better option for each of our workarounds.
-
We are trying to use $msdynamics.fieldSearchFilter() to convert an input value to a search parameter. The input type is an Integer in the contract, and the Dynamics server expects an Integer as well. However, when the macro is parsed, it's converting the value to a String. The field we're trying to filter is an integer type, and due to the macro converting it to a separate type, Dynamics is complaining about comparing a string to an int. We've had to manually enter the filter by writing
$esc.uriEncode("statecode eq $input.STATE_CODE")
, but we don't particularly like this because we're having to write the query manually instead of having the $msdynamics macro do it for us, which can be annoying down the line if we need to compare multiple int values at the same time and are having to rewrite the same statement over and over. Surely there is a better way to do this? Some screenshots to explain this better are below.
-
This isn't really an issue, but just wanted some advice. We have to use
and
to concatenate two filters together. To do this we're just manually typing in %20and%20 into the URL parameter. I don't really like this too much, but not sure if there's a better way to do this as well.
Here is what our current Request URL Template looks like, if anyone could give us some pointers that'd be great, thanks!!
/api/data/v9.2/contacts?${esc.dollar}select=[REDACTED]&${esc.d}filter=$esc.uriEncode("statecode eq $input.STATE_CODE")%20and%20($esc.uriEncode($msdynamics.phoneNumberFilter("$input.PHONE_NUMBER", ["telephone1", "telephone2", "telephone3", "mobilephone"])))