Skip to Content

Creating project from template using absl

Hello,

I have a requirement to create a project from template in ABSL.

i created the template successfully with ID "1" and i can create projects from tenant using this template.

the issue appears when i try to create it using ABSL it doesnt work i tried 2 things

first code : ( result in error template 1 doesnt exist )

var ProjID : Project.ProjectID;
	var templateID: ProjectTemplate.TemplateID;
	var projTypeCode: Project.TypeCode;


	ProjID.content = "TESTTEMPLATEPROJ";
	templateID.content = "1";
	projTypeCode.content = "Z3";
	
	Project.CreateProjectFromTemplate(true,true,true,ProjID,templateID,projTypeCode);

second code : ( result in no errors but no project is created )

var ProjID : Project.ProjectID;
	var templateID: ProjectTemplate.TemplateID;
	var projTypeCode: Project.TypeCode;


	ProjID.content = "TESTTEMPLATEPROJ";
	templateID.content = "000000000000000000000001";
	projTypeCode.content = "Z3";
	
	Project.CreateProjectFromTemplate(true,true,true,ProjID,templateID,projTypeCode);

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Apr 12 at 10:50 AM

    Now it show 2 errors, Cost center missing and responsible employee missing.

    These are not parameters in the action how should i pass them ?

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Apr 13 at 08:49 AM

    Hello Haitham,

    These obligatory data cannot be sent as action prameters. I do not work with ABSL and cannot tell you exactly how you should code this but you should trigger Modify (Update) for the created project (may be it is necessary to retrieve it at first). The first required field is Project~ROOT-

    RESPBL_COST_CTR_ID ( I think it should be Project.ResponsibleCostCentreID) . In order to fill the second field you should use the association Project~ROOT-->PROJECT_SUMMARY_TASK (ProjectSummaryTask) and fill the field RESPBL_EMP_ID-CONTENT (

    ResponsibleEmployeeID).

    Kind regards, Elena

    Add comment
    10|10000 characters needed characters exceeded