NewProperty



Creates a new property as specified and returns the new IPropertyObject.



Syntax:

Procedure: NewProperty(PropertyName: String; AFormula: String = ''; PropertyType: PropertyTypes = ptNumber): IPropertyObject;



API Calls

Delphi

// PlanSwift Code:


AProp := Item.GetProperty('Name');
If VarIsClear(AProp) then
  AProp := Item.NewProperty('Name', 'NewProperty', ptText);
Result := AProp.ResultAsString;


// FreshDesk Code:


var
  ps: IPlanSwift;
  est: IItem;
  itm: IItem;
  prop: IPropertyObject;
begin
  // Create Planswift Interface
  ps := coPlanswift.Create;
  // Get the Estimating Tab
  est := ps.GetItem('Job\Takeoff');
  // Create  a New Area item
  itm := est.NewItem('Area', 'NewProperty Example');
  // Create a new Property Named "My Custom Property"
  prop := itm.NewProperty('My Custom Property', 'Sample Formula', ptText);
  // Add Property to the "API Properties" Group
  prop.Group := 'API Properties';
  // Show the Properties dialog box
  itm.Edit(true);
  // Free Planswift
  ps := nil;
 
end;


Coming soon

C#

public class PlanswiftApi
{
    private PlanSwift Planswift { get; }
    public PlanSwiftApi()
    {
        Planswift = new PlanSwift();
    }
}


Coming soon

VB/VBA (OLE)

Coming soon


Coming soon