user1003771
user1003771

Reputation: 23

Set default values when creating contact from lead

I added a few custom string fields using NameValuePair in the Lead form (CR301000). Using the an Action, I create a contact from the lead. I added the same custom fields to my Contact form (CR302000). How can I get the custom values from my lead to my new contact? I tried using the following:

[PXFormula(typeof(Selector<CRLead.contactID, ContactExtNV.usrCROnline>))]

I'm going to have the same issue when I create an account from the lead. Is there a better way to do this instead of using PXFormula?

Upvotes: 0

Views: 117

Answers (1)

Vardan Vardanyan
Vardan Vardanyan

Reputation: 669

The Selector parameter for the PXFormula attribute looks like this:
Selector –> Selector<KeyField, ForeignOperand>
KeyField-> The key field to which the PXSelector attribute should be attached.
ForeignOperand-> The expression that is calculated for the data record currently referenced by PXSelector.

That is, in your case it turns out like this:

 [PXFormula(typeof(Selector<Contact.contactID, CRLeadExt.usrCROnline>))]
 public string UsrCROnline { get; set; }  

Adding namespace in the source code using Customization Project Editor

Upvotes: 1

Related Questions