bgmulinari / B1SLayer

A lightweight SAP Business One Service Layer client for .NET
MIT License
122 stars 42 forks source link

CrossJoin in request #55

Closed ViniciusEduardoM closed 8 months ago

ViniciusEduardoM commented 8 months ago

Hello, I was attempting to implement certain functionalities, and when I attempted to perform a crossjoin as an example, I encountered an error. This is because the crossjoin resource string utilizes specific arguments, which results in an error when passed through the method.

I utilized the following example, i use .GetAllAsync method:

$crossjoin(Items,MultiLanguageTranslations,MultiLanguageTranslations/TranslationsInUserLanguages)?$expand=Items($select=ItemCode,ItemName,ItemsGroupCode),MultiLanguageTranslations($select=TableName,FieldAlias,PrimaryKeyofobject),MultiLanguageTranslations/TranslationsInUserLanguages($select=LanguageCodeOfUserLanguage,Translationscontent) In the exception's throw, it returns the string:

/$crossjoin(Items,MultiLanguageTranslations,MultiLanguageTranslations/TranslationsInUserLanguages)%3F$expand=Items($select=ItemCode,ItemName,ItemsGroupCode),MultiLanguageTranslations($select=TableName,FieldAlias,PrimaryKeyofobject),MultiLanguageTranslations/TranslationsInUserLanguages($select=LanguageCodeOfUserLanguage,Translationscontent)?$skip=0

This results in an error: "Unknown error."

Could you provide some guidance or information regarding any upcoming features related to this Service Layer functionality?

Thank you for the project; it has greatly assisted me in my work!

bgmulinari commented 8 months ago

Hi, @ViniciusEduardoM.

How are you building this request in B1SLayer? I just tested the request below based on yours and it worked just fine:

var result = await serviceLayer
    .Request("$crossjoin(Items,MultiLanguageTranslations,MultiLanguageTranslations/TranslationsInUserLanguages)")
    .Expand("Items($select=ItemCode,ItemName,ItemsGroupCode),MultiLanguageTranslations($select=TableName,FieldAlias,PrimaryKeyofobject),MultiLanguageTranslations/TranslationsInUserLanguages($select=LanguageCodeOfUserLanguage,Translationscontent)")
    .GetAsync();
ViniciusEduardoM commented 8 months ago

It worked! Thank you, my brother; I wasn't doing it the right way.