6/19/2025 3:29:44 PM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
|
|
|
|
Change SeccodeID in Account
Posted: 17 Jul 07 8:57 AM
|
Hi I would like to change the seccodeid in account table with SLQ Update-Statement. this has worked. but the dependent Items, such as contacts, histories, activities and many others, weren't updated.
if I change the owner directly in the account, all dependent items are updated. What do I have to do without opening the account?
regards frank kress
|
|
|
|
Re: Change SeccodeID in Account
Posted: 17 Jul 07 9:36 AM
|
Frank,
It is highly recommended NOT to change the account seccodeid with a SQL update statement. The proper method to change the account owner (seccodeid) for an account is from the Account detail screen. This ensures all contacts, opportunities, history and activities are updated properly.
If you are changing ownership for multiple Accounts, the next best method is to use the Realign Territories function found in the Administrator under the Manage menu. For this to work, you must have all the Accounts you want updated to a new seccodeid in one account group.
If you can restore the account you changed using the UPDATE statement back to the original seccodeid this should resolve the issue you are having with that account. Once all looks fine, use one of the methods I listed above to change the account ownership (seccodeid).
John G.
|
|
|
|
Re: Change SeccodeID in Account
Posted: 17 Jul 07 10:42 AM
|
Well you can write a SCRIPT that goes after the multiple tables and records that store the value of the SECCODEID (Owner) that's stored in Account. It's a fairly simple script. You just have to make sure you go after ALL tables that are affected....something that SLX knows how to do..... AND WANT TO AFFECT! Just wrote a script that changed all of the SECCODEID's except for Closed - Won or Lost Opportunities......
Some tables to think about: ACCOUNT ACCOUNTSUMMARY CONTACT OPPORTUNITY |
|
|
|
Re: Change SeccodeID in Account
Posted: 18 Jul 07 2:56 AM
|
Hi RJ thank you for these information but do you have a sample how can I doit?
I've found another way to change the SECCODEID. Here are the script: I've create a dataform. BaseTable ist ACCOUNT. (TestSaveOwner) I put a TLookupEdit Control (the same as in "Account Details" View)
-------------------------------------------------------------------------------------------------------- PlugInName = "System:TestSaveOwner" Set objMainView = Application.MainViews.Add(PlugInName, 1 , false) 'DNL objMainView.currentid = AccountID
objMainView.DetailsView.txtowner.LookupID = SeccodeID objMainView.DetailsView.txtuser9.Text = cstr(now())
objMainView.refresh objMainView.close
set objMainView = nothing -------------------------------------------------------------------------------------------------------- It works!! But the Form will not closed but i've set the command of "objMainView.close".
You have an idea how can I close this form?
regards
|
|
|
|
Re: Change SeccodeID in Account
Posted: 18 Jul 07 6:54 AM
|
Frank,
If you want to do this in SQL statements alone then I believe RJ's probably captured the necessary tables that also need to be updated. You'd just need to grab all the records in those tables with the same account ID into a recordset, loop thru them and update the Seccodeid. If you want to be doubly certain that you've gotten all the appropriate tables then I would turn on the Profiler while updating the owner thru the account detail form.
Good luck,
Jeff |
|
|
|
Re: Change SeccodeID in Account
Posted: 18 Jul 07 8:39 AM
|
You've lost me completely on this.
What is AccountID? objMainView.currentid = AccountID
What is SeccodeID? objMainView.DetailsView.txtowner.LookupID = SeccodeID
what kind of control is txtowner? LookupID implies LookupEdit control, so why aren't you populating the TEXT property, FORMAT = ftOWNER?
?????? objMainView.DetailsView.txtuser9.Text = cstr(now())
Use a DATETIME EDIT control for dates, not a text box. if this control is bound to Contact.UserField9 DO NOT USE this field. objMainView.DetailsView.dteDATECONTROL.DateTime = NOW()
Scripts are scripts, loop through the tables and update the record sets.
|
|
|
|
Re: Change SeccodeID in Account
Posted: 19 Jul 07 2:31 AM
|
[RJ:] What is AccountID? objMainView.currentid = AccountID
[Frank:] That is the SLX AccountID who I want to change the Owner.
[RJ:] What is SeccodeID? objMainView.DetailsView.txtowner.LookupID = SeccodeID
[Frank:] That is the InsertSecCodeID that what I grapt out of the table USEROPTIONS over the USERID. [Frank:] Here are a sample : "mSeccodeID = NullToZero(getfield("OPTIONVALUE", "USEROPTIONS", "NAME = 'InsertSecCodeID' and USERID ='" & UserID & "'"))
[RJ:]what kind of control is txtowner? LookupID implies LookupEdit control, so why aren't you populating the TEXT property, FORMAT = ftOWNER? [Frank:] What I had mentioned in my last answer is a LookupEdit control. "I put a TLookupEdit Control (the same as in "Account Details" View)" [Frank:] I've used the same settings how are in the Account Details View
[RJ:] ?????? objMainView.DetailsView.txtuser9.Text = cstr(now()) Use a DATETIME EDIT control for dates, not a text box. if this control is bound to Contact.UserField9 DO NOT USE this field. objMainView.DetailsView.dteDATECONTROL.DateTime = NOW() [Frank:] forget it that is nothing only for me to see any thing in the SLXProfiler.exe
[RJ:]Scripts are scripts, loop through the tables and update the record sets. [Frank:] Scripts are scripts, but I think loop through the tables and update the recordsets are very lot of work and mybe I forgot any thing. [Frank:] I think, if SalesLogix can already do this I then won't invent the wheel newly.
[Frank:] But my question is: Why isn't the form closed if I use these commands? objMainView.refresh objMainView.close set objMainView = nothing
Sorry, but my english is not very well and I hope now you can understud my problems 
regards frank kress |
|
|
|
Re: Change SeccodeID in Account
Posted: 19 Jul 07 2:54 AM
|
Hi Jeff Now I've use the LookupEdit Control from the Form "Account Details" in my own Account Dataform. I try it and choose a team and close the form over OK button (mrOK) I saw over SLXProfiler that SLX update by self whol records that are related to Account. The best of it: I needed to have to write no one goat line of code for this.
regards
frank |
|
|
|
Re: Change SeccodeID in Account
Posted: 19 Jul 07 3:58 AM
|
Hi all together I've found now the result of my question: But the Form will not closed but i've set the command of "objMainView.close". You have an idea how can I close this form?
I've wrote: Set objMainView = Application.MainViews.Add(PlugInName, 1 , false) objMainView.refresh objMainView.close
I change 2 things first: before : Set objMainView = Application.MainViews.Add(PlugInName, 1 , false) after : Set objMainView = Application.MainViews.Add(PlugInName, 0 , false)
secound : before : objMainView.refresh after : objMainView.post
that it and It works!!
Thank you all for whol answer. The best way around one to solve problem is talk about it!
regards Frank |
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|