unable to access extratable
Using SO Online, I have created a ExtraTable named tid (y_tid) with field tid (x_tid)
ExtraTable ex;
Bool b = ex.load(2); // ExtraTableInfo getId() verifies id: 2
generates the following error: ExtraTable::load(): No extratable set! at ""
Also get an error trying to POST using Rest API '/api/v1/table/tid' {"x_tid":"100"}
"ErrorType": "UnauthorizedAccessException",
"Message": "You do not have access to the table, or it does not exist",
All Replies (7)
Hi Dan
You need to initialize ExtraTable with the extra table you're going to perform operations on first, using getExtraTable().
ex.load() loads a record in your table, so loading 2 here will attempt to get record id 2 of a table, but SuperOffice hasn't been told which table to load a record from.
This should work:
ExtraTable ex = getExtraTable("y_tid");
ex.load(2); // Will get y_tid.id = 2, if that's what you're attempting to do
That being said, I see that the documentation is suggesting the same thing you're trying to do, which doesn't seem right to me.
Thank you Espen!
Where can I find information using getExtraTable?
Hi Dan,
since you also tried via the REST I thought I'd add example on how that works. Here are three examples on how to get, update and delete a row in y_boat extratable.
### Get a row from extratable
GET https://crm.whatever.com/SuperOffice/api/v1/table/y_boat/3
Authorization: <todo>
### Change a value in an extratable
PUT https://crm.whatever.com/SuperOffice/api/v1/table/y_boat/3
Authorization: <todo>
Content-Type: application/json; charset=utf-8
{
"x_name": "Foo Bar Inc"
}
### Delete row in extratable
DELETE https://crm.whatever.com/SuperOffice/api/v1/table/y_boat/2
Authorization: <todo>
Hello,
I get the samme error when using REST on all new Extra Tables I create in SOD. Is this a bug? It works on old Extra Tables.
Try refreshing the cache by going to:
https://sod2.superoffice.com/CUST<TENANT NR>/cs/scripts/admin.fcgi?_sf=0&action=listExtraTables&restartNS=true
or call the flush method from the diagnostics agents;