Hello, I am trying to assign a role to a lead cre...
# suitescript
s
Hello, I am trying to assign a role to a lead created from an external form but it seems the contactrole sublist is not loading together after the lead is created. Thus, I am unable to change the contactrole role field. Has anyone encountered this and how did you fixed it?
b
record.attach is the option for things you click the attach button for in the ui
s
@battk How do I get the contact id after creation of the lead so I can attach it?
b
is this from a user event script?
s
I have tried both client and userevent
b
client script is unlikely to work, its very limited and the lead does not exist yet
same thing for user event script beforeSubmit, the lead does not exist yet, there is nothing to attach to it
use an afterSubmit user event script, and use Record.id
s
it can only get the id of the Lead. How about the contact which is in the sublist?
b
do a search
although im not really sure what you are doing, im not really sure what you are attaching to what, especially if your contact role already exists
s
hhhmm... search might fix it. I will try that. Thanks!