Uniconta Force Load Cache (Reporting)

Date: 2023-04-28
// First, when using:
ClientHelper.GetRefClient(base.CompanyId, typeof(InvItem), _Item);

var companyId = api.CompanyId;
// ensure all (created) items have the correct CompanyId set.
var order = new DebtorOrderClient() {
        CompanyId = companyId
    };
var line = new DebtorOrderLineClient() {
        CompanyId = companyId,
        Item = x.ArticleCode,
        Qty = x.QuantityTotal,
        Unit = invItem?.Unit,
        Text = x.Description ?? invItem?.Name,
        Warehouse = invItem?.Warehouse,
        Location = invItem?.Location
    };

To ensure the cache is available, load the cache via the company entity:

// Force cache load
var companyId = api.CompanyId;
var company = Company.Get(companyId);
var cache = company.GetCache(typeof(InvItemClient), api);
77150cookie-checkUniconta Force Load Cache (Reporting)