ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Communication / Salesforce functions
  • Properties specific to sfSaveResult variables
  • Functions that use the sfSaveResult type
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
Others
Stored procedures
sfSaveResult (Variable type)
In french: sfRésultatSauvegarde
The sfSaveResult type is used to find out the result of SFAdd and SFModify. The characteristics of this result are returned by several WLanguage properties.
Note: For more details on the declaration of this type of variable and the use of WLanguage properties, see Declaring a variable.
Example
// Connexion à Salesforce
Cnx is sfConnection
Cnx.Login = "balthazar@gmail.com"
Cnx.Password = "azerty" + "XXB12VCZ54"
IF SFConnect(Cnx) = False THEN
	Error("La connexion a échoué")
	RETURN
END

// Récupération de données
ResRequête is sfExecuteQueryResult
ResRequête = SFExecuteQuery(Cnx, "SELECT Date__c,Miles__c,Contact__c FROM Mileage__c")

UnEnregistrement is sfObject
FOR EACH UnEnregistrement OF ResRequête.Object
	 Trace("---- Type : " + UnEnregistrement.TypeObjet + " | ID : " + UnEnregistrement.ID)
	 Trace(UnEnregistrement.Date__c + " / "+ UnEnregistrement.Miles__c + ...
							  " / "+ UnEnregistrement.Contact__c)
END

// Modification de données
UnEnregistrement = ResRequête.Object[1]
UnEnregistrement.Miles__c = 698	 //Modification
tabObjets is array of 1 sfObject
Add(tabObjets, UnEnregistrement)

// Ajout d'une nouvelle donnée
NouvelEnreg is sfObject
NouvelEnreg.TypeObjet = "Mileage__c"
NouvelEnreg.Date__c = "2009-02-15"
NouvelEnreg.Miles__c = 222
Add(tabObjets, NouvelEnreg)

tabRes is array of sfSaveResult
tabRes = SFModify(Cnx, tabObjets, sfCreateIfNotFound, "IDExterne")

FOR EACH res OF tabRes
	Trace("Succès = " + res.Succès + " | Créé : " + res.Créé)
END
Properties

Properties specific to sfSaveResult variables

The following properties can be used to handle the result of SFAdd and SFModify:
NameType usedEffect
CreatedBoolean
  • True if the record was created,
  • False if the record was modified or if an error occurred.
ErrorArray of sfErrorStatus report of errors.
IDCharacter stringIdentifier of created or modified object.
This property is read-only.
SuccessBoolean
  • True if the modification or the creation was performed,
  • False otherwise.
Remarks

Functions that use the sfSaveResult type

SFAddCreates a record in a file of a Salesforce database.
SFModifyModifies the records of a file defined in Salesforce.
Minimum version required
  • Version 14
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help