Posts

Showing posts with the label Java Script

Campaign classic sequence of execution of different Javascript Code Bloc inside a workflow delivery

Image
 Every time I have to add some advanced JS code inside Delivery I am confused about the sequence of JS. When it comes to Delivery, then there are multiple places where you can write the JS  Right Click on Delivery > Open > Go to Script Tab  Right Click on Delivery > Open > Go to Advanced Tab Typology Rule of type Control There are many phases where the rule will be run. I was trying to run the rule as much late as possible and thus had chosen "At the end of the analysis" Ignoring the option of adding JS code inside the Routing External account > Connector and Post processing workflow as I didn't run that Here is the result While the delivery is waiting at "Approve Targeting" , the log for the recurring delivery activity at workflow level looks like below The delivery log looks like below for the Typology Rules Note: At this stage the broadlog is not created and that makes sense as the Targeting is not approved yet While the  delivery is waiting at...

Base 64 Encoding using Adobe Campaign Standard

 For one of the integration we had to do the base64 encoding using ACS and it was not that easy initially with the existence of the "MYTH" that ACS doesn't support JavaScript. Here is the code where I declared a class Converted inside a Content Block (it has to be block, not fragment) named "cbBase64EncodeLib" Note this process is only applicable if you have to use the encoded output inside email, it will not work if you need to save the value in a table <% var Converter ={         _keyStr : "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",         hexToBase64: function(hex) {             //var str = Converter.hexToString(hex);             //return Converter.base64Encode(str);             var hexStr = hex.toString(); //force conversion             var binary = "";           ...

Call stored procedure from Adobe Campaign Classic

Image
One member of our team working on a different project asked me if there is a way to call Stored Procedure from Adobe Campaign Classic workflow. He was looking to get an option to receive an output parameter also. So I thought of trying a POC and here is the outcome. In my local instance I had Sql Server and thus thought about testing few other sql server specific features Step 1: Create a basic stored procedure ALTER PROCEDURE USP_GetRecipient     -- Add the parameters for the stored procedure here     @ageGreaterThan int = 0,     @state Varchar(20) = '',     @totalRows int OUTPUT AS BEGIN     SET NOCOUNT ON;        SELECT @totalRows = Count(1) from NmsRecipient r;     SELECT iRecipientId,sEmail from NmsRecipient r where [dbo].[YearsDiff](GETDATE(),r.tsBirth) > @ageGreaterThan and sStateCode = @state     Select top 10 iOfferId,sName from NmsOffer where...