Hello,
I've an entity TaskList with for example 4 liked persons
I've an entity Firmen with 1:n to personen
I've an entity Kontakte (a list of all mails, eMails, calls, meetings, visits etc.) with n:1 to TaskList, n:1 to Firmen, n:1 to Personen
I've created a workflow with manual trigger (Button) for target entity TaskList
In this workflow I create an action with following formula:
------------schnipp-------------
/* für every person in TagetList */
$source = personensIds;
$target = list();
$fi = '';
$ka = 'in Verteiler';
$ma = 'xyz GmbH';
$be = string\concatenate('Verteiler: ', name);
$an = 'Verteiler Aussendung';
$mid = mitarbeiterId;
$uid = assignedUserId;
$vid = id;
$i = 0;
while(
$i < array\length($source),
(
$target = array\at($source, $i);
$fi = record\attribute('Personen', $target, 'firmenId');
record\create('Kontakte', 'firmenId', '$fi', 'personenId', '$target', 'kontaktdatum', datetime\today(), 'kontaktart', '$ka', 'mandant', '$ma', 'betreff', '$be', 'anlass', '$an', 'mitarbeiterId', '$mid', 'assignedUserId', '$uid', 'taskListId', '$vid');
);
$i = $i + 1;
);
---------------schnapp--------------
BUT - there is created only ONE, EMPTY record.
What's my fault?
Christoph
I've an entity TaskList with for example 4 liked persons
I've an entity Firmen with 1:n to personen
I've an entity Kontakte (a list of all mails, eMails, calls, meetings, visits etc.) with n:1 to TaskList, n:1 to Firmen, n:1 to Personen
I've created a workflow with manual trigger (Button) for target entity TaskList
In this workflow I create an action with following formula:
------------schnipp-------------
/* für every person in TagetList */
$source = personensIds;
$target = list();
$fi = '';
$ka = 'in Verteiler';
$ma = 'xyz GmbH';
$be = string\concatenate('Verteiler: ', name);
$an = 'Verteiler Aussendung';
$mid = mitarbeiterId;
$uid = assignedUserId;
$vid = id;
$i = 0;
while(
$i < array\length($source),
(
$target = array\at($source, $i);
$fi = record\attribute('Personen', $target, 'firmenId');
record\create('Kontakte', 'firmenId', '$fi', 'personenId', '$target', 'kontaktdatum', datetime\today(), 'kontaktart', '$ka', 'mandant', '$ma', 'betreff', '$be', 'anlass', '$an', 'mitarbeiterId', '$mid', 'assignedUserId', '$uid', 'taskListId', '$vid');
);
$i = $i + 1;
);
---------------schnapp--------------
BUT - there is created only ONE, EMPTY record.
What's my fault?
Christoph
Comment