Creating a new partition detail

The following code shows the creation of a policy with detail values:

define variable policy as IPartitionPolicy no-undo. 
define variable tbl as ITable no-undo. 

assign
    /* get the table from the service */
    Tbl = Service:GetTable("Employee")  
    /* get a new empty policy from the service  */
    policy = Service:NewPartitionPolicy("EmployeePolicy")
    policy:Description = "Employee department partition")
    policy:DefaultDataArea = Service:GetArea("Area1")
    policy:DefaultIndexArea = Service:GetArea("Area1Idx").
    policy:DefaultLobArea = Service:GetArea("Area1Lob")
    policy:DefaultAllocation = "Delayed"
    policy:Table = tbl
    
    /* add the field to the policy - found on the table */
    policy:Fields:Add(tbl:Fields:Find("State")).

service:UpdatePolicyDetail(policy).

The above example partitions the orderline table on order date and sets the HasRange property to true so that all data less than the specified value is added to the partition.