var currentUser = ew.ajax("<?php echo Encrypt("SELECT COUNT(*) FROM s_group_details WHERE GROUP_ID = 'GRP177' AND MEMBERSHIP_LEVEL = 10 AND MEMBER_ID = '{query_value}'"); ?>", currUserID);
This is the code, this is displaying undefined.
var currentUser = ew.ajax("<?php echo Encrypt("SELECT COUNT(*) FROM s_group_details WHERE GROUP_ID = 'GRP177' AND MEMBERSHIP_LEVEL = 10 AND MEMBER_ID = '{query_value}'"); ?>", currUserID);
This is the code, this is displaying undefined.
Your argument is wrong, you may read the examples of Ajax by API and Client Script.
var sasy_main_details = ew.ajax("<?php echo Encrypt("SELECT PROJECT_ID,SYSTEM_SUBSYSTEM_FG,RME_OR_ATE,FAI_APPLICABLE,WAIVER_REFERENCE FROM sasy_requests WHERE SASY_REFERENCE = '{query_value}'"); ?>", sasy_ref);
var prjID = sasy_main_details[0];
var system_fg = sasy_main_details[1];
var rmeOrAte = sasy_main_details[2];
var faiApplicable = sasy_main_details[3];
var waiverRef = sasy_main_details[4];
$("#x__PROJECTID").val(prjID);
$("#x_SYSTEM_FG").val(system_fg);
if (rmeOrAte == 'RME')
$("#x_RME_OR_ATE_0").prop("checked", true);
if (rmeOrAte == 'ATE')
$("#x_RME_OR_ATE_1").prop("checked", true);
if (faiApplicable == 'Yes')
$("#x_FAI_APPLICABLE_0").prop("checked", true);
if (faiApplicable == 'No')
$("#x_FAI_APPLICABLE_1").prop("checked", true);
$("#x_WAIVER_REFERENCE").val(waiverRef);
This is the code which was not working so i gave the query in Api action ,
$app->get('/sasy_main_details/{sasy_ref}', function ($request, $response, $args) {
$sasy_ref = $args["sasy_ref"] ?? null; // Get the input value
if ($sasy_ref !== null)
$response = $response->write(ExecuteRow("SELECT PROJECT_ID,SYSTEM_SUBSYSTEM_FG,RME_OR_ATE,FAI_APPLICABLE,WAIVER_REFERENCE FROM sasy_requests WHERE SASY_REFERENCE = " . AdjustSql($sasy_ref))); // Output field value as string
return $response; // Return Psr\Http\Message\ResponseInterface object
});
This is not working, but for other query which has single value it is working, how to make this work for multiple row