Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

ExecuteScript


...

Executes the script property, passing a CRLF delimited list of parameters. Returns the value assigned to Result in the script.

...

Procedure: ExecuteScript(ParamList: String = ''): Variant;


API

...

Calls

Delphi

Code Block
languagedelphi
themeRDark
firstline1
titleUsing PlanSwift Object Model
linenumberstrue
collapsetrue
PlanSwift Code:


AProp := Item.GetProperty('My Script Property');
If (Not VarIsClear(AProp)) And (AProp.PropertyType = 'Script') Then
  Result := AProp.ExecuteScript;


FreshDesk Code:


procedure psExecuteScript;
var
  ps: IPlanSwift;
  itm: IItem;
  prop: IPropertyObject;
  formula: string;
begin
  //Create The Planswift Interface
  ps := coPlanswift.Create;
  //Get the Selected Item
  itm := ps.SelectedItem;
  //Check if var is empty
  if varisclear(itm) then begin
    showmessage('Please Select an Item');
    ps := nil;
    Exit;
  end;
  //write The Script to execute
  formula :=  'ShowMessage(' + chr(39) + 'Script has been Executed' + chr(39) + ');';
  //Create a New Property and set its type to script
  prop := itm.NewProperty('Custom Script',formula,ptscript);
  //Set the Script type to method
  prop.ScriptType := stMethod;
  //Set the language to pascal
  prop.ScriptLanguage := slPascal;
  //Execute the Script
  prop.ExecuteScript('');
  //Free Planswift interface
  ps := nil;
end; 

C#

Code Block
languagec#
themeRDark
firstline1
titleUsing IItem Object Model
linenumberstrue
collapsetrue
public class PlanswiftApi
{
    private PlanSwift Planswift { get; }
    public PlanSwiftApi()
    {
        Planswift = new PlanSwift();
    }
}


Code Block
languagec#
themeRDark
firstline1
titleUsing PlanSwift Object Model
linenumberstrue
Coming soon

VB/VBA (OLE)

Code Block
languagevb
firstline1
titleUsing IItem Object Model
linenumberstrue
Coming soon


Code Block
languagevb
firstline1
titleUsing PlanSwift Object Model
linenumberstrue
Coming soon