a document is returned from an email after signing, after making entry in documents module its file name is missing.
what im missing??
$documentBean = BeanFactory::getBean('Documents')->retrieve_by_string_fields(
array(
'envelope_id' => $envelope_id,
)
);
$docName = $documentBean->document_name;
$DocRevBean = BeanFactory::newBean('DocumentRevisions');
$DocRevBean->change_log="Document Created";
$DocRevBean->filename = $docName.' - SignedRevFile';
$DocRevBean->document_name = $docName.' - SignedRevDocName';
$DocRevBean->file_ext = '.pdf';
$DocRevBean->doc_type = "Sugar";
$DocRevBean->file_mime_type="application/pdf";
$DocRevBean->revision = "1";
$doc_revision_id = $DocRevBean->save();
$newDocumentBean = BeanFactory::newBean('Documents');
$newDocumentBean->lead_id = $documentBean->lead_id;
$newDocumentBean->doc_type = $documentBean->doc_type;
$newDocumentBean->document_revision_id = $doc_revision_id;
$newDocumentBean->document_name = $documentBean->document_name.' - SignedDocDocName';
$newDocumentBean->filename= $documentBean->document_name.' - SignedDocFile';
$new_doc_id = $newDocumentBean->save();
if($new_doc_id){
$doc_rev_bean = BeanFactory::getBean('DocumentRevisions', $doc_revision_id);
$doc_rev_bean->document_id = $new_doc_id;
$doc_rev_bean->save();
}