Tuesday, August 29, 2017

SSRS - Display multi-value parameter as text string

=JOIN(Parameters!type.Value,",")

To limit it to a specific length


="Parameter: " +Format(Parameters!DocDate.Value,"dd-MMM-yyyy") +" And Cashier: " +IIF(Len(Join(Parameters!LastUserID.Value,","))>80, Mid(Join(Parameters!LastUserID.Value,","),1,80)+" and more." , Join(Parameters!LastUserID.Value,","))

LS One - Failed to insert. Could not connect to Site Service.

Confirm that the table schema in the company database matches the schema in the Audit database.
Modify the Audit database if necessary.

You may also get a "Could not connect to Site Service" error if there are any errors in the schema

Use this script to identify and update all fields to the correct schema.
Update the FScript and c.name where necessary




SELECT      c.name  AS 'ColumnName'
            ,t.name AS 'TableName','alter table test_audit.dbo.' + t.name + ' alter column ITEMID nvarchar(30) not null' as FScript
FROM        sys.columns c
JOIN        sys.tables  t   ON c.object_id = t.object_id
WHERE       c.name = 'ITEMID'
ORDER BY    TableName
            ,ColumnName;


                     SELECT      c.name  AS 'ColumnName'
            ,t.name AS 'TableName','alter table test.dbo.' + t.name + ' alter column ITEMID nvarchar(30) not null' as FScript
FROM        sys.columns c
JOIN        sys.tables  t   ON c.object_id = t.object_id
WHERE       c.name = 'ITEMID'
ORDER BY    TableName
            ,ColumnName;

Monday, August 28, 2017

Dynamics GP - AP Check stub/remittance prints with a large number of 0 transactions

Cause:
There are a number of credits or other transactions applied to this invoice in addition to this cheque

Resolution:

  • GP>Tools>Setup>Payables>List Documents on Remittance
  • Switch to "Invoices Only" instead of "All Documents" to hide non-invoice transactions


Thursday, August 24, 2017

Dynamics GP - Enable Backorders on all Items and Classes


  • Tools>SOP Setup>Back Order>Setup Backorder Doc Type
  • Tools>SOP Setup>Order>Assign Backorder type to Order
  • Cards>Item>Options>Enable Backorders
  • or Item Class - Enable Backorders and roll down
  • Or use these scripts

update iv00101 set alwbkord = 1
update iv40400 set alwbkord = 1


Dynamics GP - Current Cost is wrong. Compare Last Received Cost to Current Cost Values

/****** Object:  View [dbo].[BI_AUDIT_CurrentCost]    Script Date: 8/24/2017 10:39:14 AM ******/
//This will take the lowest cost of all receipts for an item on the last date received to get around the //issue of large rounded 1-item costs

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE VIEW [dbo].[BI_AUDIT_CurrentCost]
AS
SELECT        TOP (100) PERCENT dbo.IV10200.ITEMNMBR, dbo.IV00101.ITEMDESC, dbo.IV10200.RCTSEQNM AS LRSNM, dbo.IV10200.DATERECD, dbo.IV10200.QTYONHND, dbo.IV10200.UNITCOST,
                         dbo.IV10200.DEX_ROW_ID AS Lastentry, dbo.IV00101.CURRCOST, LRSNM.LsLowRcvCost, LRSNM.LsLowRcvCost - dbo.IV00101.CURRCOST AS CostDiff, Qty.AllQtyOnHnd
FROM            (SELECT        ITEMNMBR, QTYONHND AS AllQtyOnHnd
                          FROM            dbo.IV00102
                          WHERE        (LOCNCODE = '')) AS Qty RIGHT OUTER JOIN
                         dbo.IV00101 ON Qty.ITEMNMBR = dbo.IV00101.ITEMNMBR RIGHT OUTER JOIN
                         dbo.IV10200 INNER JOIN
                             (SELECT        IV10200_2.ITEMNMBR, MAX(IV10200_2.RCTSEQNM) AS LRSNM, MIN(IV10200_2.UNITCOST) AS LsLowRcvCost
                               FROM            dbo.IV10200 AS IV10200_2 INNER JOIN
                                                             (SELECT        ITEMNMBR, MAX(DATERECD) AS LDR
                                                               FROM            dbo.IV10200 AS IV10200_1
                                                               GROUP BY ITEMNMBR) AS LDR ON IV10200_2.ITEMNMBR = LDR.ITEMNMBR AND IV10200_2.DATERECD = LDR.LDR
                               GROUP BY IV10200_2.ITEMNMBR) AS LRSNM ON dbo.IV10200.ITEMNMBR = LRSNM.ITEMNMBR AND dbo.IV10200.RCTSEQNM = LRSNM.LRSNM ON
                         dbo.IV00101.ITEMNMBR = dbo.IV10200.ITEMNMBR
ORDER BY CostDiff
GO

Monday, August 21, 2017

Dynamics NAV - LS Retail - Pharmacy - "The operation could not complete because a record in the Prescription Order Table was locked by another user. Please retry the activity." when scanning a prescription

Codeunits involved upon prescription scan

  • T10015350 Prescription Order
    • Flowfields:Prescription Order Lines Sum: Amount, Insurance Payment, Discount amount,Customer Payment
  • C10015331 Prescription POS Connection
    • ScanPrescriptionOrder
      • GetPrescriptionOrder
      • C10015395 Pharmacy Web client
        • GetPrescriptionOrder
          • Possibly Writing to Prescription Order, and stalling while calculating flowfields, resulting in access error as code continues to populate Prescription Order
      • GetAndReservePrescriptionOrder