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!
|
|
Passing custom data when converting from a Lead to an Opportunity 
Posted: 13 Jun 07 5:08 PM
|
I am using a couple of the "Userfields" in the Leads table to capture some pieces of information, and would like the data in these columns to be migrated to the opportunity when the lead is converted from a lead to an actual opportunity (just like the default data is). Sounds simple enough, doesn't it?
To make a long story short, what I have found is that in the process of converting a lead to an opportunity, the "Insert Opportunity" form with all of the default lead data filled in is called by a "Function" in SalesLogix called "InsertOpportunity" which is the same way the Insert Opportunity form is opened when the user clicks the menu or button to insert an opportunity (without starting from a lead). Now as we all know, "Functions" are not editable or even able to be looked at to see what they are doing, so adding a few custom fields to a function cannot be done. What I therefore need to do each time the Insert Opportunity form is opened is to determine whether it was initiated by a user clicking a menu or if it was initiated by converting a lead, then if it was initiated by a lead conversion I need to know which lead it was so I can grab the custom field data from that lead and fill it in the Insert Opportunity form. Again this sounds simple enough in itself, but since that "Function:Insert Opportunity" is always what opens the Insert Opportunity form how can I find out what event called the function which is calling the form?
Maybe I'm making this too complicated, or maybe what I am trying to do could be done using global variables that are set in the Lead Detail form when the "Convert" button is clicked and then somehow accessed by the Insert Opportunity form and then immediately cleared so the next opportunity to be created doesn't try to re-use the values?
If anyone has any ideas or can steer me in the direction of how to pass custom data fields from a Lead to an Opportunity during the "Convert" process, any help or suggestions would be appreciated.
Thanks!
|
|
|
|
Re: Passing custom data when converting from a Lead to an Opportunity 
Posted: 14 Jun 07 7:00 AM
|
Mark,
Maybe instead of trying to do all of the work after the system calls Insert Opportunity, why not split up the work. That is, right after a user confirms they want to convert a lead to an opportunity create a variable that contains the leadid. Then after InsertOpportunity does its thing you can check that variable for a value. This would be your link. If the variable exists and has a value you know you have to pull the custom data.
John G. |
|
|
|
Re: Passing custom data when converting from a Lead to an Opportunity 
Posted: 14 Jun 07 4:05 PM
|
Thanks John, I think I will give this approach a try. My main concern is making absolutely sure that global variable is cleared as soon as it is done pulling the custom data so the next opportunity to be created doesn't pull the same data again from that lead, but that shouldn't be too difficult to do.
Thanks for the suggestion, if I get this working I'll post what I did to the forum.
Mark |
|
|
| |
|
Re: Passing custom data when converting from a Lead to an Opportunity 
Posted: 18 Jun 07 9:06 AM
|
Hi John.
That's pretty much exactly what I did, I set global variables with my custom data in the on click event for the "Convert Lead" button, and then deleted the variables on the form destroy event of the "Convert Lead" form. All I had to do was have the "Insert Opportunity" form check to see if these global varibles exist each time it opens and grab the data if there is any. Works perfect.
Thanks for the idea.
Mark |
|
|
| |
|