0
Script problem.
do as server
let me := this;
for i in select 'Task templates' do
let new := (create Tasks);
new.(
void;
Status := 1;
'N1 Main Table' := me;
'Assigned Date' := date(year(me.'Start date'), month(me.'Start date'), day(me.'Start date') + i.'Days until (from) start date');
'Task Name' := i.'Task Templates';
Phase := i.Phase;
Supervisor := i.Employee
)
end
end
Copy
This script takes the data from the 'Task Template' Table and copies all the records to the 'Main Table', in '1N All Task'.
Is there some way to only copy the last or last one included, not all records.
7 replies
-
said:
Is there some way to only copy the last or last one included, not all records.You only want to copy the last record in the Task Template table? Have you tried the last() command?
-
Yes Fred but don't know where place the last() command
-
If you only want the last record then you don't need a for loop. You can try this modification:
do as server let me := this; let i := last(select 'Task templates'); let new := (create Tasks); new.( Status := 1; 'N1 Main Table' := me; 'Assigned Date' := date(year(me.'Start date'), month(me.'Start date'), day(me.'Start date') + i.'Days until (from) start date'); 'Task Name' := i.'Task Templates'; Phase := i.Phase; Supervisor := i.Employee ) end
Content aside
- Status Answered
- 1 yr agoLast active
- 7Replies
- 71Views
-
2
Following