DeleteItem
...
Deletes the given item if it exists.
...
Procedure: PlanSwift.DeleteItem(const ItemPath: WideString): WordBool;
API Call:Calls
Delphi
Code Block |
---|
language | delphi |
---|
theme | RDark |
---|
firstline | 1 |
---|
title | Using PlanSwift Object Model |
---|
linenumbers | true |
---|
collapse | true |
---|
|
// 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#
Code Block |
---|
language | c# |
---|
theme | RDark |
---|
firstline | 1 |
---|
title | Using IItem Object Model |
---|
linenumbers | true |
---|
collapse | true |
---|
|
public class PlanswiftApi
{
private PlanSwift Planswift { get; }
public PlanSwiftApi()
{
Planswift = new PlanSwift();
}
} |
Code Block |
---|
language | c# |
---|
theme | RDark |
---|
firstline | 1 |
---|
title | Using PlanSwift Object Model |
---|
linenumbers | true |
---|
|
Coming soon |
VB/VBA (OLE)
Code Block |
---|
language | vb |
---|
theme | RDark |
---|
firstline | 1 |
---|
title | Using IItem Object Model |
---|
linenumbers | true |
---|
collapse | true |
---|
|
// 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; |
Code Block |
---|
language | vb |
---|
firstline | 1 |
---|
title | Using PlanSwift Object Model |
---|
linenumbers | true |
---|
|
Coming soon |