PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
  • Properties specific to the description of sfSaveResult variables
  • Functions that handle the sfSaveResult type
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
sfSaveResult (Type of variable)
In french: sfRésultatSauvegarde (Type de variable)
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: See Declaring a variable for more details.
Versions 20 and later
Linux This type of variable is now available for WINDEV applications in Linux.
New in version 20
Linux This type of variable is now available for WINDEV applications in Linux.
Linux This type of variable is now available for WINDEV applications in Linux.
Example
// Connect to Salesforce
Cnt is sfConnection
Cnt..Login = "vince@gmail.com"
Cnt..Password = "qwerty" + "XXB12VCZ54"
IF SFConnect(Cnt) = False THEN
Error("The connection failed")
RETURN
END
 
// Retrieve the data
ResQuery is sfExecuteQueryResult
ResQuery = SFExecuteQuery(Cnt, "SELECT Date__c,Miles__c,Contact__c FROM Mileage__c")
 
ARecord is sfObject
FOR EACH ARecord OF ResQuery..Object
 Trace("---- Type: " + ARecord..ObjectType + " | ID: " + ARecord..ID)
 Trace(ARecord..Date__c + " / "+ ARecord..Miles__c + ...
  " / "+ ARecord..Contact__c)
END
 
// Modify the data
ARecord = ResQuery..Object[1]
ARecord..Miles__c = 698     // Modification
arrObjects is array of 1 sfObject
Add(arrObjects, ARecord)
 
// Add a new data
NewRec is sfObject
NewRec..ObjectType = "Mileage__c"
NewRec..Date__c = "2009-02-15"
NewRec..Miles__c = 222
Add(arrObjects, NewRec)
 
arrRes is array of sfSaveResult
arrRes = SFModify(Cnt, arrObjects, sfCreationIfNotFound, "IDExternal")
 
FOR EACH res OF arrRes
Trace("Success = " + res..Success + " | Created: " + res..Created)
END
Remarks

Properties specific to the description of 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 available in read-only.
SuccessBoolean
  • True if the modification or the creation was performed,
  • False otherwise.

Note: These properties can be used with one of the following syntaxes:
  • <Variable name>..<Property name>
  • <Variable name>.<Property name>

Functions that handle the sfSaveResult type

Versions 14 and later
SFAdd
New in version 14
SFAdd
SFAdd
Creates a record in a file of a Salesforce database.
Versions 14 and later
SFModify
New in version 14
SFModify
SFModify
Modifies 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