Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Highlighted
Bronze Super Contributor
Posts: 141
Registered: ‎02-22-2010
Accepted Solution

Insert Opportunity LeadSource AutoFill ...Urgent Help Needed Please

Hi,

 

I want to autofill the leadsource lookup in the insert opportunity screen and i am using the belwo code. But i am not getting any value in it. If any body please help me in this issue.

 

Sage.Entity.Interfaces.IOpportunity opp = this.BindingSource.Current as Sage.Entity.Interfaces.IOpportunity

 

 

 

lueLeadSource.LookupResultValue = opp.Account.LeadSource.Id;

 

 

 

I have used above code in the page load event and also on account lokkup change event but still no luck. Am i Missing some thing

 

 

 

Thanks In Advance

 

  

 

Please Help

 

Jack

Highlighted
Bronze Super Contributor
Posts: 141
Registered: ‎02-22-2010

Re: Insert Opportunity LeadSource AutoFill ...Urgent Help Needed Please

Got the solution to this problem. Please see the belwo code and paste it in form load event of insert opportunity to populate the account lead source automatically as a default resource to the opportunity.


Sage.Entity.Interfaces.IOpportunity opp = this.BindingSource.Current as Sage.Entity.Interfaces.IOpportunity;

if(opp.Account != null&& opp.Account.LeadSource != null)
{

Sage.Entity.Interfaces.ILeadSource leadSource = Sage.Platform.EntityFactory.GetById<Sage.Entity.Interfaces.ILeadSource>(opp.Account.LeadSource.Id);

opp.LeadSource = leadSource;



}