cancel
Showing results for 
Search instead for 
Did you mean: 

Passing the value of Owner Sales (Marketing Lead) to Owner in Account

Former Member
0 Kudos

Hi All,

Here is my requirement.

I want to pass the value of Owner Sales (Marketing Lead) to the field Owner of the Account when the Lead is converted to an account via "Associate Account and Contact".

I am writing the code in On Save event of the account.

However I am not able to retrieve the data of Lead in the On save event of account.

Can you guys guide me on this one?

Also when I am trying to pass a hard coded value to the field (this.EmployeeResponsibleSales.EmployeeID.content), it is giving me an error that "NO access possible via NULL data reference".

I know I am missing something, but I am unable to figure it out.

Kindly see the attached document.

Regards,

Nikhil Moghe

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello,

Yes. You are missing  2 things here:

1. .EmployeeResponsibleSales node is empty and you are trying to access it. So it is suggested that when you write the code just use  IsSet() check before accessing it. For example, you should write:

if(this.EmployeeResponsibleSales.IsSet())

{

 

this.EmployeeResponsibleSales.EmployeeID.content= blah blah

}

2. I have doubt hat this node EmployeeResponsibleSales contains he info you need. Though I am not sure. In any case, try accessing Party node instead with RoleCode = <Role codeEmployee responsible> (just example). For right code, use repository explorer

Let me know.


Regards,

Saurabh

Former Member
0 Kudos

Hi Saurabh,

Thanks for your response.

I am actually facing the issue that the Employee Responsible Sales is only set when the prospect screen comes up, not before that.

However I want to pass the value in this field before the account screen comes up.

Any idea how I can set the employee responsible node?

Regards,

Nikhil

Former Member
0 Kudos

Hello Nikhil,

You cannot assign value in an empty node. In that case, you have to use Create() function. Example :

var ele_ExampleNode : Customer.ExampleNode;

ele_ExampleNode.EmployeeID = "TESTID";

Customer.ExampleNode.Create(ele_ExampleNode);


In your case you can write your code in AfterModify Event of your XBO. This is the only option you have and keep your debugger ON to see when is this event called.

Regards,

Saurabh

Former Member
0 Kudos

Hey Saurabh,

I am using the below statement in my Account.xbo->Event After Modify.

var employee = this.EmployeeResponsibleSales;

Its giving me an error. "Provide an expression that describes a type.

Regards,

Nikhil

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi guys,

I figured it out myself.