Error when displaying CustLedg."Due Date"

TheHitman123TheHitman123 Member Posts: 12
edited 2014-05-05 in NAV Three Tier
Hi All,

I am new with dev in NAV and need to know why it is not possible to do this:

MESSAGE(Custledge2."Due Date");

During compile I get the error:

"Type conversion is not possible because 1 of the operators contains an invalid type.

Text := Date"


Is there another way of display a message box with the date? I am wanting to display it to test the value during runtime.

Thanks in advance...

Comments

  • MBergerMBerger Member Posts: 413
    MESSAGE can only display text, so you either need to use the replacement functionality it has, or convert the date to text first :
    MESSAGE('%1',Custledge2."Due Date") ;
    
    - or -
    MESSAGE(FORMAT(Custledge2."Due Date")) ;
    
  • TheHitman123TheHitman123 Member Posts: 12
    Thanks for the feedback, it now compiles. It does not display any value though even though I am sure that the field contains a value.

    Any thoughts on this?
  • MBergerMBerger Member Posts: 413
    Thanks for the feedback, it now compiles. It does not display any value though even though I am sure that the field contains a value.

    Any thoughts on this?
    Not without seeing the rest of the code.....but seeing you are new at this, i suspect that you didn't GET or FIND your correct record yet......or that the date is actually empty.
  • TheHitman123TheHitman123 Member Posts: 12
    Your suspicion about me being new to this, being the problem was correct.

    I realized my mistake and am now getting the required result.

    Thanks for the help with the format statement.
Sign In or Register to comment.