Issue with executing html5 SDK code

d_farouk
d_farouk Member
edited May 25, 2021 in AppWorks #1

Hi,

I published a web-page utilizing html5 SDK apis (cordys.ajax), now when i deploy this page to another organization it invokes the webservice on the first organization. Any idea how to resolve.

I'm referring to cordys apis, using this url:

<script src="/cordys/html5/cordys.html5sdk.js" type="text/javascript"></script>

Here's code snippet of the js invoking webservice:

$.cordys.ajax({
	method: "GetTopFiveAppsByLDCCode",namespace: "http://schemas/BASSEGASHill/Application/operations", dataType: '* json', parameters: { LDCCode: LDC, date: CurrentDate }
		}).done(function (AppsResponse) { // Show the Apps on the screen 
			// console.log(AppsResponse)
			data = AppsResponse
			var i = 1
			$.each(AppsResponse, function (k, v) {
					// console.log(k)
					if (k.indexOf("Application") > -1) {
							//console.log(k);
							=//console.log(v);
							=arr.push({ "rowNum": i, "App_No": v.App_No, "National_ID": v.National_ID, "LDC_Name": v.LDC_Name, "Client": v.Client, "Start_Date": moment(v.Start_Date).format("DD/MM/yyyy") })
							i += 1
							// console.log(v)
				}
				});
				d.resolve(arr);
				// console.log(arr);
	}).fail(function (error) { alert("Error " + error + " in getting Apps"); d.reject(); });

Comments

  • jpluimers
    jpluimers E Community Moderator
    edited May 26, 2021 #2

    The organization in which the request is executed is determined by the organization context of the request. The organization name is taken from the url.

    For example, when executing the request via /home/system, then system is the organization context.

    When using /home/acme, then acme is the organization context.

    In case no context is given, for example when /cordys is used, then the default organization as configured for the user is used. See the user details in the User Manager.

  • Thanks John .. but i'm confused how to call /cordys with respect to the organization.

    There's no sdk script at the organization path:

    /home/acme/cordys/html5/cordys.html5sdk.js

  • jpluimers
    jpluimers E Community Moderator

    /cordys is actually http(s)://<server>/cordys/html5/cordys.html5sdk.js, so without the /home/<organization>.