<@USV3W3YB1> There is no way to do that... you nee...
# suitescript
a
@Phillip There is no way to do that... you need to create an Object/File with the Country Name and CODE.
m
@alien4u previously wasn't possible but the countries table is exposed to SuiteQL so now it is
message has been deleted
@Phillip ☝️
a
@michoel Do you have any code snippet doing that?
m
Copy code
require(['N/query'], function(query) {
    function getCountryIdFromName(countryName) {
        const sql = `SELECT id FROM country WHERE name = ?`;
        const results = query.runSuiteQL({
            query: sql,
            params: [countryName]
        }).asMappedResults();
        return results.length ? results[0].id : null;
    }

    getCountryIdFromName('Australia');
});
@alien4u ☝️
a
@michoel Thanks... appreciate it. 💯