Sales Order Header

KwajahatKwajahat Member Posts: 10
Hi,

Under NAV 2018 the sales order header has a field called Requested Delivery Date. When run the table in design mode the type is as Date. I am trying to bring this field into posted sales invoice header but failed to do so. I did created a new field under 50,000 series and named it as Requested Delivery Date and selected the field to be Flow Field but I am able to see the field in posted sales invoice header but there is no value in the field. Not sure of the programming behind it, if there is a simple way of doing it then do let me know

Regards
Kwaja

Answers

  • Wisa123Wisa123 Member Posts: 308
    Hi,

    Theres 2 ways about this:
    1.) Don't make it a FlowField, it should be of type "normal"
    2.) The field on the SalesInvoiceHeader needs to have the same ID and type as the one on the Order (thats where you might run into licensing issues)
    Let the TransferFields calls in the posting routine do it's magic.


    The other way around would be to actually customize/extend the posting routine to copy over the field values into your new field. As always, especially when it's about posting, this needs to be done by an expert.

    /Wisa
    Austrian NAV/BC Dev
  • KwajahatKwajahat Member Posts: 10
    Hi Wisa

    Thanks for your reply.

    Well the id for requested delivery date when i tried to create the with same id under posted sales invoice header table gave me error as license issue so cant create the field with exact id found in sales header

    So I thought what if i can create a flow field to see if that works or not, it doesnt work since the field under sales header is type as Date and my new field which i have created in Posted sales invoice header with Type as Text, it doesnt match.

    I tried using the same type as Date in posted sales invoice header for the field requested delivery date which i created with id as 50025 but still i am not able to get the info copied from sales header to posted sales invoice header.

    If this is complicated then no choice i have to go back to our developer only, i thought if someone can provide me a simple work around that would be great but looks like some coding is needed

    Regards
    Kwaja
  • Wisa123Wisa123 Member Posts: 308
    Hi,

    Thanks for the detailed answer, i just tried around a little bit and got it to work (no code involved).

    Field:
    DataType: Date
    FieldClass FlowField
    CalcFormula: Lookup("Sales Header"."Requested Delivery Date" WHERE (Document Type=CONST(Order),No.=FIELD(Order No.)))

    if you put that field in a page the value will show, field ID is irrelevant.

    However, this assumes that your orders are not deleted/archived when the invoice is completed -> may need to refer to Sales Order Archive instead of Sales Header instead.
    Also this is not the way you would usually do this ( this should usually be a physical field).

    However well, if it works it works right :smile:

    /Wisa


    Austrian NAV/BC Dev
  • KwajahatKwajahat Member Posts: 10
    Hi Wisa,

    Thank you so much for your help. I shall try it out and will write back to you. But the way you have given the steps of setting it up I am sure it will work as you have already confirmed it. Thank you very much for your kind help

    Regards
    Kwaja
  • KwajahatKwajahat Member Posts: 10
    Hi Wisa,

    I tried the same as per your advise but unfortunately it is not working. Let me explain

    You can see the screenshot here

    wpz2s00ae4ac.png

    I hope I have done everything correctly the way you wanted the requested delivery date in posted sales invoice header to be defined and also if you look at the field class it is flow field and the calc value is as per your write up

    after this when i visit posted sales invoice header and ran for few records, it only shows the date for very few posted sales invoices, i mean for example if i have 100 posted sales invoices, it is showing the field in posted sales invoice header as requested delivery dates and most of the invoices it is blank, means no date but shows requested delivery date for few invoices only

    I recently posted 2 sales orders on Dec 28th 2019 in testing DB, when i visit posted sales invoice header, run and apply filter on posting date as Dec 28th 2019, the system shows 2 invoices posted but under the requested delivery date there is nothing shown

    I hope you can reply me back with another advise or any other work around

    Regards
    Kwaja



  • Wisa123Wisa123 Member Posts: 308
    edited 2020-01-02
    Hi,

    Concerning your test-case with the 2 invoices:
    - Are you sure you set a Requested delivery Date on the orders?
    - Do the order still exist in the database ( do they show up in the sales orders list) ?
    - Do your Posted Sales Invoice Headers have the correct value in their "Order No." field?

    NAV Standard deletes your Sales Header Records for an Order when it is fully invoiced/shipped. Therefore the Lookup cannot work at that point, Unless your partner has modified this behaviour (which a lot do). Thats why i mentioned:
    However, this assumes that your orders are not deleted/archived when the invoice is completed -> may need to refer to Sales Order Archive instead of Sales Header instead.
    Austrian NAV/BC Dev
  • KwajahatKwajahat Member Posts: 10
    Hi Wisa

    The sales order header has field called Requested Delivery Date and I have created the same field under Posted Sales Invoice Header Table as well, but due to license issue I am unable to repeat the same id 5790. I am not sure of the reasons why i am not able to use the same id to create as currently i am using developer license as well

    Then i went back to flow field where we exchanged few mails on how to set it up using flow field but that worked only for few orders and not for all orders which i have posted by filling the requested delivery date on sales orders and posted

    the customer doesn't store orders here, i mean like once fully shipped and invoiced, the orders are deleted from the system. if this is the cause then i get my developer to look into it and will see how much time he needs to fix it, my customer wanted me to help them out of the box, so i was trying all methods to see if anyone can help me. Of course you did helped me but it is not working as orders are not stored and they dont archive orders also

    Thank you for your replies and all the help you have provided

    Regards
    Kwaja
  • Wisa123Wisa123 Member Posts: 308
    Then theres no other way to get your dev to work and create a normal field and fill it during posting. Shouldn't take long.
    Austrian NAV/BC Dev
  • KwajahatKwajahat Member Posts: 10
    Hi Wisa

    Thanks for all the help you have provided to me. I have written to my developer and he said he will look into it and will give me his feedback

    Regards
    Kwaja
Sign In or Register to comment.