Comment button

abab Member Posts: 37
Hi,

Where can I find the code that changes the comment button when there are comment lines, for example on the sales header,
into a comment button with lines ?

Thx

Comments

  • kapamaroukapamarou Member Posts: 1,152
    If you are talking about the pencil icon for the comments then it goes as follows:

    The Icon is a picture box with sourceexpression Comment which is a flow field of table 36 leading to values True And False.Then at property BitmapList 7,6 , 7 being the FALSE and 6 being the TRUE...
  • abab Member Posts: 37
    That's perfect !!!! :D

    Thx
  • kapamaroukapamarou Member Posts: 1,152
    You're welcome.

    You can also do the same thing for option fields... :D
  • headley27headley27 Member Posts: 188
    Hello ab,

    I'm not sure if you are experiencing the same issue as we did or if you are looking to use this functionality somewhere else but....

    We found it very hard to tell if a comment existed on a sales quote or order, simply because there was little difference in the true/false state of the bitmap.
    Users were missing key comments all the time, simply because they didn't notice that a comment existed.

    We renamed the original picture box 'CommentDoesNotExist' and added a 2nd picture box called 'CommentExists'.
    We layered the 'CommentExists' picture box right underneath the 'CommentDoesNotExist' picture box (identical Bitmap, SourceExpr, XPos, YPos, Width, Height, etc.).
    We then set the BackColor of the 'CommentExists' picture box to 6094847 (Bright Yellow).

    Lastly, we added the following code to toggle the visible state of the two picture boxes.

    Global Variable:
    Name SalesComment
    DataType Record
    Subtype Sales Comment Line
    Form - OnAfterGetRecord()
    SalesComment.RESET;
    SalesComment.SETRANGE("Document Type", "Document Type");
    SalesComment.SETRANGE("No.", "No.");
    
    IF SalesComment.FIND('-') THEN BEGIN
      CurrForm.CommentExists.VISIBLE := TRUE;
      CurrForm.CommentDoesNotExist.VISIBLE := FALSE;
    END ELSE BEGIN
      CurrForm.CommentExists.VISIBLE := FALSE;
      CurrForm.CommentDoesNotExist.VISIBLE := TRUE;
    END;
    
    The default pencil (with no lines) bitmap is shown when there is no comment, but now the pencil (with lines) bitmap is surrounded by a bright yellow background which is very noticeable when a comment exists. We've enabled similar functionality in many other forms.

    I hope this helps.
  • SavatageSavatage Member Posts: 7,142
    another quick way to change the bitmap so it's more visible is create your own pic
    Property...
    BitmapList=7,c:\notes.bmp

    Where C:\Notes.bmp is something New and more visible
    Once compiled, it's set in Nav!
  • headley27headley27 Member Posts: 188
    Savatage wrote:
    another quick way to change the bitmap so it's more visible is create your own pic
    Property...
    BitmapList=7,c:\notes.bmp

    Where C:\Notes.bmp is something New and more visible
    Once compiled, it's set in Nav!

    Very nice!! That's an excellent tip. :D
Sign In or Register to comment.