Hi Everyone,
I have a button on a form which used to work very well until I added some code to it from another button.
The code I have added is below between *** - Code … was added - ***
Now on the document when this button is pressed in the comments field (QCApprovalComments and QCApprovalCommentsDisplay) fails with the error in the subject. They are both text fields and nothing has changed.
The only difference with this code is that I put an @IF statement in because if comments from the dialog box is blank then I don’t want email to be generated, if there are comments I want email generated.
Does anyone have any ideas why I’m getting this error now?
Thanks,
Hayley
@Command([EditDocument];“1”);
Name:=@Name([CN];@UserName);
@Command([ViewRefreshFields]);
*** - Code below was added - ***
@DialogBox(“QCHiddenDialog”;[AutoHorzFit]:[AutoVertFit]:[NoNewFields];“Reviewers Comments”);
@Command([ViewRefreshFields]);
@If(QCApprovalComments=“”;@Return(“”); “”);
@MailSend(CreatedBy;“”;“”;“QC Approvers Comments for MARACQ Bid No. “+FileNumber+” for " +Client+ " " + Region;”";
+Remarks +@NewLine+@NewLine+
“Approval Comments” +@NewLine+@NewLine+QCApprovalComments+@NewLine+@NewLine+
“Link to Document (note - If you are working on another server” +@NewLine+"this document could take up to 60 minutes to replicate ) → ";[IncludeDoclink])|
@Prompt([Ok];“Sent Confirmation”;“Your comments have been emailed - Thank you”)|
@SetField(“Comments2”;“Yes”)|
newComments:=QCApprovalComments + " - " + Name|
FIELD QCApprovalCommentsDisplay:= @If( @Elements(QCApprovalCommentsDisplay)=0; newComments; QCApprovalCommentsDisplay : newComments )|
@SetField(“QCApprovalComments”;“”);
*** - Code above was added - ***
FIELD QCToggle:=QCToggle;
FIELD QCHSE_SignOff:=QCHSE_SignOff;
FIELD QC_signoffsrequired:=QC_signoffsrequired;
@SetField(“QCToggle”;“Yes”);
@SetField(“QCHSE_SignOff”;“Yes”);
@SetField(“QC_signoffsrequired”;“”);
space:= " ";
comma:=“,”;
month:=@Select(@Month(@Today);“January”;“February”;“March”;“April”;“May”;
“June”;“July”;“August”;“September”;“October”;“November”;“December”);
day:=@Text(@Day(@Today));
year:=@Text(@Year(@Today));
date:=day + space+ @Left(month;3) + space + comma + space + year;
FIELD ModifyDate:=date;
newSignOff:= Name + " on " +ModifyDate;
FIELD QC_signoffs:= @If( @Elements(QC_signoffs)=0; newSignOff; QC_signoffs : newSignOff );
@Command([ViewRefreshFields]);
@Command([FileSave]);
QC_Send_To := AllQC;
QC_Copy_To := “”;
Blind_Copy_To := “”;
QC_Email_Subject := “MARACQ Bid No. " + FileNumber + " for " + Client + " " + Region + " : Has Been QC Approved”;
Remark := “”;
host := @GetProfileField( “dbProfile”; “FQDN” );
bid_db := @WebDbName;
bid_view := “-”;
bid_unid := @Text( @DocumentUniqueID ) ;
URL_Link := “http://” + host + “/” + bid_db + “/” + bid_view + “/” + @Left( FileNumber; 13 ) + “?Edit”;
QC_Email_Body := @NewLine + @NewLine + “This bid has now been QC Reviewed.” + @NewLine + @NewLine + “Blackberry/Web users ONLY: Please follow the URL link to review and approve the contract prices.” + @NewLine + @NewLine + URL_Link + @NewLine + @NewLine + "Notes Client ONLY: Please follow the doclink to review and approve the contract prices. " + @NewLine + @NewLine;
@Command([ViewRefreshFields]);
@If(
ALLQCToggle=“Yes”;
@SetField(“QCStatus”;“Bid Approved”)|@MailSend( QC_Send_To ; QC_Copy_To ; Blind_Copy_To; QC_Email_Subject ; Remarks ; QC_Email_Body ;[IncludeDoclink])
|@PostedCommand([FileSave]) & @PostedCommand([FileCloseWindow]);@PostedCommand([FileSave]) & @PostedCommand([FileCloseWindow]))