cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

How to create PlanActivity using code?

VasiliyRepecki
12-Amethyst

How to create PlanActivity using code?

Hi.

I need create com.ptc.projectmanagement.plan.PlanActivity and add into existing Project using java code. How i can do it?

Thanks.

2 REPLIES 2

first, need get the project,then coding like this:

Plan plan = (Plan)PlanHelper.service.getPlan(ObjectReference.newObjectReference(project));

PlanActivity activity = PlanActivity.newPlanActivity(WTContainerRef.newWTContainerRef(project));

activity.setName("name");

activity.setLineNumber(4);   //this is important to display the PlanActivity

activity = (PlanActivity)PlanHelper.service.addToPlan(activity, plan);

KD
12-Amethyst
12-Amethyst
(To:yliu-2)

Hi All,

Apart from the methods mentioned above there are many useful methods in " PlannableHelper.service "  also.

PlannableHelper.service.getPlannableByLineNumber

PlannableHelper.service.addPlannable

PlannableHelper.service.getImmediateChildren

etc.

Thanks And Regads,

Kaushik

Announcements


Top Tags