This function is available on NewEdit pages and parameter pages. It can only be invoked from a control's button JavaScript.
Executes a Web Service Call, GenAI, or Microsoft Graph menu item.
It uses the columns returned from the menu item's @Action = 'Finished' call to populate input fields whose names match those column names.
For GenAI, columns may also be returned from the @Action='StoreResponse' call.
This function is unable to set the value of fields in multirows.
setFieldValuesFromWebService('PersonDetails_WsLookup', 'personalIdentityNumber={personalIdentityNumber}')
CREATE OR ALTER PROCEDURE dbo.PersonDetails_LookupWebServiceCall
@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;
CREATE OR ALTER PROCEDURE dbo.ChatBot_GenAI
@Action varchar(100) = NULL,
@Response nvarchar(max) = NULL,
@TotalUsage int = NULL
AS
BEGIN
/* ... */
IF @Action = 'StoreResponse'
BEGIN
/* Updates the fields AIResponse and AITokens with the fetched values. */
SELECT
@Response AS AIResponse,
@TotalUsage AS AITokens;
END;
END;
setFieldValuesFromWebService(menuItemAlias)
setFieldValuesFromWebService(menuItemAlias, passingfields)
setFieldValuesFromWebService(menuItemId)
setFieldValuesFromWebService(menuItemId, passingfields)
Alias of menu item to call.
Menu item to call.
Values to pass to the menu item. Formatted as a standard query string.
Example: 'ssno={ssno}&task=getinfo'