Syntax

code

Function: SelectItemDialog(Header: String; Title: String; RootItemID: String): IItem;

Description

Displays the Planswift Select Item dialog to the user, then returns the selected item.

Code Reference

  • 1. Create a New Form application
  • 2. Add a button to the form
  • 3. add Planswift to reference (Planswift9_tlb in the uses)
  • 4. copy code to button onclick event

code

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

procedure TForm1.psSelectItemDialog(Sender: TObject);

var

  ps: IPlanSwift;

  itm: IItem;

begin

  //Create Planswift Interface

  ps := CoPlanswift.Create;

  //Open Item Dialog and select planswift root

  itm := ps.SelectItemDialog('Select An Item','Select An item',ps.Root.FullPath);

  //Show Selected item Name

  ShowMessage(itm.Name + 'Has been selected');

  //Free Planswift

  ps := nil;

 

end;