I read through several posts on this topic but none could help me.I have a button on a document, executing below code:
FIELD AuditText := AuditText;
FIELD Audittrail := Audittrail;
Emailbody:=“blablabla”;
TodayStr :=@Text(@Day(@Today)) + “-” + @Text(@Month(@Today)) + “-” + @Text(@Year(@Today));
AuditText := Audittrail + @NewLine + "Indirect Material Order sent to Storeroom Services on " + TodayStr + “.”;
@If(showinst=“1”;
@Do(
@Command( [EditDocument] );
@SetField(“showinst”;“0”);
@SetField(“Audittrail”;AuditText);
@Command([ViewRefreshFields]);
@MailSend(supv;“”;“”;“Indirect Material Order - Sequence nbr: " + SeqNbr;Emailbody;”";[IncludeDoclink]);
@Command([FileSave]);
@Command([FileCloseWindow])
);“”)
The problem is with the instruction @SetField(“Audittrail”;AuditText);
The field Audittrail is a computed text field with the value
@If(@IsNewDoc;"Composed by "+@Name([CN];@UserName)+ " on " + @Text(@Now);Audittrail)
I don’t succeed in adding the second line to the field Audittrail.
Is there something wrong with the @SetField instruction?
The instruction @SetField(“showinst”;“0”); however, is working fine.
Any clue?