Skip to content

Need to assign contactRole to a contact #113

Answered by dpreiss
dpreiss asked this question in Q&A
Discussion options

You must be logged in to vote

After posting this, I found the answer. In case someone needs to do this, here is the solution:

`$role = new AttachContactReference();
$role->attachTo = new RecordRef();
$role->attachTo->type = "customer";
$role->attachTo->internalId = 32258; //customer internal id
$role->contact = new RecordRef();
$role->contact->internalId = 55811; //contact internal id
$role->contactRole = new RecordRef();
$role->contactRole->internalId = "-10"; //contact role internal id

$request = new AttachRequest();
$request->attachReference = $role;
$response = $service->attach($request);`

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@neclimdul
Comment options

Answer selected by dpreiss
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants