I have the code below in the input validation of a field. But, it is prompting the user for the message but is still allowing them to send over the max size. Can someone please look at this code and offer some assistance. Thanks in advance.
MinSize :=1000000;
MaxSize := 10000000;
DocLen :=@DocLength;
DocSize := @Text(@Integer(@DocLength / 100000) / 10; “F,1”);
WarnMax := “This message cannot be sent or saved as it has attachments totaling " + DocSize + " Megabytes (MB) in size. Messages with attachments totaling 100 MB or larger will not be delivered due to the adverse affect on the network and recipients’ mail systems. Please compress all attachments before attempting to send the message again.”;
WarnMin :=“This message has attachments totaling " + DocSize + " Megabytes (MB) in size. Messages with attachments totaling 1 MB or larger can severely impact network performance and will not be delivered until after 6:00 PM EST. Click Yes to continue sending the message as is, or click No to cancel sending and make changes such as compressing the attachments.”;
temp1 := @If(@IsDocBeingMailed & (DocLen > MinSize & DocLen < MaxSize); @Prompt([YesNo]; “This message will be delivered during non-business hours!”; WarnMin);“”);
temp2 := @If(@IsDocBeingMailed & (DocLen > MaxSize);@Prompt([Ok];“Oversized Attachment”;“This message exceeds the allowed attachment size and will not be delivered!”; WarnMax);“”);
@If(@DocLength > MaxSize; @Failure(WarnMax);
@IsDocBeingMailed & (DocLen > MinSize & DocLen < MaxSize) & temp1 != 1;
@Failure(“Message not sent!”);@Success);
@IsDocBeingMailed & (DocLen > MaxSize) & temp2 = 1;
@Failure(“Message not sent!”);@Success