unable to access extratable

lock
push_pin
done
Beantwortet
7

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",

 

31. Aug. 2023 | 11:07 AM

Alle Antworten (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.

31. Aug. 2023 | 11:22 AM
Docs have been update to reflect the correct expected flow.

Best regards!
4. Sept. 2023 | 01:50 PM

Thank you Espen!

Where can I find information using getExtraTable?

31. Aug. 2023 | 12:53 PM
You can find some information here:
https://docs.superoffice.com/en/automation/crmscript/reference/CRMScript.Global.Void.html#CRMScript_Global_Void_getExtraTable_String_
1. Sept. 2023 | 02:04 PM

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>
6. Sept. 2023 | 09:01 AM

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.

14. Dez. 2023 | 01:27 PM

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;

 

14. Dez. 2023 | 02:01 PM

Antwort hinzufügen