Tuesday, April 14, 2015

Dynamics NAV 2015 - How to create a Lookup, Dropdown, or option list

Situation:
Trying to create Lookup field on one Page that uses data from another Table to populate a field in the current table.

Solution:
This example - Creating a customer lookup on an invoice

  • Create Customer Table with CustomerID
  • Create Field for CustomerID on Invoice Header Table

  • On Invoice Header Page
    • Add CustomerID to Page
    • Set SourceExpr to point to the table you want to use as the lookup
    • Set TableRelation to the table/field you want to lookup on
      • In the table, set the DropDown list under View>Field Groups 
      • Name: DropDown, Group>three dots>Select fields you want in lookup
    • If you want advanced lookup options
      • Under Properties for the CustomerID field
        • Lookup = Yes
        • LookupPageID = Customer
More tips on customizing the dropdown here

To Create a Custom Drop Down list
  • On the Table, set the datatype to Option
  • Fill in the OptionString Field with your options lit separated by commas
  • If you want separate descriptions, Fill in the OptionCaption field on the Properties of the field on the page
    • example <Wedding,Baby Shower,Bridal Shower,Anniversary,Birthday,Grad,Home,Other>
To Create a Custom Drop Down list from a global Variable as an Input on the Request Page
  • Create Global Variable - Type Option
    • Enter all option values
  • On request page, insert global variable
  • On Report page, insert global variable so it can be seen by the report
  • Use SSRS or CAL Logic to reference the field
To create a dropdown field on a report request page 
  • Go to the table where the field is being taken from
  • Set the TableRelation to the table you want to get your dropdown values from
    • On the Table you're getting the dropdown values from, Design>View>Field Groups
    • Create a field group named "DropDown" and select the columns you want to display
    • Whenever this table is used as a related dropdown, it will use the DropDown field group settings

To create a completely custom lookup, use the Onlookup trigger on the table.
This logic will replace the default lookup.

Dynamics NAV LS Retail - Import Barcodes

Insert into CRONUS$Barcodes([Barcode No_]
      ,[Item No_]
      ,[Show for Item]
      ,[Description]
      ,[Blocked]
      ,[Last Date Modified]
      ,[Variant Code]
      ,[Unit of Measure Code]
      ,[Discount _])
Values
(Barcodeno,ItemNo,1,Description,0,getdate(),variantcode,uofmcode,0)

Dynamics GP 2013 R2 - "Smartlist builder needs to finish installing" every time you login

Original Solution here
Solution
The following steps can be used to resolve the issue.
1. Make a complete backup of the Dynamics and company SQL databases.
2. In the Microsoft Dynamics GP installation directory, rename the slbuild.dic and Application.SmartListBuilder.dll files.
3. In the Addin folder in the Microsoft Dynamics GP installation directory, rename the eOne.Dynamics.GP.DrillDownBuilder.Engine and eOne.Dynamics.GP.ExcelBuilder.Engine.dll files.
4. In the Control Panel, open the Programs and Features window. Find the Microsoft Dynamics GP 2013 installation and click Change. Remove the SmartList Builder Feature from the installation.
5. In the Control Panel, open the Programs and Features window if it isn't still open. Find the Microsoft Dynamics GP 2013 installation again and click Change. Add the SmartList Builder Feature to the installation.
6. In SQL Management Studio, run the following scripts to reset the status and version so the update will run again in Microsoft Dynamics GP Utilities.
update DYNAMICS..DB_Upgrade SET db_status=0 WHERE PRODID=3830
update DYNAMICS..DB_Upgrade SET db_verMajor=10, db_verBuild=84, db_verOldMajor=10, db_verOldBuild=84 WHERE PRODID=3830
update DYNAMICS..DU000020 SET versionMajor=10, versionBuild=84 WHERE PRODID=3830
7. Launch Microsoft Dynamics GP Utilities, log in as 'sa', and run through the Dynamics and company database update.
8. Verify the following scripts run without error in SQL Management Studio
select Extender_Type, Extender_ID from DYNAMICS..DDB10000
select Extender_Type, Extender_ID from DYNAMICS..ERB10100
select Extender_Type, Extender_ID from DYNAMICS..NLB10100
select Extender_Type, Extender_ID from DYNAMICS..SLB10100
select Extender_Type, Extender_ID from DYNAMICS..SLB10400
select Blank_Field_CB from DYNAMICS..ERB11100
select Blank_Field_CB from DYNAMICS..NLB11100
select Blank_Field_CB from DYNAMICS..SLB11100
9. Install the SmartList Builder download from the eOne Solutions site (eonesolutions.com)

Monday, April 13, 2015

NAV 2015 - How to connect to the Web Client

Once it has been installed from the NAV installer, you can access it by going to this location

http://ComputerName:Port/WebServerInstance/WebClient
example:
http://myserver:8080/NAV2015/WebClient
http://myserver:8080/DynamicsNav90/WebClient



  • To check what ports and names were actually installed, and whether or not your site is running, ope nthe IIS Manager
  • Expand your sites and confirm that the website is running
    • Expand the Site - the folder name is your WebserverInstance Name
  • If you have anything else running on the same port, it will disable any other sites configured for that port
  • Add the address to your trusted sites, also add this site
    • https://ajax.aspnetcdn.com

Friday, April 10, 2015

Dynamics NAV 2013 LS Retail - R5705 Transfer Receipt

When trying to modify the layout of this report, you get an error

Open the text file and find this line

<rd:ReportUnitType>Cm</rd:ReportUnitType>

There are two lines like this, delete the second one.
Save and import normally.

Tuesday, April 7, 2015

Dynamics NAV 2013 - Reporting Tricks


  • Display dynamics report values in the Page Header
    • Create a placeholder with a formula of =ReportItems!MatrixfieldName.Value where Matrixfieldname is the actual textbox name of a field on your report
    • The function will display whatever value you have in that field
  • Get the sum of group values, and not the sum of every single detail value
    • =Sum(Max(Fields!MyField.Value,"MyGroupName"))
  • Use CAL code to populate variables OnAfterGetRecord of your desired record
    • Try to use regular table joins to get to the most detailed level of your report first
      • Use CAL to grab additional information at each stage of the join
      • Use SSRS row hiding rules to hide the invalid detail lines for each header
    • Find the record and populate a variable
      • Itm.SETRANGE("No.","Item No.");
      • IF Itm.FIND('-') THEN
      • ItemDesc := Itm.Description;
      • You need to use a repeat until loop if you are getting more sub-records
    • Create a DataItem group named  Integer at the indentation level you need for your record details
      • Type in the variable name MatType as a DataSource and Name in the Report Dataset Designer
      • click on properties, set Maxiteration to 1
      • Use this column on your layout report
      • Create Subgroups if you are getting more sub-records
  • Set Default Report Filters
    • On Report, DataItem header
    • Populate the ReqFilterfields property
  • Get filter value and display on report
    • ILEFilter :=Item.GETFILTER("Location Filter"); 
  • Open Report with default set in Request page = current selected record on page
    • Example
      • GiftRec := Rec;
      • GiftRec.SETRANGE("No.",GiftRec."No.");
      • REPORT.RUNMODAL(50010,TRUE,TRUE,GiftRec);
  • To Get the fieldcaption of any field to display as a label that will change with language changes
    • Create a field in the report source using this formula
    • "Sales Line".FIELDCAPTION("Location Code")
  • To hide or skip records based on a request page parameter
    • Bank Account Ledger Entry - OnPreDataItem()
    • IF ShowUnmatched = FALSE THEN
    •   CurrReport.SKIP;

Dynamics NAV 2015 - An error occurred when opening the report designer. A supported version of Report Builder could not be found.

Problem: NAV 2015 installs Report Builder for SQL 2014 which cannot open the old report layouts from NAV 2013

Solution: