Question

Automatically filling Lead fields

Hello, 

Where could I find the document about how to automatically fill come fields when creating a new lead? 

The idea would be: When creating a new, we should be able to indicate only the contact linked to the lead, and the other fields (account, email, phone number, etc.) would be automatically filled in the Lead according to the information indicated in the linked Contact. 

Could it be possible to do this without creating a process? 

 

Best, 

Like 0

Like

1 comments

Dear Jacob,

Yes, you can create such functionality by the means of JavaScript development.

The algorithm is the following:

1. Create a replacing client module for LeadPageV2, if you do not have one already.

2. In the methods block of the page override a basic save() method. This save() method would be checking if you are creating a new record, or editing existing one. Here is a code snippet to implement such logic:

this.isAddMode - returns true if it is a new record.

If AddMode you take the value from Contact field (this.get("Contact").value) and run an ESQ to the Contact object, filtering by contact Id to receive needed data from this contact.

Set received values to the Lead fields (this.set).

Afterwards, do not forget to call parent realization of save method.

If this is not an AddMore, you simply run parent realization of save method. 

Please find the documentation on how to create ESQ queries to the database and proceed the results.

https://academy.bpmonline.com/documents/technic-sdk/7-13/use-entityschemaquery-implementation-client

Regards,

Anastasia 

Show all comments