Order Make writable clone not working

We are trying to update the order in sales order completed event, but getting below error when trying to make a writable clone.

The number of generic arguments provided doesn’t equal the arity of the generic type definition. (Parameter ‘instantiation’)

Litium version: 8.9.1

is there something we could do to avoid this issue?

Can you provide some code that you are using and the full stack trace or the error?

above is the code, where sales order is sent from the order completed event listener, and below is the stack trace.

Running number could not be set for order system id 793a3116-725e-4f29-9c9f-9e032a4bc949 - at System.RuntimeType.MakeGenericType(Type instantiation)
at Litium.ComponentModel.ReadOnlyExtensions.TryMakeWritableClone(Object value, Type type)
at Litium.ComponentModel.ReadOnlyExtensions.TryMakeWritableClone(Object value, Type type)
at Litium.ComponentModel.ReadOnlyExtensions.MakePropertiesChangable(IReadOnly entity)
at Litium.ComponentModel.ObjectBase.Litium.ComponentModel.IReadOnly.MakeWritableClone()
at Litium.Sales.SalesOrder.MakeWritableClone()

And what data is already inside the additional info property when you running the .MakeWritableClone()?

We have some order number mappings and some identifiers as below

{“Id”:“C121”,“OrderNumberMapping”:{“$type”:“System.Collections.Generic.Dictionary`2[[System.String, System.Private.CoreLib],[System.String, System.Private.CoreLib]], System.Private.CoreLib”,“LS10107-1”:“LS10107$9aaf31f1-d4df-48df-9631-02e38facdd21$a6ab9d94-50b6-430a-ab6e-f84de1c2579f$0”,“LS10107-2”:“LS10107$e928e81f-c96a-48cb-b750-6ed7d4be20f6$78af8e60-eda7-4655-84bf-e4cf12a6b19f$0”}}

The type you store inside the AdditionalInfo property is not fulfilling the requirements for the data that should be stored, see AdditionalInfo entity (litium.com)

The dictionary is not a simple object so the following requirement is not fulfilled

Object: must implement Litium.ComponentModel.IReadonly

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.