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

Create new instance of EmployeeTime Item in .absl

Former Member
412

Hi Support Team,

i need to create a new instance (copy of an existing Instance) of EmployeeTime with one Item in my .absl code. I used the following code in my Root.node "Event-AfterModify,.absl":

import ABSL;

import AP.TimeAndLabourManagement.Global;

import AP.Common.GDT;

var elEmployeeTime_Root:elementsof EmployeeTime;

var instEmployeeTime_Root;

var currentItem = this.CurrentItem.GetFirst();

if(currentItem.IsSet()){

elEmployeeTime_Root.EmployeeTimeAgreementItemUUID.content = this.EmployeeTimeAgreementItemUUID.content; elEmployeeTime_Root.PlanningCategoryCode = this.PlanningCategoryCode;

instEmployeeTime_Root = EmployeeTime.Create(elEmployeeTime_Root);

}

But the Line "instEmployeeTime_Root = EmployeeTime.Create(elEmployeeTime_Root);" thows a backend Error, but i don't understand why.

Please can you help me to implement this Requirement.

Thank you

Best Regards

Linda

Consultant

Bradler GmbH

Accepted Solutions (0)

Answers (1)

Answers (1)

Gayatri_Bagde
Active Participant

Hi Linda,

Try creating new UUID for elEmployeeTime_Root.EmployeeTimeAgreementItemUUID.content instead of copying the existing one using UUID.Generate() method - as UUID needs to be unique for every entry. This might be causing an issue. Also,If you are getting any specific error, can you please specify it?

Thanks,

Gayatri

Former Member
0 Kudos

Hi Gayatri Bagde,

Thank you for your answer and sorry for the delay.

You are right with the UUID. I tried it with UUID.Generate(), but still getting the same bug at the line "instEmployeeTime_Root = EmployeeTime.Create(elEmployeeTime_Root);". see backend-error.png

I'am still trying to create a new Instance but don't know how to implement it.

Best Regards

Linda