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
  • I would also suggest you look at exposing the data via a scripted fragment which can then be easily called within the widget, if you need to lazy load it you could as Michael mentions call a secondary widget file (.vm) via a js call, lots of widgets do this so there are many examples 

    The using Ajax developer guide shows how you can call a widget sub file from javascript
     

Reply
  • I would also suggest you look at exposing the data via a scripted fragment which can then be easily called within the widget, if you need to lazy load it you could as Michael mentions call a secondary widget file (.vm) via a js call, lots of widgets do this so there are many examples 

    The using Ajax developer guide shows how you can call a widget sub file from javascript
     

Children
No Data