Solved

Navigation in GI is not working

  • 14 August 2022
  • 4 replies
  • 284 views

Userlevel 7
Badge +9

Hello Everyone.

I have created a GI that dpending on selected “Module” should navigate to the source document in my side panels. For example “AP” should navigate to “Bills & Adjustments”. Here is partial data from my result grid

 

I know my keys are DocType and RefNbr. So here is how I have set up my Navigation Parameters and Visibility Conditions

 

 

I have two problems.

  1. When I click on the hyperlink or record it doesn’t show the related document in the side panel.
  1. In my GI the navigation Icon is always invisible with this condition. If I deactivate the condition then it becomes visible

What I am doing wrong?

icon

Best answer by Naveen Boga 15 August 2022, 07:28

View original

4 replies

Userlevel 7
Badge +18

Hi @aaghaei  There are a couple of suggestions from my end. Please find the details below.

 

  1. In your DAC, there are KEY fields (which may lead to duplicate records)
  2. It seems the second Contact table join is incorrect.
  3. I don’t think SQL View is required for this GI

I have re-created a GI, and Side-Panel is working fine. Please find the attached GI and screenshots for reference.

 

 

Userlevel 7
Badge +9

@Naveen Boga I truly appreciate the time you spent to make this work. I guess I had a brain fart :) as I had forgotten to set my DAC key fields. thank you for poiting the”KEY fields”.

  1. I needed this sparkle. here is my revised DAC with key added and works now.
        #region Keys
public class PK : PrimaryKeyOf<UDCVEPApprovalPending>.By<module, docType, refNbr>
{
public static UDCVEPApprovalPending Find(PXGraph graph, string module, string docType, string refNbr) => FindBy(graph, module, docType, refNbr);
}
#endregion


#region Module
[PXDBString(2, IsKey = true, IsFixed = true, InputMask = "")]
[PXUIField(DisplayName = "Module")]
public virtual string Module { get; set; }
public abstract class module : PX.Data.BQL.BqlString.Field<module> { }
#endregion

#region DocType
[PXDBString(10, IsKey = true, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Doc Type")]
public virtual string DocType { get; set; }
public abstract class docType : PX.Data.BQL.BqlString.Field<docType> { }
#endregion

#region RefNbr
[PXDBString(20, IsKey = true, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Ref Nbr")]
public virtual string RefNbr { get; set; }
public abstract class refNbr : PX.Data.BQL.BqlString.Field<refNbr> { }
#endregion
  1. Not sure what you see wrong in the joins. The way this query works if any document is pending approval, then I need the owner from EPApproval table (2nd contact join) and if document is on hold and no owner assigned in EPApproval, then I want the owner from document itself (1st contat join). It joined as it meant unless I am missing something. I will appreciate if you could expedite what do you see wrong.
  2. I just had provided the first part of the UNION SELECT of my lenghty SQL view. currently in addition to “AP Bills” there are “Purchase Orders”, “Change Orders”, “Projects Budget”, and “Subcontracts” UNION select in this view and I have to add a few more. I wish we could have UNION GI in Acumatica. Can we?

Again I really really appreciate the time you spent and your advices that has been helpful as always.

Cheers!

 

 

Userlevel 7
Badge +18

Hi @aaghaei  Can you please share the XML format of this GI and also let us know the version and build?

Userlevel 7
Badge +9

Hi @Naveen Boga Thank you for taking time to help with this. I am using 21R2 21.205.0063.

please find the attached XML.Also you will need to create the below view (Actualy just part of the UNION view I use to collect all modules in one view) and DAC

SQL View:

CREATE VIEW [dbo].[UDCVEPApprovalPending] AS 

/******************** AP Bills & Adjustments ********************/
SELECT
[APRG].[CompanyID] AS [CompanyID],
[APRG].[BranchID] AS [BranchID],
'AP' AS [Module],
CASE ISNULL([APRG].[DocType], '')
WHEN 'INV' THEN 'Bill'
WHEN 'ACR' THEN 'Credit Adj.'
WHEN 'ADR' THEN 'Debit Adj.'
WHEN 'PPM' THEN 'Prepayment'
ELSE ''
END AS [DocType],
[APIN].[RefNbr] AS [RefNbr],
[APIN].[InvoiceNbr] AS [DocNbr],
[APRG].[DocDate] AS [DocDate],
ISNULL([APRG].[DocDesc], '') AS [DocDesc],

CONVERT(VARCHAR(6), [APRG].[TranPeriodID]) AS [TranPeriodID],
CONVERT(VARCHAR(6), [APRG].[FinPeriodID]) AS [FinPeriodID],

CASE ISNULL([APRG].[Status], '')
WHEN 'H' THEN 'Data Entry'
ELSE 'Pending Approval'
END AS [Status],

[GLCO].[OrganizationCD] AS [OrganizationID],
[GLCO].[OrganizationName] AS [OrganizationName],

[APVM].[AcctCD] AS [VendorID],
[APVM].[AcctName] AS [VendorName],

CASE ISNULL([PMPM].[ContractID], 0)
WHEN 0 THEN ''
ELSE [PMPM].[ContractCD]
END AS [ProjectID],
CASE ISNULL([PMPM].[ContractID], 0)
WHEN 0 THEN ''
ELSE [PMPM].[Description]
END AS [ProjectName],

ISNULL([EPOW].[ContactID], [APOW].[ContactID]) AS [UserID],
ISNULL([EPOW].[DisplayName], [APOW].[DisplayName]) AS [UserName],
ISNULL([EPAP].[CreatedDateTime], [APRG].[CreatedDateTime]) AS [DateAssigned],

+ISNULL([APIN].[UsrCFCuryLineTotalCost], 0) AS [Cost],
+ISNULL([APIN].[UsrCFCuryLineTotalTax], 0) AS [Tax],
+ISNULL([APIN].[UsrCFCuryLineTotalCost], 0)
+ISNULL([APIN].[UsrCFCuryLineTotalTax], 0) AS [Amount]

FROM
[dbo].[APInvoice] [APIN] INNER JOIN
[dbo].[APRegister] [APRG] ON [APIN].[CompanyID] = [APRG].[CompanyID] AND [APIN].[DocType] = [APRG].[DocType] AND [APIN].[RefNbr] = [APRG].[RefNbr] INNER JOIN
[dbo].[Branch] [GLBR] ON [APRG].[CompanyID] = [GLBR].[CompanyID] AND [APRG].[BranchID] = [GLBR].[BranchID] INNER JOIN
[dbo].[Organization] [GLCO] ON [APRG].[CompanyID] = [GLCO].[CompanyID] AND [GLBR].[OrganizationID] = [GLCO].[OrganizationID] INNER JOIN
[dbo].[BAccount] [APVM] ON [APRG].[CompanyID] = [APVM].[CompanyID] AND [APRG].[VendorID] = [APVM].[BAccountID] LEFT JOIN
[dbo].[Contract] [PMPM] ON [APRG].[CompanyID] = [PMPM].[CompanyID] AND [APRG].[ProjectID] = [PMPM].[ContractID] LEFT JOIN
[dbo].[EPApproval] [EPAP] ON [APRG].[CompanyID] = [EPAP].[CompanyID] AND [APRG].[NoteID] = [EPAP].[RefNoteID] LEFT JOIN
[dbo].[Contact] [APOW] ON [APRG].[CompanyID] = [APOW].[CompanyID] AND [APRG].[EmployeeID] = [APOW].[ContactID] LEFT JOIN
[dbo].[Contact] [EPOW] ON [EPAP].[CompanyID] = [EPOW].[CompanyID] AND [EPAP].[OwnerID] = [EPOW].[ContactID]
WHERE
ISNULL([APRG].[Status], '') IN ('H', 'E') AND -- 'On Hold', 'Pending Approval'
ISNULL([APRG].[DeletedDatabaseRecord], '0') = '0' AND
ISNULL([EPAP].[Status], 'P') = 'P'
GO

--Vmsql
GO

 

DAC

using System;
using PX.Data;
using PX.Objects.CM;
using PX.Objects.GL;

namespace UDApprovalWorkflow
{
[Serializable]
[PXCacheName("Approval Hold and Pending")]
public class UDCVEPApprovalPending : IBqlTable
{
#region BranchID
[Branch(DisplayName = "Branch", Visibility = PXUIVisibility.SelectorVisible, Required = true, Enabled = false, Visible = true)]
public virtual Int32? BranchID { get; set; }
public abstract class branchID : PX.Data.BQL.BqlInt.Field<branchID> { }
#endregion

#region Module
[PXDBString(2, IsFixed = true, InputMask = "")]
[PXUIField(DisplayName = "Module")]
public virtual string Module { get; set; }
public abstract class module : PX.Data.BQL.BqlString.Field<module> { }
#endregion

#region DocType
[PXDBString(20, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Doc Type")]
public virtual string DocType { get; set; }
public abstract class docType : PX.Data.BQL.BqlString.Field<docType> { }
#endregion

#region RefNbr
[PXDBString(15, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Ref Nbr")]
public virtual string RefNbr { get; set; }
public abstract class refNbr : PX.Data.BQL.BqlString.Field<refNbr> { }
#endregion

#region DocNbr
[PXDBString(40, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Doc Nbr")]
public virtual string DocNbr { get; set; }
public abstract class docNbr : PX.Data.BQL.BqlString.Field<docNbr> { }
#endregion

#region DocDate
[PXDBDate()]
[PXUIField(DisplayName = "Doc Date")]
public virtual DateTime? DocDate { get; set; }
public abstract class docDate : PX.Data.BQL.BqlDateTime.Field<docDate> { }
#endregion

#region DocDesc
[PXDBString(512, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Doc Desc")]
public virtual string DocDesc { get; set; }
public abstract class docDesc : PX.Data.BQL.BqlString.Field<docDesc> { }
#endregion

#region TranPeriodID
[PeriodID()]
[PXUIField(DisplayName = "Tran Period")]
public virtual string TranPeriodID { get; set; }
public abstract class tranPeriodID : PX.Data.BQL.BqlString.Field<tranPeriodID> { }
#endregion

#region FinPeriodID
[OpenPeriod(
searchType: null,
sourceType: typeof(docDate),
branchSourceType: typeof(branchID),
masterFinPeriodIDType: typeof(tranPeriodID),
redefaultOrRevalidateOnOrganizationSourceUpdated: true
)]
[PXUIField(DisplayName = "Fin Period")]
public virtual string FinPeriodID { get; set; }
public abstract class finPeriodID : PX.Data.BQL.BqlString.Field<finPeriodID> { }
#endregion

#region Status
[PXDBString(16, InputMask = "")]
[PXUIField(DisplayName = "Status")]
public virtual string Status { get; set; }
public abstract class status : PX.Data.BQL.BqlString.Field<status> { }
#endregion

#region OrganizationID
[PXDBString(30, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Organization ID")]
public virtual string OrganizationID { get; set; }
public abstract class organizationID : PX.Data.BQL.BqlString.Field<organizationID> { }
#endregion

#region OrganizationName
[PXDBString(60, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Organization Name")]
public virtual string OrganizationName { get; set; }
public abstract class organizationName : PX.Data.BQL.BqlString.Field<organizationName> { }
#endregion

#region VendorID
[PXDBString(30, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Vendor ID")]
public virtual string VendorID { get; set; }
public abstract class vendorID : PX.Data.BQL.BqlString.Field<vendorID> { }
#endregion

#region VendorName
[PXDBString(255, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Vendor Name")]
public virtual string VendorName { get; set; }
public abstract class vendorName : PX.Data.BQL.BqlString.Field<vendorName> { }
#endregion

#region ProjectID
[PXDBString(30, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Project ID")]
public virtual string ProjectID { get; set; }
public abstract class projectID : PX.Data.BQL.BqlString.Field<projectID> { }
#endregion

#region ProjectName
[PXDBString(255, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "Project Name")]
public virtual string ProjectName { get; set; }
public abstract class projectName : PX.Data.BQL.BqlString.Field<projectName> { }
#endregion

#region UserID
[PXDBInt()]
[PXUIField(DisplayName = "User ID")]
public virtual int? UserID { get; set; }
public abstract class userID : PX.Data.BQL.BqlInt.Field<userID> { }
#endregion

#region UserName
[PXDBString(255, IsUnicode = true, InputMask = "")]
[PXUIField(DisplayName = "User Name")]
public virtual string UserName { get; set; }
public abstract class userName : PX.Data.BQL.BqlString.Field<userName> { }
#endregion

#region DateAssigned
[PXDBDate()]
[PXUIField(DisplayName = "Date Assigned")]
public virtual DateTime? DateAssigned { get; set; }
public abstract class dateAssigned : PX.Data.BQL.BqlDateTime.Field<dateAssigned> { }
#endregion

#region Cost
[PXDBBaseCury()]
[PXUIField(DisplayName = "Cost")]
public virtual Decimal? Cost { get; set; }
public abstract class cost : PX.Data.BQL.BqlDecimal.Field<cost> { }
#endregion

#region Tax
[PXDBBaseCury()]
[PXUIField(DisplayName = "Tax")]
public virtual Decimal? Tax { get; set; }
public abstract class tax : PX.Data.BQL.BqlDecimal.Field<tax> { }
#endregion

#region Amount
[PXDBBaseCury()]
[PXUIField(DisplayName = "Amount")]
public virtual Decimal? Amount { get; set; }
public abstract class amount : PX.Data.BQL.BqlDecimal.Field<amount> { }
#endregion
}
}

 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved