Sunday, July 26, 2020

OData Web Services - Filter Option

Hello Friends

NAV/BC OData v4 service can easily accessbile any external system provide the result in json format.

Method for apply different types of filter:

Filter Expressions

To add a filter to an OData URI, add $filter= to the end of the name of the published web service.

For example, the following URI filters the City field in the Customer page to return all customers who are located in “Milano”:
Example: (Access with USER\SERVICE KEY)
Customer > Published Odata Service
https://api.businesscentral.dynamics.com/v2.0/tenant-ID/Production/ODataV4/Company(‘CompanyName’)/Customer?$filter=City%20eq%20%27Milano%27

Available Filters
The following table shows the filters that are supported in Business Central OData web services and the equivalent C/AL filter expressions.

All examples are based either on page 21, Customer (published as Customer), or on page 20, General Ledger Entry (published as GLEntry).


Filter Expressions
DefinitionExample and explanationC/AL exp.
Select a range of valuesfilter=Entry_No gt 610 and Entry_No lt 615
Query on GLEntry service. Returns entry numbers 611 through 614.
..
Andfilter=Country_Region_Code eq ‘ES’ and Payment_Terms_Code eq ’14 DAYS’
Query on Customer service. Returns customers in Spain where Payment_Terms_Code=14 DAYS.
&
Orfilter= Country_Region_Code eq ‘ES’ or Country_Region_Code eq ‘US’
Query on Customer service. Returns customers in Spain and the United States.
Alert: You can use OR operators to apply different filters on the same field. However, you cannot use OR operators to apply filters on two different fields.
|
Less thanfilter=Entry_No lt 610
Query on GLEntry service. Returns entry numbers that are less than 610.
<
Greater thanfilter= Entry_No gt 610
Query on GLEntry service. Returns entry numbers 611 and higher.
>
Greater than or equal tofilter=Entry_No ge 610
Query on GLEntry service. Returns entry numbers 610 and higher.
>=
Less than or equal tofilter=Entry_No le 610
Query on GLEntry service. Returns entry numbers up to and including 610.
<=
Different from (not equal)filter=VAT_Bus_Posting_Group ne ‘EXPORT’
Query on Customer service. Returns all customers with VAT_Bus_Posting_Group not equal to EXPORT.
<>
endswithfilter=endswith(VAT_Bus_Posting_Group,’RT’)
Query on Customer service. Returns all customers with VAT_Bus_Posting_Group values that end in RT.
*
startswithfilter=startswith(Name, ‘S’)
Query on Customer service. Returns all customers names beginning with “S”.
substringoffilter=substringof(Name, ‘urn’)
Query on Customer service. Returns customer records for customers with names containing the string “urn”.
indexoffilter=indexof(Location_Code, ‘BLUE’) eq 0
Query on Customer service. Returns customer records for customers having a location code beginning with the string BLUE.
replacefilter=replace(City, ‘Miami’, ‘Tampa’) eq ‘CODERED’
substringfilter=substring(Location_Code, 5) eq ‘RED’
Query on Customer service. Returns true for customers with the string RED in their location code starting as position 5.
tolowerfilter=tolower(Location_Code) eq ‘code red’
toupperfilter=toupper(FText) eq ‘2ND ROW’
trimfilter=trim(FCode) eq ‘CODE RED’
concatfilter=concat(concat(FText, ‘, ‘), FCode) eq ‘2nd row, CODE RED’
roundfilter=round(FDecimal) eq 1
floorfilter=floor(FDecimal) eq 0
ceilingfilter=ceiling(FDecimal) eq 1

Referencing Different Data Types in Filter Expressions
You must use the appropriate notation for different data types with filter expressions.
  • String values must be delimited by single quotation marks.
  • Numeric values require no delimiters.
Known Limitations
Filters
You can specify filters in OData web services in general that are not supported in Business Central , such as using an OR operator to filter on “two different fields.
In those cases, you will see the following error:
“An error occurred while processing this request. The ‘OR’ operator is not supported on distinct fields on an OData filter”
Lambda operators
Lambda operators are not supported by Business Central OData APIs. If lambda operators are used, the filter expression will be ignored.
Deep insert
Business Central supports deep insert, but not deep patching. Multiple requests will need to be issued when patching nested entities.

Monday, July 6, 2020

Microsoft Dynamics Business Central OnPrem vs Azure vs SaaS

Hello Friends,

It is very import that every one understand the difference between
Business Central OnPrem vs Azure vs SaaS

The difference can be easily understand from standard IaaS vs PaaS vs SaaS chart and made it applicable to Business Central. I think this chart speaks for itself, but if someone needs additional info, you can send a question and I’ll add details.























Just to be clear, on the top level where we have Company Data, I think on using BC as a system through UI or API’s. That means you are master of your data. You need to be sure how you enter and post your documents. But if we talk about configuration of system, mostly it will be done by your partner, but again this is your decision (as customer) to find trusted partner to work with.

As this chart cannot offer completely picture, I’ve added one more. First one was all about technology, but the next one is about licensing and what is included in system.













*) One thing maybe not 100% clear from this chart is infrastructure subscription if you are using BC on Azure (IaaS model). If you want to use Business Central deployed on Azure infrastructure (no SaaS), you can use a few different models. First you (as customer) can have your own infrastructure (1 VM, 2 VM’2, or VM + Azure SQL). The second, you (as customer) can use partner infrastructure and in this case you can dedicated hardware or services to you (as if you use your own) or you can use shared resources (more cost effective). In this case, middle tier can be used for more clients, as well as Azure SQL database can be added to Azure Elastic Database Pool and to get better performances and better cost
Original Blog Link


Standard system architecture for BC SaaS
https://docs.microsoft.com/en-us/azure/architecture/solution-ideas/articles/business-central






























 I hope this detail help you understand difference.
Than you for reading.

Keep Sharing....Keep Posting.....