[solved]Command button Change - On input

sankarsankar Member Posts: 79
hi experts,

how to randomly change the command button..for ex in vendor card we can see one button with bitmap pencil if any comments is updated in the particular vendor then it is changed to written mode (pencil with some text).

my scenario is like below

in vendor card if vendor is having any open queries then the command button should be different (ex : open query yes) if not other command button (open query no) should be placed.is it possible to perform in navision ?

Thanks in advance...
Everything is Possible

Comments

  • MalajloMalajlo Member Posts: 294
    You want to open existing query (quote?), it is simple running query form linked to vendor. If there is no queries, blank will open.
    You can see exactly the same functionality on Vendor Card, Purchases, Qutes.

    If you want to change button caption, you have to hide/show two buttons, one over another. Comments bitmap uses this solution.

    I havent tried using format property... On Planning orders arrows are defined with it. It's worth to try.
  • MalajloMalajlo Member Posts: 294
    OK, here is a workaround...
    Use TextLabel instead of button. Use some function, that returns caption and OnActivate use a code to open a form.
    Design textlabel so it will look like a button (raised border, no background color)
  • sankarsankar Member Posts: 79
    Thanks for the reply Malajlo..

    Could you please explain it little bit detaily if possible step by step..

    Thanks Malajlo
    Everything is Possible
  • MalajloMalajlo Member Posts: 294
    Create function i.e. ButtonCaption on form with return val Text(30).
    Do query
    Queries.setrange(xx,yy) ;
    if Queries.find('-') then exit('Open queries')
    else Exit('Crete new query') ;
    

    Put TextLabel on Form, SourceExpression is ButtonCaption.

    Format TextLabel as Raised Shadow (use toolbar for colors). It will look like button.

    Put code in TextLabel_OnActivate
    Queries.setrange...
    FORM.RUN(formID,Queries) ;
    
  • ajaybabuChajaybabuCh Member Posts: 208
    Hi Expert Sankar

    For the Comments on each card , Navision has two controls

    One is picture box , over that command button with no label

    Bit Map list property of picture box you can mention multiple bitmaps.

    On the picture box Bit Map List is 7,6

    System takes the order as 0,1,2....( System interprets 0 is 7, 1 is 6,...)

    and source exp is Comment. Usually comment is flowfield of type boolean.

    So if there is no comment, Comment is false (False is 0)
    then the bit map 7 will take place as a Pencil

    If any comments exists , Comment is true(True is 1)
    so the bit map 6 will take place as a penci with text.
    Ajay
Sign In or Register to comment.