setFieldValuesFromWebService

 Show all Hide all

Usable on NewEdit pages and parameter pages. Executes a web service call-menu item and uses the columns returned from its @Action='finished' call to set the values of input fields whose names match the column names.

This function can only be called from a field's button javascript.

Example

JavaScript button

setFieldValuesFromWebService(123, 'personalIdentityNumber={personalIdentityNumber}')

Web service call procedure

CREATE OR ALTER PROCEDURE dbo.LookupPersonalDetails
	@Action                 varchar(100) = NULL,
	@PersonalIdentityNumber varchar(50)
AS
BEGIN
	/* ... */

	IF @Action = 'Finished'
	BEGIN
		/* Updates the fields FullName, HomeAddress and HomeZipCode with the fetched values. */
		SELECT
			D.FullName,
			D.HomeAddress,
			D.HomeZipCode
		FROM
			dbo.PersonDetails D
		WHERE
			D.PersonalIdentityNumber = @PersonalIdentityNumber
	END
END

Usage

setFieldValuesFromWebService(menuItemId)
setFieldValuesFromWebService(menuItemId, passingfields)

menuItemId : Number

Menu item to call. This menu item must exist and use the Web Service Call component.

passingfields : String

Values to pass to the menu item. Formatted as a standard query string.

Example: 'ssno={ssno}&task=getinfo'