on 2020 Apr 28 7:56 AM
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
Request clarification before answering.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
| User | Count |
|---|---|
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.