Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Unanswered

SQL Command to remove default shipping address

Posted on by 395

Hi

can someone please help me with a SQL command to remove the default shipping address from entire customers on the database?

Thank you.

  • nazza Profile Picture
    nazza 395 on at
    RE: SQL Command to remove default shipping address

    Nice one, will do that. Thank you.

  • ToddB Profile Picture
    ToddB on at
    RE: SQL Command to remove default shipping address

    Hi Nazza,

    Thank you for the information.

    If you have validated that the online orders work, if there is no PrimaryShipToID assigned, then I would say test the query and validate there are no issues. Then make a backup and run against PROD.

    I would suggest modifying the query to only update records that have a PrimaryShipToID assigned:

    Update customer set primaryshiptoID=0 where PrimaryShipToID <> 0


    I would also recommend setting security on the Set Primary button, on the Customer Properties form, so that cashiers cannot mark this:

    pastedimage1622216434287v5.png



    And set security on the 'This is the primary shipping address for the customer': when creating New or editing address information:

    pastedimage1622216397563v3.png



  • nazza Profile Picture
    nazza 395 on at
    RE: SQL Command to remove default shipping address

    Update customer set primaryshiptoID=0

    Is this correct?

    Off course I will run this on dummy database before making changes in live database.

  • nazza Profile Picture
    nazza 395 on at
    RE: SQL Command to remove default shipping address

    Thanks mate for your reply.

    Reason I want to remove default shipping address is, when order is placed online and customer chooses different address on ship to address, RMS is picking default shipping address as per RMS, it completely ignores the customer input on the web. So I think best way to solve this is to untick default shipping address

    Please let me know if there is a command to do this. Thanks.

  • ToddB Profile Picture
    ToddB on at
    RE: SQL Command to remove default shipping address

    Hi Nazza,

    The PrimaryShipToID is stored in the customer table.

    To view customers that have a Default Shipping Address assigned, you can run something similar to the below:

    select accountnumber, firstname, lastname, PrimaryShipToID from customer where PrimaryShipToID <> 0

    What is the reason you are wanting to update the default shipping address to be 0 for all customers?

    NOTE: This would be an Update statement; and always make a backup of the database before running any Update, Insert or Delete statements.

    _______________________________________________

    Just a note that Mainstream support for Microsoft Dynamics RMS 2.0 ended on July 10, 2016; and extended support ends on 7/13/2021:

    https://community.dynamics.com/rms/b/rmssupport/archive/2015/10/22/microsoft-dynamics-rms-2-0-mainstream-support-discontinuation-july-10-2016

    Dynamics Retail Management System 2.0 - Microsoft Lifecycle | Microsoft Docs
     
    pastedimage1622214397407v1.png

    This is less than 7 weeks from now; and you can continue using RMS after this date, but technical support will not be available.

    I would recommend checking with your partner regarding what they may recommend as a replacement system after the extended support end date.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans