Skip to main content
Solved

Import Button in 'Documents to Apply' in Payments and Applications

  • October 25, 2024
  • 3 replies
  • 81 views

Hi,

I am trying to give our users the ability to import records in the ‘documents to apply’ grid on the payments and applications screen (AR302000).

I’ve followed Sergey’s instructions here and referenced this previous post. The upload button is now visible, however I receive the following error when attempting to import a file: “The view $ImportXLSXSettings doesn't exist.” or “Error: The view $ImportCSVSettings doesn't exist.” depending on the file type.

I am not able to find any information on this error and unsure where to go from here. My current AR payment entry extension is below.

Any help is greatly appreciated!

using PX.Data;
using PX.Objects.AR;

namespace PX.KWW.KevinScreen.Graph
{
    public class ARPaymentEntryExtension : PXGraphExtension<ARPaymentEntry>
    {
        [PXOverride]
        [PXViewName(Objects.AR.Messages.DocumentsToApply)]
        [PXCopyPasteHiddenView]
        [PXImport(typeof(ARAdjust))]
        public PXSelectJoin<
            ARAdjust,
            LeftJoin<ARInvoice,
                On<ARInvoice.docType, Equal<ARAdjust.adjdDocType>,
                And<ARInvoice.refNbr, Equal<ARAdjust.adjdRefNbr>>>,
            InnerJoin<Objects.AR.Standalone.ARRegisterAlias,
                On<Objects.AR.Standalone.ARRegisterAlias.docType, Equal<ARAdjust.adjdDocType>,
                And<Objects.AR.Standalone.ARRegisterAlias.refNbr, Equal<ARAdjust.adjdRefNbr>>>,
            LeftJoin<ARTran,
                On<ARInvoice.paymentsByLinesAllowed, Equal<True>,
                And<ARTran.tranType, Equal<ARAdjust.adjdDocType>,
                And<ARTran.refNbr, Equal<ARAdjust.adjdRefNbr>,
                And<ARTran.lineNbr, Equal<ARAdjust.adjdLineNbr>>>>>>>>,
            Where<ARAdjust.adjgDocType, Equal<Current<ARPayment.docType>>,
                And<ARAdjust.adjgRefNbr, Equal<Current<ARPayment.refNbr>>,
                And<ARAdjust.released, NotEqual<True>>>>>
            Adjustments;
    }
}

 

Best answer by aiwan

HI @jeremyhodge0 

 

I believe you have to have the IPXPrepareItems interface, you then have to enable this interface with the below:

public virtual bool PrepareImportRow(string viewName, IDictionary keys, IDictionary values)
{
	if (string.Compare(viewName, "Products", true) == 0)// Copied from QuoteMaint graph you will have to change the keys and the view name
	{
		if (values.Contains("opportunityID"))
			values["opportunityID"] = Quote.Current.OpportunityID;
		else
			values.Add("opportunityID", Quote.Current.OpportunityID);
	}

	return true;
}

public bool RowImporting(string viewName, object row)
{
    return row == null;
}

public bool RowImported(string viewName, object row, object oldRow)
{
    return oldRow == null;
}

public virtual void PrepareItems(string viewName, IEnumerable items)
{
}

Hope this helps

Aleks

View original
Did this topic help you find an answer to your question?

3 replies

Patrick Chen
Jr Varsity III
Forum|alt.badge.img+2
  • Jr Varsity III
  • 51 replies
  • October 31, 2024

I found this article on stackoverflow .  In it Dhiren makes an interesting comment that 

We have used PXImportAttribute(Type) constructor where input parameter is the first (Primary) DAC that is referenced by the primary view of the graph where the current view is declared.

 

I think you should try changing the Type in our PXimport attribute statement to the Primary DAC of the graph you are extending, i.e.  ARPayment.  

Good luck

 


  • Author
  • Freshman I
  • 7 replies
  • November 1, 2024

Thank you very much Patrick for the reply. I really thought you were on to it, but unfortunately I am getting the same error.  I also have a ticket in with Acumatica support and if we can figure this out, i will post the resolution here.


Forum|alt.badge.img+8
  • Captain II
  • 366 replies
  • Answer
  • November 5, 2024

HI @jeremyhodge0 

 

I believe you have to have the IPXPrepareItems interface, you then have to enable this interface with the below:

public virtual bool PrepareImportRow(string viewName, IDictionary keys, IDictionary values)
{
	if (string.Compare(viewName, "Products", true) == 0)// Copied from QuoteMaint graph you will have to change the keys and the view name
	{
		if (values.Contains("opportunityID"))
			values["opportunityID"] = Quote.Current.OpportunityID;
		else
			values.Add("opportunityID", Quote.Current.OpportunityID);
	}

	return true;
}

public bool RowImporting(string viewName, object row)
{
    return row == null;
}

public bool RowImported(string viewName, object row, object oldRow)
{
    return oldRow == null;
}

public virtual void PrepareItems(string viewName, IEnumerable items)
{
}

Hope this helps

Aleks


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings