ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / Salesforce functions
  • Possible error cases:
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
<sfConnection variable>.ForwardQuery (Function)
In french: <Variable sfConnexion>.AvanceRequête
Continues to run a SOQL query (Salesforce Object Query Language) on the records of a Salesforce database. The query was run by <sfConnection variable>.ExecuteQuery.
Example
// Connect to Salesforce
Cnt is sfConnection
Cnt.Login = "balthazar@gmail.com"
Cnt.Password = "qwerty" + "XXB12VCZ54"
IF Cnt.Connect() = False THEN
	Error("The connection failed")
	RETURN
END

ResQuery is sfExecuteQueryResult
ResQuery = Cnt.ExecuteQuery("SELECT Date__c,Miles__c,Contact__c FROM Mileage__c")

LOOP
	MyRecord is sfObject
	FOR EVERY ResRequest MyRegistration..Object
		Trace("---- Type: " + MyRecord..TypeObject + " | ID: " + MyRecord..ID)
		Trace(MyRecord..Date__c + " / " + ...
		MyRegistration..Miles__c + " / " + MyRegistration..Contact__c)
	END

	IF ResRequest..Finished = False THEN // Check if any "on fetch" records remain
		ResQuery = Cnt.ForwardQuery(ResQuery..QueryLocator)
	ELSE
		EXIT // End of playback
	END
END

FOR EVERY ResRequest MyRegistration..Object
	Trace("---- Type: " + MyRegistration..TypeObject + ...
		"| ID: " + MyRegistration..ID)
	Trace(MyRecord..Date__c + " / " + ...
		MyRegistration..Miles__c + " / " + MyRegistration..Contact__c)
END
Syntax
<Result> = <Salesforce connection>.ForwardQuery(<Query location>)
<Result>: sfExecuteQueryResult variable
Name of the sfExecuteQueryResult variable that contains the result data, especially the Salesforce records corresponding to the query result.
<Salesforce connection>: sfConnection variable
Name of the variable of type sfConnection to be used.
<Query location>: Unicode string
String used to identify the query. This string is returned by the QueryLocator property of the last sfExecuteQueryResult variable received.
Remarks

Possible error cases:

  • The Internet connection is not valid.
  • The authentication was not performed properly.
  • The XML response of the server cannot be read.
To find out whether an error occurred, use the ErrorOccurred variable.
Component: wd300ggl.dll
Minimum version required
  • Version 24
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 09/25/2024

Send a report | Local help