cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Not applicable

Using Apex Drawloop API - Unable to create documents using DDP

Hi Drawloop Support Team,

I have installed Drawloop Document Generation app from appexchange place. I've reached out to one of your AE and made sure my business edition/ outbound messaging is enabled for my org. I've created a ddp and a delivery option(recordtype:attach) using the app. I'm using the below code to grab the attachments from Account record, send delivery option for ddp and as well as ddp id  to drawloop using Loop.LoopMessage.Send();

Code snippet:

Id ddpLoopId = 'a0936000001A3kC';

Id ddpDeployId = 'a0736000004Ygep';

Id acctId = '00136000005P7u0';

Loop.loopMessage lm = new Loop.loopMessage();

List<Attachment> nas= [select id,name from Attachment where parentid=:acctId];

String attachIds='';

for(Attachment na :nas){

               attachIds = attachIds+na.id+'|';

}

Map<string, string> variables;

                if(attachIds.length()>1){

                    attachIds = attachIds.substring(0,attachIds.length()-1);

//Below ID is of the "Delivery Option" of DDP

                    variables = new Map<string, string> { 'deploy' => ddpDeployId ,'attachIds'=>attachIds };

                }

Loop.loopMessage.send(acctId, ddpLoopId , variables, 'ap1');

I'm running this code through anonymous block. The code is running successfully but I am unable to see any attachment created through the ddp on Account record.

Any help is highly appreciated.

Thanks,

Priyanka.

Tags (3)
Reply
2 Replies
Highlighted
Nintex Newbie

Re: Using Apex Drawloop API - Unable to create documents using DDP

Hi! I have the same problem. Have you found the solution?

0 Kudos
Reply
Highlighted
Nintex Employee
Nintex Employee

Re: Using Apex Drawloop API - Unable to create documents using DDP

Hi Priyanka,

 

Your code seems to be just fine, and this should run with no issue using Execute Anonymous. My guess is that this could be an issue with the DDP setup. I would open a support case with support@nintex.com, and they'll be able to look into your configuration more thoroughly, and check to see if you are getting any errors.

0 Kudos
Reply