Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Copper Super Contributor
Posts: 42
Registered: ‎04-23-2009
Accepted Solution

Assigning different account manager to opportunity

I've seen a couple of different posts that deal with returning the current user.  However, my issue is assigning this user to be the account manager for an opportunity.  Our goal is to not default the account.accountmanager but rather have the opportunity.accountmanager be the current user. 


I am going about this by using the OnCreate method for the Opportunity object.  I have added a post execute step and have the code:


public static voidOnCreateStepSetDefaults( IOpportunity opportunity)


Sage.Entity.Interfaces.IUser usr = Sage.SalesLogix.API.MySlx.Security.CurrentSalesLogixUser

as Sage.Entity.Interfaces.IUser;

opportunity.AccountManager = usr;




This doesn't error, but when i bring up the insert opportunity screen, the acct manager is still the acct.acctmgr and not the current user.  Any idea where I'm going wrong?





Copper Elite Contributor
Posts: 40
Registered: ‎03-31-2010

Re: Assigning different account manager to opportunity

The challenge I've run into with this sort of thing is that business rules are perhaps useful for setting default values but often their overridden some where in the interface design which means you can set up all the onCreate steps you want but if the interface logic is changing the value after the entity has been created your defaults will always get overridden.


I think your best bet is to see where on the insert opportunity function the opportunity entity is being populated in the interface code (i.e. after the new entity has been created but before it's rendered to the end user) and override the logic there.





James Sutton
Copper Super Contributor
Posts: 42
Registered: ‎04-23-2009

Re: Assigning different account manager to opportunity

If anyone were intereseted, I did figure this out. 


There is validation code on the load of the screen and that is what sets the Acct Mgr, so teh code on the Opportunity object gets overridden.  So, to set the account manager to the current user, you need to:

Open Load Actions on the Insert Opportunity Form

Add another member to the load actions.

Choose C# snippet Action Item(obsolete)

For the code, use:

Sage.Entity.Interfaces.IUser usr = (Sage.Entity.Interfaces.IUser)Sage.SalesLogix.API.MySlx.Security.CurrentSalesLogixUser;

usrUser.LookupResultValue = usr.Id;


Save everything, build and deploy.


Hope it helps,



Copper Contributor
Posts: 8
Registered: ‎10-03-2010

Re: Assigning different account manager to opportunity

[ Edited ]

More specifically, it's the 'CheckOppAccount' business rule found in Sage.SalesLogix.Opportunity.Rules and which gets run once the Account has been set/defined in the interface (it sets the AM to the Account.AM -- it's the OnChangeAction for the lueAccount lookup).  It's a small script that can be either replaced (remove 'Primary Step' and replace), override with a 'Post Execute Step' or simply reset in the interface using an OnChange event on the lueAccount field.


Also found in:

- OnCreate

- OnBeforeAccountChanged