Temporary Table

datha91datha91 Member Posts: 7
Hi everyone.

This is my first post and it is my first few days learning NAV and C/AL so please go easy with your reply. I hope my question is not too complicated.

I have two tables called "Header Information" and "Detail Information".
The idea is to copy the data in these two tables to "Sales Header' and "Sales Line" tables respectively.

But before doing so , I want to create a two temporary tables that would hold the data temporarily while the user do the confirmation. Meaning the tables will be "Temp Header Information" and "Temp Detail Information".

My question is how do I go about creating such table.

And secondly , once these tables are created , how can I make sure these temporary tables are deleted if the user choose to cancel in the confirmation window.

Thank you everyone in advance.

Comments

  • David_CoxDavid_Cox Member Posts: 509
    Option 1:
    Don't re-invent the wheel, just use a Sales Quote?

    If you are copying the data to the sales header and sales lines then the customer must already exist in the stystem?

    Create a Quote and then when confirmed just convert the Sales Quote to a Sales Order, no code or extra tables required!

    If the quote is not confirmed then mark it somehow as rejected maybe use a "Reason Code", use the standard functions to sales archive this will save a copy and then you can delete the rejected quote, you can report on or recall the quote from the archive history if needed.

    Option 2:
    If you are creating a quick entry screen and wanting to convert the values from your new tables then why make them temporary?

    As a business I would want to be able to analyse the temporary orders that were not converted to sales orders, look at why the order was not confirmed and how we could convert these to sales later.

    Just like in the Sales Order Process, have five tables two for the Quick Entry, two for the Quick Entry History and a "Rejected Reason" table like the Reason code.

    If the Order is rejected populate the "Rejected Reason Code" transfer to the history table with a "Rejected" status and "Rejected Reason Code" so these can be looked at or recalled later for analysis.

    If the Order is accepted populate the Sales Header and Lines, populate the history table with an "Accepted" status and record the order number.

    Now you have a full audit and analysis trail and have not lost information that you would with temporary data, this data might add value to the business.


    HTH

    David
    Analyst Developer with over 17 years Navision, Contract Status - Busy
    Mobile: +44(0)7854 842801
    Email: david.cox@adeptris.com
    Twitter: https://twitter.com/Adeptris
    Website: http://www.adeptris.com
  • datha91datha91 Member Posts: 7
    Thank you so much for the reply. Your pointers really make me think of things I was not factoring in earlier. I am take note of what you have pointed out.
Sign In or Register to comment.