Coder Social home page Coder Social logo

exactonline / exactonline-api-dotnet-client Goto Github PK

View Code? Open in Web Editor NEW
50.0 50.0 95.0 1.53 MB

This a C# client SDK for Exact Online which gives you a set of easy functions to call our API. This is not supported anymore by Exact.

Home Page: http://developers.exactonline.com

License: MIT License

C# 99.90% Visual Basic .NET 0.10%

exactonline-api-dotnet-client's Introduction

Exact Online REST API Library in Python

Exact Online provides accounting software in a Software-as-a-Service delivery model. It implements an API through a REST interface. This library aims to ease its use.

Quick jump

Usage by example

Set up the basics:

from exactonline.api import ExactApi
from exactonline.exceptions import ObjectDoesNotExist
from exactonline.storage import IniStorage

# Create a function to get the api with your own storage backend.
def get_api():
    storage = IniStorage('/path/to/config.ini')
    return ExactApi(storage=storage)
api = get_api()

Get an invoice:

# Get an invoice by your own invoice number (YourRef).
# Returns a dictionary, or raises ObjectDoesNotExist.
invoice = api.invoices.get(invoice_number='F0005555')

It looks somewhat like this:

invoice == {
    u'AmountDC': 50.8,
    u'AmountFC': 50.8,
# ...
    u'SalesEntryLines': [
        {u'AmountDC': 41.98,
         u'AmountFC': 41.98,
# ...
         u'Description': u'Omzet backups',
         u'VATBaseAmountDC': 41.98,
         u'VATBaseAmountFC': 41.98},
    ],
# ...
    u'VATAmountDC': 8.82,
    u'VATAmountFC': 8.82,
    u'YourRef': u'F0005555',
    u'__metadata': {u'type': u'Exact.Web.Api.Models.SalesEntry',
                    u'uri': u"https://start.exactonline.nl/api/v1/..."},
}

Get relations:

relations_limit_2 = api.relations.filter(top=2)
# that was cheaper than: api.relations.all()[0:2]

relations_limit_2 == [
    {u'Code': u'              1068',
     u'ID': u'11111111-2222-3333-4444-555555555555',
     u'Name': u'ACME Corporation',
     u'__metadata': {u'type': u'Exact.Web.Api.Models.Account',
                     u'uri': u"https://start.exactonline.nl/api/v1/...')"}},
    {u'Code': u'               555',
     u'ID': u'22222222-3333-4444-5555-666666666666',
     u'Name': u'Daffy Duck Ltd.',
     u'__metadata': {u'type': u'Exact.Web.Api.Models.Account',
                     u'uri': u"https://start.exactonline.nl/api/v1/...')"}}
]

Update a relation:

daffy_duck = api.relations.get(relation_code='555')
api.relations.update(daffy_duck['ID'], {'Name': 'Daffy Duck and sons'})

Delete a relation:

daffy_duck = api.relations.get(relation_code='555')
api.relations.delete(daffy_duck['ID'])

Create an invoice:

customer_data = api.relations.get(relation_code='123')  # local relation_code
customer_guid = customer_data['ID']
invoice_data = {
    'AmountDC': str(amount_with_vat),  # DC = default currency
    'AmountFC': str(amount_with_vat),  # FC = foreign currency
    'EntryDate': invoice_date.strftime('%Y-%m-%dT%H:%M:%SZ'),  # pretend we're in UTC
    'Customer': customer_guid,
    'Description': u'Invoice description',
    'Journal': remote_journal,  # 70 "Verkoopboek"
    'ReportingPeriod': invoice_date.month,
    'ReportingYear': invoice_date.year,
    'SalesEntryLines': [],
    'VATAmountDC': str(vat_amount),
    'VATAmountFC': str(vat_amount),
    'YourRef': local_invoice_number,
    # must start uniquely at the start of a year, defaults to:
    # YYJJ0001 where YY=invoice_date.year, and JJ=remote_journal
    'InvoiceNumber': '%d%d%04d' % (invoice_date.year, remote_journal,
                                   int(local_invoice_number)),
}
# The SalesEntryLines need to be filled with a bunch of dictionaries
# with these keys: AmountDC, AmountFC, Description, GLAccount,
# VATCode where GLAccount holds the Journal remote GUID, and the
# amounts are without VAT.

api.invoices.create(invoice_dict)

You may need to play around a bit to find out which fields are mandatory, and what kind of values the fields need. The Exact Online REST resources list isn't always clear on that.

You'll need a storage backend. The default IniStorage can be taken from exactonline.storage.

from exactonline.storage import IniStorage

class MyIniStorage(IniStorage):
    def get_response_url():
        "Configure your custom response URL."
        return self.get_base_url() + '/oauth/success/'

storage = MyIniStorage('/path/to/config.ini')

(Note that you're not tied to using .ini files. See exactonline/storage.py if you want to use a different storage backend.)

You need to set up access to your Exact Online SaaS instance, by creating an export link. See creating Exact Online credentials for more info.

Take that info, and configure it in your config.ini.

[server]
auth_url = https://start.exactonline.co.uk/api/oauth2/auth
rest_url = https://start.exactonline.co.uk/api
token_url = https://start.exactonline.co.uk/api/oauth2/token

[application]
base_url = https://example.com
client_id = {12345678-abcd-1234-abcd-0123456789ab}
client_secret = ZZZ999xxx000

Create an initial URL:

api = ExactApi(storage=storage)
url = api.create_auth_request_url()

The URL will look like this; redirect the user there so he may authenticate and allow your application access to Exact Online (this is OAuth):

After authentication he will get redirected back to:

You should implement a view on that URL, that does basically this:

api.request_token(code)

At this point, you should configure your default division, if you haven't already:

division_choices, current_division = api.get_divisions()
api.set_division(division_choices[0][0])  # select ID of first division

Now you're all set!

Implemented resources

View exactonline/api/__init__.py to see which resource helpers are implemented.

Currently, it looks like this:

invoices = Invoices.as_property()
ledgeraccounts = LedgerAccounts.as_property()
receivables = Receivables.as_property()
relations = Relations.as_property()

But you can call resources which don't have a helper directly. The following two three are equivalent:

api.relations.all()
api.restv1('GET', 'crm/Accounts')
api.rest('GET', 'v1/%d/crm/Accounts' % selected_division)

As are the following three:

api.relations.filter(top=2)
api.restv1('GET', 'crm/Accounts?$top=2')
api.rest('GET', 'v1/%d/crm/Accounts?$top=2' % selected_division)

And these:

api.invoices.filter(filter="EntryDate gt datetime'2015-01-01'")
api.restv1('GET', 'salesentry/SalesEntries?' +
  '$filter=EntryDate%20gt%20datetime%272015-01-01%27')
api.rest('GET', 'v1/%d/salesentry/SalesEntries?' +
  '$filter=EntryDate%%20gt%%20datetime%%272015-01-01%%27' %
  selected_division)
# convinced yet that the helpers are useful?

See the Exact Online REST resources list for all available resources.

Other benefits

The ExactApi class ensures that:

  • Tokens are refreshed as needed (see: exactonline/api/autorefresh.py).
  • Paginated lists are automatically downloaded in full (see: exactonline/api/unwrap.py).

Creating Exact Online credentials

Previously, one could create an API from the Exact Online interface directly. This was removed at some point between 2014 and 2015.

According to the "how can I create an application key?" FAQ entry you must now create one through the App Center.

Why am I unable to see the Register an API link and how can I create an application key?

All registrations are now configured through the App Center. Previously you were able to generate an Application Key and/or create an OAuth registration within your Exact Online.

In Exact Online you can create an app registration for private use (customer account) or an app registration for commercial use (partner account). Go to Target groups and site maps for more information.

If the Register API Key link is not visible in the App Center menu you do not have the correct rights to view it. To make the link visible go to, Username > My Exact Online > Rights and select Manage subscription.

License

Exact Online REST API Library in Python is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, version 3 or any later version.

TODO

  • Right now, the section-links in the README.rst do not work in PyPI: the quick jump links fail to emerge.
  • Replace base_url with response_url?
  • Add travis build stuff.

Further reading

exactonline-api-dotnet-client's People

Contributors

asimnazir avatar boomit2016 avatar daweedz avatar dirkzwager avatar elsgootjes avatar herman44 avatar lesley-lee avatar mark1975 avatar martijnboland avatar mghaoui-interpulse avatar mtrcn avatar pdebruine avatar perplexwouter avatar rubenmijwaart avatar rvanderpal avatar shtrip avatar tbaart avatar thorjan avatar threetwosevensixseven avatar totalmace avatar vlesierse avatar yerbol-kalykh-exact avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

exactonline-api-dotnet-client's Issues

unable to use sdk with multiple divisions

If the SDK is used for multiple users in the same domain it won't work. the _apiEndpoint will be saved in the static _instance object and won't ever change.

Since the divisionID is stored in the _apiEndpoint, it's not possible to change the division after the first use of the SDK.

public static ControllerSingleton GetInstance(IApiConnector connector, string apiEndpoint)
{
    if (_instance == null)
    {
        _instance = new ControllerSingleton
        {
            _apiEndpoint = apiEndpoint,
            _connector = connector,
            _controllers = new Hashtable()
        };
    }
    return _instance;
}

The "if (_instance == null)" is the problem. If this check is removed the SDK is usable with multiple divisions. However it seems to me it has been a deliberate design decision to make it a singleton.

Ultimately there should be an instance for each apiEndpoint. But that would require some refactoring.

How to add CustomDescriptionLanguage?

When fetching GLAccounts we need to add a CustomDescriptionLanguage to the header to get the descriptions in the correct language.
Is this possible with this API?

MailMessage

Hi,

I'm using the sdk to send mailmessages to the digital postbox.
However, in following Exact help center post, they warn that the MailMessage API is deprecated.
When I use the SDK, sending a mail returns a success message but the mails are not visible in the postbox. It looks like the old API call is no longer supported.
Is support for these new API calls planned instead of the deprecated call?

PROPOSAL: OWIN & ASP.NET 5 OAuth authentication support

Currently OWIN and ASP.NET 5 allows web application to authenticate the user at other providers like Facebook, Google, Microsoft Live, etc.

Example
app.UseExactOnlineAuthentication("<clientid>", "clientsecret");

Is this feature desireble and should it be provided by the client SDK?

401 on ProcessUserAuthorization

I cannot get the ConsoleApplication sample to work. I registered an app and got all the codes, put these values in the sample code, got login window. logged in with live account (not demo), granted authorization and then got 401 on OAuthClient.Authorize, calling ProcessUserAuthorization. On consequent attempts, I only enter the live system user name and password, access is already granted so no more questions asked and then 401.

Count() method negeert filter

De Count method stuurt het filter zoals eerder omschreven in de Where method niet mee naar de REST API. Het resultaat is een telling van alle objecten, niet alleen de objecten die voldoen aan de filter.

Feature request: .Next() or skipToken

The "client.For().Select("Code").Get()" returns a list of max 60 accounts.

However, the client doesn't have the option to get the "__next" 60 accounts.

The token is available in the raw response, but is being lost in the method "ApiResponseCleaner.GetJsonArray(response);"

When updating an entity without changing anything an exception is thrown

When I try to update an Entity without changing any of the properties, it throws an Exception with message: "No Guid, keyName or data specified".

_client.For<Account>()
    .Update(account);

I believe this is because the ExactOnlineJsonConverter doesn't return any updated fields (which is correct). But the exception seems a bit strange.

I've found the following check in the "Put" method of the "ApiConnection" class:

if (guid != string.Empty && data != string.Empty && keyName != string.Empty)
{
    // ....
}
else
{
    throw new Exception("No Guid, keyName or data specified");
}

I Suggest taking the data out of this check and placing it someplace else, maybe without the exception.

text encoding issue

when I user the client method ExactOnline.Client.Sdk.Helpers.Insert(ref SalesEntry entity);

the SalesEntry.SalesEntryLines item's Description is subscription Jaar lid (โ‚ฌ 2,99 p/m) voor test test
but the post data i find in fiddler is : Description=subscription Jaar lid (?2,99 p/m) voor test test

.Net Core

Any plans for a .Net Core version?

MailMessage: Some fields aren't ReadOnly

Dear,

When doing a post of a MailMessage object, I got an error message saying that the fields SenderMailbox and RecipientMailbox are mandatory. The reason is that those fields are marked as ReadOnly in the class MailMessage in file "Models.vb". After putting <SDKFieldType(FieldType.ReadOnly)> this in comments, it worked like a charm!

Unable to use Where on GUID when using strongly typed queries

Hi, for some reason I am unable to use strongly typed queries with GUID data types as parameters. The snippet below fails and throws a System.ArgumentException. While the second snippet successfully returns results.

            var items = client.For<SalesItemPrice>()
                .Select(x => x.ID)
                .Where(x => x.Account, salesItem.Account)
                .And(x => x.Item, salesItem.Item)
                .Get();

System.ArgumentException: 'Invalid expression 'x => x.Item': Lambda expression should resolve a property on model type 'T' (with optional extension method calls). Parameternaam: e'

            var items = client.For<SalesItemPrice>()
                .Select(x => x.ID)
                .Where("Account+eq+guid'" + salesItem.Account.ToString() + "'")
                .And("Item+eq+guid'" + salesItem.Item.ToString() + "'")
                .Get();

Old Nuget package

I have build an application based on the library supplied by this repository, but now I want to build an application based on the nuget package.
It seems that not all models are represented within the latest nuget package (For example: Schedule).

Could the nuget package be updated with the latest models and fixes?

Limited amount of records

Hey,

I'm trying to use the exact online api in the creation of a qlik connector.
I got most of it working, I get data into my application, though the data is limited.
I'm trying to read all GLAccounts with:

var glAccount = client.For().Select(fields_GLAccounts).Get();

The code works, though it's limited at 60 records. Now I got somewhere around 685 GLAccounts and would love to get a read on all of them.
Am I missing something here on my end or is the hard limit within the api itself.
Thanks in advance.

Printing invoices is currently not possible

I'm trying to print an invoice with this code:
PrintedSalesInvoice printedSalesInvoice = new PrintedSalesInvoice() { InvoiceID = invoiceID };
bool created = _exactClient.For().Insert(ref printedSalesInvoice);

It generates correct POST but implementation of the insert executes and GET after that. In my case PrintedSalesInvoice doesn't allow executing GET request and throws exception.

In general I need to be able to execute only Post and read the response. I think the current't version doesn't allow this.

In some cases a 500 is returned by the API

We have the assumption that that the request header Expect: 100 Continue can cause 500 responses. Our library uses HttpWebRequest which set header by default.

Please make sure that this header will not be sent.

Can not lookup a guid for ShippingMethod

When creating a new SalesOrder, I need to set a ShippingMethod. Unfortunately a guid is expected where I can only supply a code. It doesn't seem possible to lookup all shippingmethods with the REST interface. Is that right? Or am I missing something?

Updating the costcenter code is not working

Cost centers have a client id of maximal 8 characters. The api accepts changes, but does not update the property. Should the client throw an exception when a cost center code change is requested? Or should the api throw the exception?

No accesstoken

I have created an clientid and secret and the response url set.
I have set this in the sample console application and I see the login screen. After login the redirect url is shown, I close the login form and the console crashes.
The accesscode is NULL and with debugging I can not figure out where the accesstoken should be retrieved. It seems like the accesstoken is not given to the response url. (No header and no querystring).

Am i doing something wrong?

No data for SalesInvoice

Hello,

When I try to interact with SalesInvoices, no invoice is ever returned:

client.For<SalesInvoice>().Select(new[] { "InvoiceDate", "InvoiceID" }).Top(5).Get().FirstOrDefault();

always returns null;

Other tables work fine (e.g. client.For<Account>().Select(new[] { "Code", "Name", "ID", "City" }).Top(5).Get().FirstOrDefault(); works perfectly!

What's going on?

Thanks,
Ronald Wijnsema

Update account

Hi,

For some strange reason i can't update accounts thought the sdk.
I get following error "Error Entity identifier value not found"

Dim account As ExactOnline.Client.Models.CRM.Account = New ExactOnline.Client.Models.CRM.Account() With
{
.AddressLine1 = "txtAddress1.Text",
.Name = "txtName.Text",
.StartDate = DateTime.Now.AddDays(-30),
.Code = "311699"
}

        account.ID = New Guid("xxxxxxxx-xxxx-xxxx-xxxx-809b842978b8")
        Dim updated As Boolean = APIHelper.ExactClient.[For](Of exactOnline.Client.Models.CRM.Account)().Update(account)

--> Error

If i add following lines at the beginning of the code and do nothing with it.
Dim searchAccount As New List(Of Account)
searchAccount = APIHelper.ExactClient.For(Of Account).Select("ID").Where("ID+eq+guid'" + New Guid("xxxxxxxx-xxxx-xxxx-xxxx-809b842978b8").ToString + "'").Get()

I can update the account without any problem.

Is this is bug of do i something wrong?

Entity-relationship diagram of API data model

We are creating a free-to-use diagram of the Exact Online APIs.

It is located at https://gitlab.com/Invantive/invantive-sql-samples/blob/master/exact-online/Documentation/erd-2017

Sample:

https://gitlab.com/Invantive/invantive-sql-samples/blob/master/exact-online/Documentation/erd-2017/industry/exact-online-erd-2017-crm.svg

Maybe it is handy as a reference to include here, in addition to the information contained on developers.exactonline.com.

A poster PDF (2x A0) will be available before Exact Live 2017.

ExactOnline.Client.Sdk.Exceptions.ForbiddenException'

The following scenario:

I am using the ExactOnline.Client.SDK to programmatically book Deliveries.
The background is this. The customer wants to use a Mobile Barcode Scanner to record the transactions automatically when Items leave the stock.

I have a partial delivery (with Quantity 2 items) from an order (with Quantity 7 items) I tried the following function:

private static void BookDelivery(ExactOnlineClient client, SalesOrderLine sol)
{
string date = sol.DeliveryDate.ToString().Substring(0, 10);
Debug.WriteLine($"{date} ({sol.QuantityDelivered}/{sol.Quantity}) Item: {sol.ItemCode} {sol.ItemDescription} ");

GoodsDeliveryLine pos = new GoodsDeliveryLine
{
DeliveryDate = DateTime.Now,
QuantityDelivered = 2,
SalesOrderLineID = sol.ID
};
try
{
bool success = client.For().Insert(ref pos);
Debug.WriteLine($"RESULT: {success}");
}
catch (Exception ex)
{
Debug.WriteLine(ex.Message);
}
}

The DEBUG Output Windows is this
22.07.2016 (3/7) Item: CN51 CN51 Barcode Scanner
Exception thrown: 'System.Net.WebException' in System.dll
Exception thrown: 'System.Net.WebException' in System.dll
Exception thrown: 'ExactOnline.Client.Sdk.Exceptions.ForbiddenException' in ExactOnline.Client.Sdk.dll
The remote server returned an error: (403) Forbidden.

Now the questions.

  1. Do i miss some arguments or is the API not yet fully implemented to accept insertion of GoodsDeliveryLine data.

  2. Are there any complete samples using the SDK? It would very nice to see some implemented Business cases.

Regards,
Thomas Trick

OAuth troubles

Can we make oAuth beter?

  1. You need more then 6 dll works fine with exact online. 2 for exact. 4 OAuth connection.
  2. Works not fine of mef framwork. You must include dll in your project. (https://msdn.microsoft.com/en-us/library/dd460648(v=vs.110).aspx)
  3. You must in first run works browser componet .

Ik make connection to Twinfield/webshops works without this troubles en works safe. Facebook have same idea of authorisation and works fine 1 dll. https://github.com/facebook-csharp-sdk/facebook-csharp-sdk/blob/master/README.md

The remote server returned an error: (401) Unauthorized.

My application is an windows service.
When I just start the windows service everything is working.
But some hours later. may be some days later .
I get the exception "The remote server returned an error: (401) Unauthorized."
I thought when the access token is expired. Your SDK should invoke connector.GetAccessToken to get the accesstoken.
_client = new ExactOnlineClient(connector.EndPoint, connector.GetAccessToken);
How do if fix it now?

Inefficient GET after creating an entity

The SDK always does a GET after each POST to get the full entity including linked entities. For entities without linked entities this is not needed because the same result is achieved by including the request header Prefer: return=representation in the POST request.

Two things need to happen.

  1. Always pass request header Prefer: return=representation in POST requests
  2. Only execute the GET for entities that contain linked entities.

Provide paging information

When paging is required on a result set, this is indicated in the result by the presence of __next section.
It would be nice if this would also surface into the SDK so we could check if we need to call again to get the rest. Ideally a .Next() call on the result would be provided to actually fetch the next records.

Don't return error codes; throw exceptions instead

The current API is littered with methods that return a boolean to indicate whether the operation executed successfully, such as:

bool created = client.For<Document>().Insert(ref document);

Please consider letting those methods return void and throw an exception instead. Returning error codes are not common practice anymore, especially for reusable libraries and APIs and the .NET Framework Design Guidelines explicitly state this. Reason for this is that exceptions can have very detailed information and can't be forgotten by developers. In general, a method should throw an exception if it doesn't do what it promises to do. In the given example using Insert, this means that if the document isn't inserted, an exception should be thrown.

Escaping string

Issue description: error: "Bad JSON escape sequence: ".
It happens during receiving SalesInvoices from demo account.

It can be fixed by replacing escaping code:

json += """ + entry.Value.ToString().Replace(""", "" + """) + """;

->

json += JsonConvert.ToString(entry.Value.ToString());

in method

private static string GetJsonFromDictionary(Dictionary<string, object> dictionary) (ApiResponseCleaner.cs file).

Writing linked entities: empty fields are not stripped from Json

When trying to add an GeneralJournalEntry with GeneralJournalEntryLines I get exceptions saying it's not allowed to fill AmountVATFC without providing a VATCode.
I did not fill any of those fields.
I reported this the the Exact Online support team, and they responded I shouldn't send a null value, because they translate it into 0, which triggers the VATCode check.

I modified the ExactOnlineJsonConverter to get the desired results:

private JsonConverter[] GetCorrectConverters(object entity)
{
// Get correct converter
ExactOnlineJsonConverter converter;
if( _createUpdateJson )
{
var emanager = GetEntityController( entity );
if( emanager != null )
{
// Entity is an existing entity. Create JsonConverter for updating an existing entity
converter = new ExactOnlineJsonConverter( emanager.OriginalEntity, _entityControllerDelegate );
}
else
{
// Entity is a new entity. Create JsonConverter for sending only changed fields
var emptyEntity = Activator.CreateInstance( entity.GetType() );
converter = new ExactOnlineJsonConverter( emptyEntity, _entityControllerDelegate );
}
}
else
{
converter = new ExactOnlineJsonConverter();
}

		//converter.SkipReferenceField = true;
		var converters = new[] { (JsonConverter)converter };
		return converters;
	}

Missing PurchaseEntry and PurchaseEntryLlines

It seems the current version has not implemented PurchaseEntry and PurchaseEntryLlines.
Is there a special reason why these are not avaialable?

I added these lines to ControllerSingleton, and then it seems to work.:

case "PurchaseEntry": conn = new ApiConnection(_connector, _apiEndpoint + "purchaseentry/PurchaseEntries"); break;
case "PurchaseEntryLine": conn = new ApiConnection(_connector, _apiEndpoint + "purchaseentry/PurchaseEntryLines"); break;

PrintedSalesInvoice returns 403 forbidden

I'm using the C# SDK for printing and sending a SalesInvoice to the customer as described in 'Step 2: Print and send a sales invoice' of the following tutorial: https://developers.exactonline.com/#Business_example_API_Sales_invoice.html%3FTocPath%3DExact%2520Online%2520REST%2520API%7CBusiness%2520cases%7C_____1

In order to achieve this I'm creating a PrintedSalesInvoice object and I set the InvoiceID and SendEmailToCustomer properties, like this:

var printedSalesInvoice = new PrintedSalesInvoice
{
InvoiceID = invoiceId,
SendEmailToCustomer = true
};
var success = client.For().Insert(ref printedSalesInvoice);

Unfortunatly the insert call results in an 403 Forbidden exception.

The strange thing however is that the SalesInvoice is being processed in ExactOnline!

Am I forbidden to do this, or is the resulting error a bug?

And not correctly parsed to filter

The selection "
client.For

().Top(1).Select(fields).
Where("Account eq guid'" + accountId + "'").
And("Type eq 1").Get().FirstOrDefault();
result in the filter
"$filter=Account eq guid'61ff4f00-8726-480b-b703-8870e03cf0e2'&Type eq 1&$select=ID,AddressLine1,Type&$top=1"
Leading to the wrong result.
The filter shoud be
"$filter=Account eq guid'61ff4f00-8726-480b-b703-8870e03cf0e2' and Type eq 1&$select=ID,AddressLine1,Type&$top=1"

The problem is in the method
public ExactOnlineQuery And(string and)
in this method replace
_and.Add(and)
with
_where += " and " + and;

this leads to
private string CreateODataQuery(bool selectIsMandatory)
remove lines
// Add $filter
queryParts.AddRange(_and);

Duplicate model names

This api client was developed a few years ago under the assumption that model names would be unique. Today we find this no longer holds true. The endpoints documents/Documents and crm/Documents both have a model called 'Document' and both these models have different properties. This is a problem because we can't have 2 classes called 'Document' in the same name space.

To fix this we intend to move all models to proper name spaces and split the huge models.vb file into multiple files, one for each name space. This will be breaking change.

The NuGet ExactOnline.Client.Sdk assemblies don't have a strong name

Is it possible to sign the dll's distributed by NuGet (ExactOnline.Client.Models.dll and ExactOnline.Client.Sdk.dll) with a strong name? At present it's not possible to use the ExactOnline.Client.Sdk NuGet package in my project, because I'm generating assemblies with a strong name.

I can use the source code with a self generated signing key to generate the assemblies myself, but that way I can't easily update to the latest version when you update the package.

Partial updates result in resetting values in EOL

The following scenario:

Created a SalesOrderLine with amount 200, unit price 40.0 and discount 0.1. When updating only the amount, the unit price and discount are not sent to the server with the PUT request (because these are not changed). After updating only the amount, I noticed that unit price and discount are set back to 0.0. This should not happen, right?

Also, doing this kind of partial updates with PUT might be not entirely correct from a REST perspective. Normally, the PATCH verb is used for partial updates and PUT only for full updates of entire objects.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.