Article

How to get a list of the lookup IDs from the interface

Question

How to get a list of the lookup IDs from the interface

Answer

1. Open your entity (Custom package)



2. Select that lookup, that you want to get values from. Copy its Lookup entity name.



3. Paste the Lookup name into the configuration search bar and press Enter. Copy the name of the schema with lookups caption.



4. Paste the lookup name from the step 3 instead of “SchemaName” in this code:

select = Ext.create("Terrasoft.EntitySchemaQuery", {
    rootSchemaName: "SchemaName"
});
select.addMacrosColumn(Terrasoft.QueryMacrosType.PRIMARY_COLUMN"Id");
select.addColumn("Name");
select.execute(function(response) {
    if (response.success) {
        if (response.collection.getCount() > 0) {
            console.log("Id | Name");
            response.collection.each(function(career) {
                console.log(career.get("Id")+ " | " + career.get("Name"));
            });
        }
    }
});



5. Go to some users page with Chrome browser, open there a developing tools panel (F12 for Chrome) and select a Console.



6. Paste the code into the console and wait a few seconds for the response. You’ll get a response at the console below.

 

 

 

Like 0

Like

Share

0 comments
Show all comments