Hi,
I'm encountering issues with the Microsoft OData client and connected service while trying to get and place quotations in IFS. Specifically, I'm running into null exception errors when reading the response for "OrderQuotationLine".
The exceptions occur when the client attempts to read the "Target" of any Action or Function on the "OrderQuotationLine" entity within the "UpdateEntityDescriptor" function in "MaterializerEntry.cs". For instance, the "OrderQuotationLine_DefaultCopy" function, which lacks a target, triggers this issue.
I tried removing these Actions and Functions from the models, but this led to null exceptions when the OData client attempted to add a link in "AddNestedResourceInfo" for properties that don't seem to have links.
I can successfully read responses when calling for example OrderQuotationSet for the "OrderQuotation" model without any issues.
Here is an example of the code I'm working with. The first request to get a quotation with Quotation Number 123 works perfectly. However, the second request results in the null exception described above.
var context = new IfsApp.SalesQuotationHandling.DefaultContainer(new Uri("https://BASE_URL.cloud/main/ifsapplications/projection/v1/SalesQuotationHandling.svc/"));
context.SendingRequest2 += (sender, eventArgs) =>
{
var authHeader = $"Bearer TOKEN";
if (!eventArgs.IsBatchPart)
{
eventArgs.RequestMessage.SetHeader("Authorization", authHeader);
}
};
var qoute = context.OrderQuotationSet.ByKey("123").GetValue();
var line = context.Reference_OrderQuotationLine.ByKey("123", "1", "1", 0).GetValue();
I have also used a proxy in Postman to inspect the responses. The results from IFS appear to be correct and as expected.
Has anyone faced similar issues with OData client or have any suggestions on how to resolve this?
Thanks in advance for your help!