function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Namina P VNamina P V 

generate sdocs document from apex class

Hi,

Can I generate sdoc documents directly from apex class, and update some fields according to that?
NagendraNagendra (Salesforce Developers) 
Hi Namina,

Here's one sample example on how to create sdoc using apex trigger:
trigger CreateSDOC on SCS_Faculty_Contract__c (before update) {
for (SCS_Faculty_Contract__c l : Trigger.new)
 
if (l.Status__c == 'Contract generated'){
SDOC.SDBatch.CreateSDoc(UserInfo.getSessionId(),'id='+l.id+'&Object=SCS_Faculty_Contract__c&doclist=a1Vg0000000m9u4');
}
}
For more information on the above requirement please check with the below post from the sdocs forums:
http://www.sdocs.com/forums/topic/creating-a-trigger-to-generate-a-doc/

Kinldy mark this as best answer if it's resolved.

Best Regards,
Nagendra.P