Warning triangle on item card

stoocakestoocake Member Posts: 32
We have a warning triangle on our item card that appears if there is a comment linked to an item. To enter a comment we click the button to the right of the Item No. If the comment list is blank there is no picture visible, if you type a comment, the picture appears.
Does anyone know how the code makes the picture visible if there is a comment in another table
Table 97: Comment Line
Table 27: ITem
Form 125: Comment List
Form 30: Item Card

Comments

  • Luc_VanDyckLuc_VanDyck Member, Moderator, Administrator Posts: 3,633
    The pencil-icon is a PictureBox which is placed beneath the little CommandButton. The property SourceExpr is set to the flowfield "Comment", property Bitmaplist is "7,6" which are the internal graphics used to display the pencil/sheet icon. Depending on the value of the field Comment, either bitmap 7 or bitmap 6 is displayed.
    No support using PM or e-mail - Please use this forum. BC TechDays 2024: 13 & 14 June 2024, Antwerp (Belgium)
  • stoocakestoocake Member Posts: 32
    How does the software check the contents of the comment table to know that the picture should be displayed? I am asking because I am trying to put something similar in that checks to see if there are any documents attached and displays a picture if there are.
    Any more detailed help will be appreciated.
  • kinekine Member Posts: 12,562
    The check is based on flowfield Comment in the Item table...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • stoocakestoocake Member Posts: 32
    ...but where does the code change the value of the flowfield? I have no idea how it works?
  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Flowfields are not changed by code. They respond to changes in the database automaticaly.

    If you look in the table definition, you can see the formula of the flowfield.

    Just put the comment field as a normal control on the form and see. :D
  • stoocakestoocake Member Posts: 32
    Ok, I think I've found it - the calcformula property - there is a line that says:
    Exist(Comment Line Where(Table Name=CONST(Item),No.=Field(No.)))

    Sorry for sounding dumb, but I'm new to programming and Navision and it's not easy to pick up just by looking at it.

    Thanks for your help guys.
  • kinekine Member Posts: 12,562
    That is why we are here... :-)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • SavatageSavatage Member Posts: 7,142
    This was also helpful with Ship-To's on the customer card.

    Unless you click on show ship-to's you don;t know if a customer has any.

    Exist("Ship-to Address" WHERE (Customer No.=FIELD(No.)))

    solves that problem
Sign In or Register to comment.