Quantcast
Viewing all articles
Browse latest Browse all 2504

Connect API ROQL query for Answers by Product (8 Comments)

Topic by Simon Kay

So I'm using an Ajax Controller from the customer portal to search for answers with a custom field value assigned to a specific product but the query keeps failing.


RNCPHP\ROQL::query("SELECT * FROM Answer where CustomFields.c.is_issueofday = 1")->next();

Returns perfectly, but I wanted to know what products are assigned to the answer and filter by them so I ran a describe query and found this:

RNCPHP\ROQL::query("DESCRIBE Answer")->next();

(
    [Name] => Products
    [Type] => SubTable
    [Path] => Answer.Products
)

So I tried this Query:

RNCPHP\ROQL::query("SELECT Answer.Products FROM Answer where CustomFields.c.is_issueofday = 1")->next();

But it just returns an error:

<b>Fatal error</b>:  Uncaught exception 'RightNow\Connect\v1_3\ConnectAPIError' with message 'Non-existant column: 'Products'' in /cgi-bin/bethsoft_en.cfg/scripts/cp/customer/development/controllers/AjaxReportCaller.php:73
Stack trace:
#0 /cgi-bin/bethsoft_en.cfg/scripts/cp/customer/development/controllers/AjaxReportCaller.php(73): RightNow\Connect\v1_3\ROQL::query('SELECT Answer.P...')
#1 [internal function]: Custom\Controllers\AjaxReportCaller-&gt;topicsOfDay()
#2 /cgi-bin/bethsoft_en.cfg/scripts/cp/core/framework/3.3.2/CodeIgniter/system/CoreCodeIgniter.php(2043): call_user_func_array(Array, Array)
#3 /cgi-bin/bethsoft_en.cfg/scripts/cp/core/framework/3.3.2/init.php(143): require_once('/cgi-bin/bethso...')
#4 /cgi-bin/bethsoft_en.cfg/scripts/cp/index.php(66): require_once('/cgi-bin/bethso...')
#5 /cgi-bin/bethsoft_en.cfg/scripts/bootstrap/Loaders/CustomerPortal.php(16): require_once('/cgi-bin/bethso...')
#6 /cgi-bin/bethsoft_en.cfg/scripts/bootstrap/Router.php(25): RightNow\Routes\CustomerPortal::run(Array)
#7 /cgi-bin/bethsoft_e in <b>/cgi-bin/bethsoft_en.cfg/scripts/cp/customer/development/controllers/AjaxReportCaller.php</b> on line <b>73</b><br />

I tried using the Connect Knowledge API but seems you cannot filter by CustomFields there. Have you any solutions. Using report widget is not available.


Viewing all articles
Browse latest Browse all 2504

Trending Articles