To open any link in a new tab, preserving your position in the current article, just hold down the <CTRL> key on your keyboard before clicking the link or click using your mouse wheel.

DeleteItem (2)

DeleteItem



Deletes the given item if it exists.



Syntax:

Procedure: PlanSwift.DeleteItem(const ItemPath: WideString): WordBool;


API Calls

Delphi

Using PlanSwift Object Model
// PlanSwift Code:
var
  sItemPath: string;
begin
  if(PlanSwift.DeleteItem(sItemPath) = TRUE) then
    begin
      // do something...
    end;
end;

// FreshDesk Code:

var  
ps: IPlanSwift;
  est: IItem;
  i: Integer;
  itm: IItem;
begin
  // Create Planswift Interface
  ps := coPlanswift.Create;
  // Get the Estimating Tab
  est := ps.GetItem('Job\Takeoff');
  // Loop through all items on the first level
  for i := est.ChildCount - 1 downto 0 do
  begin
    // Get the item at index i
    itm := est.ChildItem[i];
    // delete the item
    itm.Delete;
  end;
  // Free Planswift
  ps := nil;
end;

C#

Using IItem Object Model
public class PlanswiftApi
{
    private PlanSwift Planswift { get; }
    public PlanSwiftApi()
    {
        Planswift = new PlanSwift();
    }
}
Using PlanSwift Object Model
Coming soon


VB/VBA (OLE)

Using IItem Object Model
// PlanSwift Code:
AreYouSure := False;

If then
  Item.Delete;


// FreshDesk Code:
var  ps: IPlanSwift;
  est: IItem;
  i: Integer;
  itm: IItem;
begin
  // Create Planswift Interface
  ps := coPlanswift.Create;
  // Get the Estimating Tab
  est := ps.GetItem('Job\Takeoff');
  // Loop through all items on the first level
  for i := est.ChildCount - 1 downto 0 do
  begin
    // Get the item at index i
    itm := est.ChildItem[i];
    // delete the item
    itm.Delete;
  end;
  // Free Planswift
  ps := nil;
end;
Using PlanSwift Object Model
Coming soon



Copyright 2023 ConstructConnect