on ‎2020 Sep 24 4:37 PM
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
Request clarification before answering.
Hi Sergey
can you try:
BillToCustomer = Quote.BillToCustomer
Quote.SaveCustomer(BillToCustomer)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Prashant,
I never noticed that SaveCustomer() was an option - that must be it! Thank you!
Unfortunately, we had to turn off the script before I could test it further - the system started glitching more often (notifications started failing intermittently, etc). I think we have too many CRM mappings, post actions, and notifications setup and they're overloading the system, especially if my scripts throw any errors. You see, we've been using CPQ as a CRM until we finally got a CRM. So we decided that we need to finish cleaning that up first before setting up any more scripts. But I have recorded your suggestion and will try it when the time comes. Thanks again!
- Sergey
Hi Sergey
Add Quote.Save() at the end of the script to apply your changes to customer roles
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 34 | |
| 6 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.