Conditional field still displays on report

AlexWileyAlexWiley Member Posts: 230
I have two fields on a report that I only want to display if there is information. One is a column in the body, and one is a field in the header. I coded them both the same way, but only the column disappears- the field in the header displays regardless. I don't understand what I'm missing...

In the Sales Invoice Header- OnAfterGetRecord I have:

POHeading := '';

and

IF ("Sales Invoice Header"."Your Reference" <> '') THEN
POHeading := AWWText2;

Even when the Your Reference field is blank, the AWWText2 still appears. If anyone has any input I would greatly appreciate it!

Answers

  • matttraxmatttrax Member Posts: 2,309
    Whenever I run into a problem caused by something being blank / not blank I add a message box to display the text AND the length of the test. You never know if someone entered a space or something.

    You can also export your object to text and make sure you're not setting the POHeading value anywhere else accidentally. Could have left some debug code in there.
  • AlexWileyAlexWiley Member Posts: 230
    That was it, another developer had referenced that same field. Doh! Thanks for the tip!
  • Slawek_GuzekSlawek_Guzek Member Posts: 1,690
    matttrax wrote:
    Whenever I run into a problem caused by something being blank / not blank I add a message box to display the text AND the length of the test. You never know if someone entered a space or something.
    Actually this is very good troubleshooting tip - you should publish it in Tips & Tricks...
    Slawek Guzek
    Dynamics NAV, MS SQL Server, Wherescape RED;
    PRINCE2 Practitioner - License GR657010572SG
    GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Sign In or Register to comment.