0 votes

Hi,

I try to create an envelop to return custom lookup data with the api soap. My envelop work fine with a query but i got an error with
here is my code:

I check the table id and the name of the field and they are right, and exists.

the response is:


EOleException
LookupTableManager
Cannot fetch Lookup Table Values on table "LKACTISTATUS.F_LABEL"

ErrorContext

EEfficyLookupTableError 1806
(ENTT-1515) LookupTableManager
FieldName "0" not found in SYS_FIELDS

Error

EEfficyLookupTableError 1805
(ENTT-1510) LookupTableManager
Cannot fetch Lookup Table Values on table "LKACTISTATUS.F_LABEL"

Error

ESlspException 0
Application Server Error
<faultid/>
ENTT-1515

asked in Partners by (182 points)
We miss your SOAP code
here is the complete code:
<SOAP-ENV:Envelope xmlns:efficy="http://www.efficy.com" xmlns:SOAP-ENV="http://www.w3.org/2001/12/soap-envelope">
   <SOAP-ENV:Body>
      <efficy:logon database="test" user="admin" password="ourpassword"/>                 
         <efficy:api>
            <datacontainer id="5" operation="query" master="-1" param1="1477113" detail="86" includeblobcontent="true"/>
            <datacontainer id="5" operation="getlookupdata" tableid="80083" fieldname="F_LABEL"/>
         </efficy:api>
      <efficy:logoff/>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
sorry is this one:
<SOAP-ENV:Envelope xmlns:efficy="http://www.efficy.com" xmlns:SOAP-ENV="http://www.w3.org/2001/12/soap-envelope">
   <SOAP-ENV:Body>
      <efficy:logon database="test" user="admin" password="ourpassword"/>                 
         <efficy:api>
            <datacontainer id="5" operation="getlookupdata" tableid="80083" fieldname="F_LABEL"/>
         </efficy:api>
      <efficy:logoff/>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

1 Answer

0 votes
Best answer

A common mistake is that the ID of the lookuptable and fieldname of the lookup are passed (as you did), instead of giving the ID of the entity table (what Efficy expects). To explain it better, I made a working sample.

Here we show the content of LK_COUNTRY by providing K_TABLE=1000 (COMPANIES) and the FIELDNAME=COUNTRY as parameters of the getlookupdata operation.

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope" xmlns:efficy="http://www.efficy.com">
   <SOAP-ENV:Body>
      <efficy:api>
         <datacontainer operation="getlookupdata" tableid="10000" fieldname="COUNTRY"/>
      </efficy:api>
   </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

This will return all country labels. However, the result is quite useless, as you don't even get the K_COUNTRY key back. You just get the translated text label.

<efficy:api handled="true">
    <datacontainer operation="getlookupdata" tableid="10000" fieldname="COUNTRY" handled="true">
        <document class="StringList">
            <rows>
                <row>BELGIUM</row>
                <row>FRANCE</row>
                ...
                <row>ZIMBABWE</row>
            </rows>
        </document>
    </datacontainer>
</efficy:api>

There is no better API method, AFAIC.

As an alternative, add an SQL query in either SYS_QUERIES or QUERIES to fetch the content of your lookup. Execute the query SOAP operation to get the result of that query.

answered by (6.9k points)
selected by
Welcome to Efficy Overflow, where you can ask questions and receive answers from other members of the community.
1,169 questions
1,427 answers
1,718 comments
325 users