How to make contact and customer with stored procedure

landlordlandlord Member Posts: 18
Hi all,

I have application that should be connected with Nav. In that application when somebody inserts new Customer, its passed to stored procedure in Nav's DB. With this stored procedure Customer is inserted as Contact.

First plan was to make Customer from Contact with Nav's report.
This solution is not good, and I want to ask you is Ok to create with this stored procedure Contact and Customer, and to insert this data into Contact Business Relations table? Can you guys give me pros and cons to do this?

tnx in advance.

Comments

  • krikikriki Member, Moderator Posts: 9,110
    cons:
    -inserting data in the Navision-tables, you can completely mess up the data. (E.g. Code-fields don't exist in SQL and if you put a lowercase character in...)
    -Business-logic is NOT triggered.

    You should create a new table (without CODE-fields) in which the other application writes. Then let Navision transfer the data to the contact-table, respecting all the business-logic.
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • DenSterDenSter Member Posts: 8,305
    The biggest con is that this way the business logic inside the NAV database doesn't execute, and you can be left with inconsistent data. The best way to integrate NAV with external apps is to develop a mechanism to communicate with a component that is able to execute NAV business logic.

    This can be done by writing the data into a staging table, and have a NAV component process this into NAV core tables. It could also be done by sending the data as XML docs into a message queue and have a NAV process pick that up.

    Get in touch with the NAV partner and discuss the options. Writing directly into the NAV database by a stored procedure is not the recommended approach.
  • landlordlandlord Member Posts: 18
    Thanx for your replays.
    It could also be done by sending the data as XML docs into a message queue and have a NAV process pick that up.[\quote]

    What process can I use for this? I need to send data from external app to Nav, and in Nav to process this data, to make Contact and Customer, and do this online. What service should I call?

    EDIT: I found on net that I should use for this NAS, but my client is does not want to pay for NAS. Is there another alternative for this.

    Thanx.
  • bbrownbbrown Member Posts: 3,268
    landlord wrote:
    Thanx for your replays.
    It could also be done by sending the data as XML docs into a message queue and have a NAV process pick that up.[\quote]

    What process can I use for this? I need to send data from external app to Nav, and in Nav to process this data, to make Contact and Customer, and do this online. What service should I call?

    EDIT: I found on net that I should use for this NAS, but my client is does not want to pay for NAS. Is there another alternative for this.

    Thanx.

    There is 1 NAS session included in the base product (at least for some time). Is your customer already using this? If not he already has one.
    There are no bugs - only undocumented features.
  • landlordlandlord Member Posts: 18
    Yes, they already use this licence.
    Tnx for your help
  • DenSterDenSter Member Posts: 8,305
    You could have one client session running at all times that runs the process that NAS would do, but that's not very secure. Kind of like the way the old Job Scheduler used to work.
  • davmac1davmac1 Member Posts: 1,283
    Another option is to turn on maintain defaults in the database Window.
    This means if you insert records in contacts and customers, you do not have to worry about null values. Since the data is non-transactional, it is safe if you make sure you always insert fields in the proper format (CODE fields) and you meet the minumum requirements.
Sign In or Register to comment.