Topics   All   MacOS (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server   Client   Old   Deprecated   Guides   Examples   Videos
New in version: 9.5   10.0   10.1   10.2   10.3   10.4   10.5   11.0   11.1   11.2    Statistic    FMM    Blog  

SocialRequest.Perform

Performs the request.

Component Version macOS Windows Linux Server iOS SDK
Social 5.3 ✅ Yes ❌ No ❌ No ❌ No ✅ Yes

Deprecated

This function was deprecated.

MBS( "SocialRequest.Perform"; Request; Filename; ScriptName )   More

Parameters

Parameter Description Example
Request The reference number for the social request as you got it from SocialRequest.New function. $request
Filename The database file name where the script is located. "test.fmp12"
ScriptName The script to call when access is decided. "MyScript"

Result

Returns OK or error.

Description

Performs the request.
Once request is done, you can query the result with SocialRequest.GetResponse function. The plugin calls the given script and passes the request reference number as parameter.
Function requires 64-bit Mac application, so please use FileMaker 14 or newer.

With plugin version 6.0 or newer the script name can be a script ID number. In that case the plugin queries the script name for the given script ID. This allows to call scripts by ID and avoid problems if scripts are later renamed.

FileMaker 19.2 adds a fmplugin extended privileges. You my need to add such an extended privileges to allow the plugin to trigger scripts. See FileMaker product documentation for details.

Examples

Post on Twitter:

Set Variable [$accounts; Value:MBS( "Social.Accounts"; "Twitter")]
Set Variable [$accountIdentifier; Value:GetValue($accounts; 1)]
If [$accountIdentifier = ""]
    Show Custom Dialog ["No Twitter account allowed?"]
Else
    Set Variable [$request; Value:MBS( "SocialRequest.New"; "Twitter"; "https://api.twitter.com/1.1/statuses/update.json"; "POST" )]
    Set Variable [$r; Value:MBS( "SocialRequest.AddParameter"; $request; "status"; Tweets::Message )]
    Set Variable [$r; Value:MBS( "SocialRequest.SetAccount"; $request; $accountIdentifier)]
    Set Variable [$r; Value:MBS( "SocialRequest.Perform"; $request; Get(FileName); "TweetCompleted" )]
End If

Script triggered after tweeting finished:

Set Variable [$request; Value:Get(ScriptParameter)]
Set Field [Tweets::Status; MBS( "SocialRequest.GetResponse"; $request; "StatusCode" )]
Set Field [Tweets::Response; MBS( "SocialRequest.GetResponse"; $request; "Response" )]
Set Field [Tweets::ErrorMessage; MBS( "SocialRequest.GetResponse"; $request; "Error" )]
Set Field [Tweets::Headers; MBS( "SocialRequest.GetResponse"; $request; "Headers" )]
Set Variable [$r; Value:MBS( "SocialRequest.Release"; $request )]

See also

Example Databases

Created 28th August 2015, last changed 12nd June 2020


SocialRequest.New - SocialRequest.Release

Feedback: Report problem or ask question.