Skip to Content
0
Sep 24, 2020 at 03:37 PM

Script to clear Quote's "Billing and Shipping" tab

200 Views Last edit Oct 08, 2020 at 01:31 PM 2 rev

Hello,

Below is an excerpt of my script attempt to clear the customer entries (Bill To, Ship To, End User) on a quote. (For the rest, just replace "BillTo" with "ShipTo" and then with "EndUser")

Not only does this seem unnecessarily long, but the fields don't stay cleared - they are re-populated with the original info. It seems like a contact in the address book is selected, and clearing all these fields without resetting the selected contact doesn't actually do anything.

How do I remove the 3 customer selections on a quote? I'm hoping for something like "Quote.BillToCustomer = None"...

Quote.BillToCustomer.Active = False
Quote.BillToCustomer.Address1 = ''
Quote.BillToCustomer.Address2 = ''
Quote.BillToCustomer.BusinessFax = ''
Quote.BillToCustomer.BusinessPhone = ''
Quote.BillToCustomer.City = ''
Quote.BillToCustomer.CompanyName = ''
Quote.BillToCustomer.CountryAbbreviation = ''
Quote.BillToCustomer.CrmAccountId = ''
Quote.BillToCustomer.CrmContactId = ''
Quote.BillToCustomer.CustomerCode = ''
Quote.BillToCustomer.CustomerType = ''
Quote.BillToCustomer.Email = ''
Quote.BillToCustomer.FirstName = ''
Quote.BillToCustomer.LastName = ''
Quote.BillToCustomer.OwnerName = ''
Quote.BillToCustomer.PrimaryIndustry = ''
Quote.BillToCustomer.Province = ''
Quote.BillToCustomer.QuoteId = int()
Quote.BillToCustomer.StateAbbreviation = ''
Quote.BillToCustomer.TerritoryName = ''
Quote.BillToCustomer.Title = ''
Quote.BillToCustomer.UserId = int()
Quote.BillToCustomer.ZipCode = ''

Thank you.

- Sergey