Currently we are storing the JSON Object Body in a column which is [UsrJsonBody] [nvarchar](MAX) of a custom table. But sometime the whole JSON is not properly storing. That means for quite big JSONs the later part is getting missed. Can I know is there any issue with this approach. Please check the below code snippets. Thank you.
//Custom table creation
CREATE TABLE [dbo].[XXPOCreateHist](
[ID] [int] IDENTITY(1,1),
[CompanyID] [int] NOT NULL,
[IntegrateDate] [datetime],
[PONumber] [nvarchar](50),
[IntegrateStatus] [nvarchar](2),
[ErrorDesc] [nvarchar](256) ,
[IntegrationType] [nvarchar](50),
[UsrJsonBody] [nvarchar](MAX) ,....
//JSON Storing approach in the Graph file
var options = new JsonSerializerOptions { WriteIndented = true };
var json=JsonSerializer.Serialize(obj,options);
PXTrace.WriteInformation(json);
....
XXPOCreateHist toBeInserted = new XXPOCreateHist();
toBeInserted.PONumber=order.OrderNbr;
toBeInserted.IntegrateDate=DateTime.Now;
toBeInserted.UsrJsonBody = json;
XXPOCreateHistData.Insert(toBeInserted);
XXPOCreateHistData.Cache.Persist(PXDBOperation.Update);