Error while Calling Custom method using Ajax

We have created GetValue() method in  dll SalesForceCommunityQ for fetching data from Database and render it in tabular form in the administrator plugin editor.

[WebMethod]
public static string GetValue()
{
    Some code here to get data from database
}

This method is called using Ajax in same dll in the below source code.

SourceCode:

public string GetConfigurationHtml(string apiJson)
{
    return string.Format(@"
<script type='text/javascript'>
            jQuery(document).ready(function(){{
                        GetData();
            }});
            function GetData(){{
                    jQuery.telligent.evolution.get({{
                        url:'SalesForceCommunityQ/GetValue', 
                        data: {{}},
                        contentType: 'application/json; charset = utf-8',
                        dataType: 'json',
                        success: function(_data) {{
                            console.log(_data);
                        }}
                    }});
            }}
 </script>
    ", apiJson);
}

However we are getting below error.

ERROR: Failed to load resource: the server responded with a status of 404()/SalesForceCommunityQ/GetValue:1 )

What is the url value we need to use here?
We reffered the link( community.telligent.com/.../exposing-configuration-options)



Updated code
[edited by: Mahesh Mundra at 12:00 PM (GMT 0) on Wed, Oct 12 2022]
Parents
  • Hi . WebMethod attributes will not work here. However, there are a number of ways to implement custom Ajax callbacks for your UI, including directly inside your widget using executed file urls that potentially call custom scripted extension methods, or even custom plugins that define your own REST endpoints or raw HTTP handlers.

    I'd recommend starting with the following for the basics of how widgets and plugins work together, along with how to perform Ajax requests against widget-defined files and using plugin-defined APIs to access and serve your data to your widget:

     

    Widgets are used by Verint Community to implement individual units of the user interface. Widgets are scripted, upgrade-safe, localizable, configurable, distributable, fully editable in the browser,…
    Last edited in Verint Community 12.x > Developer Training
     

     

    Plugins are .net-based classes implementing IPlugin. Plugins are used to interact with Verint Community's in-process API by being installed directly within each web- and job-scheduler- node running the…
    Last edited in Verint Community 12.x > Developer Training
     

     

    When should I use JavaScript in widgets? Widgets include JavaScript to perform client-side behavior including issuing REST requests against the REST platform API, issuing AJAX requests against custom…
    Last edited in Verint Community 12.x > Developer Training
     

     

    Many plugin types are expected to render content, often HTML content. While this content can be generated completely within code, plugins can also elect to expose some or all of this rendering capability…
    Last edited in Verint Community 12.x > Developer Training
     

    I'll be happy to help with further questions.

Reply
  • Hi . WebMethod attributes will not work here. However, there are a number of ways to implement custom Ajax callbacks for your UI, including directly inside your widget using executed file urls that potentially call custom scripted extension methods, or even custom plugins that define your own REST endpoints or raw HTTP handlers.

    I'd recommend starting with the following for the basics of how widgets and plugins work together, along with how to perform Ajax requests against widget-defined files and using plugin-defined APIs to access and serve your data to your widget:

     

    Widgets are used by Verint Community to implement individual units of the user interface. Widgets are scripted, upgrade-safe, localizable, configurable, distributable, fully editable in the browser,…
    Last edited in Verint Community 12.x > Developer Training
     

     

    Plugins are .net-based classes implementing IPlugin. Plugins are used to interact with Verint Community's in-process API by being installed directly within each web- and job-scheduler- node running the…
    Last edited in Verint Community 12.x > Developer Training
     

     

    When should I use JavaScript in widgets? Widgets include JavaScript to perform client-side behavior including issuing REST requests against the REST platform API, issuing AJAX requests against custom…
    Last edited in Verint Community 12.x > Developer Training
     

     

    Many plugin types are expected to render content, often HTML content. While this content can be generated completely within code, plugins can also elect to expose some or all of this rendering capability…
    Last edited in Verint Community 12.x > Developer Training
     

    I'll be happy to help with further questions.

Children