Options

2013R2 Upgrade Sales Invoice Issue

cacilleycacilley Member Posts: 31
edited 2015-01-12 in NAV Three Tier
I have recently upgraded a db to 2013R2 from 2009R2. I have ran into an issue with some custom code from 2009R2 and I am trying to determine the easiest way to recreate the code in 2013R2 because the way it is coded in 2009R2 does not seem possible in 2013R2 unless I am looking in the wrong place.

The issue:
In the 2009R2 db when a sales invoice is generated anything dealing with the companies shipping charges which are set up as resources are not to be displayed on the line items, only totaled within the shipping and handling field. This is achieved using this code:
IF COPYSTR(TempSalesInvoiceLine."No.",1,2) = 'ZZ' THEN
{
IF COPYSTR(TempSalesInvoiceLine."No.",1,1) = 'Z' THEN
}

   CurrReport.SHOWOUTPUT := FALSE
ELSE BEGIN
 IF STRLEN(TempSalesInvoiceLine."No.") = 0 THEN BEGIN
  IF STRLEN(TempSalesInvoiceLine.Description) = 0 THEN BEGIN
   CurrReport.SHOWOUTPUT := FALSE;
  END ELSE
   CurrReport.SHOWOUTPUT := TRUE;
 END ELSE
  CurrReport.SHOWOUTPUT := TRUE;
END;
This code was placed within the SalesInvoiceLine, Body(3)-OnPreSection() of a custom copy of the Sale Invoice Form. I do not see anywhere within 2013R2 to add this custom code at-least not where it will make since. I am probably over looking something glaring, but just can't see it. Any help is appreciated.

Comments

  • Options
    thegunzothegunzo Member Posts: 274
    Hi

    It is a good practice to use CurrReport.SKIP instead of the SHOWOUTPUT. SHOWOUTPUT will not work in the new 2013 R2 layout. If you need similar functionality then you need to turn to the Visibility property in the layout and add the data needed to toggle the visibility to the data set.
    ________________________________
    Gunnar Gestsson
    Microsoft Certified IT Professional
    Dynamics NAV MVP
    http://www.dynamics.is
    http://Objects4NAV.com
  • Options
    cacilleycacilley Member Posts: 31
    Thank you thegunzo. I haven't looked too much into the visibility settings. I tried to click on the row within the report and right click, then row visibility, then selected the option show or hide based on expression, then added this expression =Fields!TempSalesInvoiceLineNo.Value ="ZZ" . Doing the steps listed it actually wipes out all the rows within the report not just the shipping rows. I am not sure if I need a more complex expression or if the visibility settings support individual rows within a data set?
Sign In or Register to comment.