using triggers in codeunit Sales-Quote to Order

EWKrebbersEWKrebbers Member Posts: 3
edited 2004-06-05 in Navision e-Commerce
Hello,

I am developping an alternative for the Commerce portal.

everything works fine at last :).
We decided only allow inserting Quotes by customers using the website, and not allowing to insert Salesorders directly. Employees from the company can convert the quote to a salesorder.

Converting is done by the codeunit named : "Sales-Quote to Order"
We use a 2nd Database for the website, running on SQL Server 2000. When something is changed in Navision, we use the triggers to keep this database up to date by synchronizing the database, using the same technology as the commerce portal, by using the message queue.

Since the operation which converts a quote to a salesorder uses the codeunit Sales-Quote to Order, no triggers will run, and still, records from the "Sales header" table are deleted and inserted.
I looked into the codeunit and changed after every "modify" "delete(all)" and"insert" : "(TRUE)"
Then I tried again to convert a quote to a salesorder, but it didnt work, because of running some triggers.

So before the triggers will not being fired, and thus my 2nd database will not be synchonized. After modifying the codeunit, trigers will run, but it will give some conflicts, and it will not be possible to convert a quote into a salesorder. Maybe someone knows how to modify the "Sales-Quote to Order" unit the way it can serve both purposes....

Thanks in advance,

Eko Krebbers

Comments

  • tyrrestruptyrrestrup Member Posts: 10
    Hi Eko,

    This might work:

    In the beginning of the codeunit that converts Quote to Order insert a delete for the quote in the message queue and after the sales order has been created, insert an insert for the order in the message queue table.

    Also remember to convert the codeunit back to standard (without TRUE).

    Christian
Sign In or Register to comment.