Incorrect form notes in generated XML-file

When a credit note is created for Invoiced sales order, sales Invoice report shows the correct form notes that were setup in Account Receivable setup module( (i.e)Form Notes for Sales credit note ).But when XML file generated for the invoiced sales order credit note  the xml file shows form notes for SalesInvoice.
Can anyone help me to resolve the issue??

  • $@n$h€46
    But when XML file generated for the invoiced sales order credit note  the xml file shows form notes for SalesInvoice.

    Can you explain this?

  • In reply to Kranthi:

    When XML file for the   credit note Invoice in sales order is generated in appropriate folder  the form notes used is sales invoice instead of sales credit note.  
    Actually the data should come from credit note (form notes) but by default it fetches sales invoice (form notes).
    SalesOrders -> Invoiced salesOrder ->Invoice journal -> Send Electronically

  • In reply to $@n$h€46:

    Looking at the query, it seems that the form letter value has been hard coded.
    Look at \Queries\AxdSalesInvoice and the relation between CustInvoiceJour and FormLetterRemarks.
  • In reply to Kranthi:

    So for both credit note and sales invoice you will get the text from sales Invoice. Looks like a Bug.
  • In reply to Kranthi:

    Actually they have given the default range as sales invoice in that query.
    should i need to dynamically change the range and set as sales credit note??
  • In reply to $@n$h€46:

    Report it to Microsoft.
    If you want to fix it temporarily, remove the range from query and determine it in the code.
    You can determine whether is not a credit note by using, custInvoiceJour.creditNote()
  • In reply to Kranthi:

    Thank you so much kranthi.
    I will fix it through code.
    I just dont know where they have actually used the query to retrieve the values for XML file??
    Can you please specify where can I need to apply the ranges?
  • In reply to Kranthi:

    custInvoiceJourLocal.sendElectronically(XMLDocPurpose::Original, AifSendMode::Async);
    they have used the method to pass the document type and in sendElectronically() method they have defined the service operation class and in my case it is SalesSalesEinvoice class.
    So where is the actual query used and how they are retrieved.I have debugged entire thing and finally it ends in AifOutboundProcessingQueue::submitSendRequest().
  • In reply to $@n$h€46:

    Have a look at \Classes\AxdSalesInvoice_Einvoice\initQuery
  • In reply to Kranthi:

    Kranthi I tried to debug the class AxdSalesInvoice_Einvoice\initQuery but the debugger doesn't hit in the specific method.
    Even I wrote an job to run the batch job that is necessary to send XML file to appropriate folder but the debugger doesn't hit in the initquery() method.
    job to run batchjob

    new AIFoutbooundprocessingservice().run()
  • In reply to $@n$h€46:

    Batch jobs execute in CIL, therefore you have to use a CIL debugger (= Visual Studio), not the X++ debugger. Did you do it?
  • In reply to Martin Dráb:

    Even AxdSalesInvoice_Einvoice\initQuery method should be debugged using CIL debugger??
    In my case I just want to debug only this class?
  • In reply to $@n$h€46:

    You said you ran a batch job. If it's true, you have to use the CIL debugger (or run the code in a different way), because batch jobs run in CIL.
    If it's not true, you'll have to share the correct information with us.
  • In reply to Martin Dráb:

    Yeah that's fine to use CIL debugger for batch jobs.
    But I just need to know when the AxdSalesInvoice_Einvoice\initQuery method gets executed?
    whether this method gets executed while running a batch job or Just by clicking the send electronically button in sales invoice journal ?
    In my case method doesn't gets executed when I perform the above mentioned process?
  • In reply to $@n$h€46:

    Sorry, I don't remember the whole AX 2012 by heart. I recommend you use cross references to find where methods are used; otherwise you'll have to wait until I get to an AX 2012 environment or somebody else will help you.
    If you want to know what "send electronically" does or doesn't, why do you simply look into code?
Related
Recommended