Issue with writing/reading blob field to and from the table

I'm using business central online. 

My table has a blob field and I need to store web API authentication token into it.

When I make a call to web API for the first time, I store the generated token in the table so that it can be re-used next time when I make a web API call.

When I try to read the blob field from the table, it is always empty.

Here is my code.

// store token in the table

Config."Current Auth Token".CreateOutStream(OutStr);
OutStr.WriteText('test token');
Config.MODIFY();
//Retrieve token
if(Config."Current Auth Token".HasValue()) then begin
Config."Current Auth Token".CreateInStream(InStr);
Instr.ReadText(token);
End;
Parents
No Data
Reply Children
No Data
Related
Recommended