Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

Change MaxRetry for specific type of sendout

Avatar

Level 2

Hello, we have three different sendout Templates: Email, SMS and a Template that uses an API to export customers to a internal page.

 

In the Delivery schema we have a default on MaxRetry = 5. This works fine with the Email and SMS, but when we do the third one we don't want any retries at all as it causes issues.

 

for each (var record in records.getElements()) 
{ 
  if(record.$deliveryChannel == 143){ 
    /*logInfo("broadLogID",record.$id);
    logInfo("broadLogStatus",record.$status);
    logInfo("deliveryId",record.$deliveryId);
    logInfo("deliveryChannel",record.$deliveryChannel);
    logInfo("msgReason",record.$msgReason);
    logInfo("msgText",record.$msgText);*/
    sqlExec("UPDATE NmsBroadLogRcp SET iStatus=$(l) WHERE iBroadLogId=$(l)", setBroadLogStatus, record.$id);
    sqlExec("UPDATE NmsDelivery SET iState=$(l) WHERE iDeliveryId=$(l)", setDeliveryStatus, record.$deliveryId);
	sqlExec("UPDATE NmsDelivery SET iMaxRetry=$(0) WHERE iDeliveryId=$(1)", setMaxRetry, record.$maxRetry);
    }     
}  

 

What I thought could be a good solution is to use the code that handles the post-processings for this specific sendout and set the MaxRetry to 0. But when I look at the delivery/execution/MaxRetry after this code is run, it is still on 5. 

 

Do you have any suggestions for a better solution or something that I should change in my code that will make this work?

Best Regards, Martin

1 Accepted Solution

Avatar

Correct answer by
Level 4

hello @MartinViking,

 

Your sqlExec is weird, to call a variable in sqlExec you have to write "$(variable type)" : 

https://experienceleague.adobe.com/developer/campaign-api/api/f-sqlExec.html?hl=sqlexec

 

In your case it should be :

 

sqlExec("UPDATE NmsDelivery SET iMaxRetry=$(l) WHERE iDeliveryId=$(l)"...

 

$(l) with the letter "L" not with the number "1"

 

The second thing that does not make sense in you query is that you match the iDeliveryId with record.$maxRetry.

It should be the record.$deliveryId.

 

you hole sqlExec should be : 

 

sqlExec("UPDATE NmsDelivery SET iMaxRetry=$(l) WHERE iDeliveryId=$(l)", setMaxRetry, record.$deliveryId);

 

 

After saying all that your solution is not going to work, because after the validation of the delivery, the maxRetry parameter no longer matters. You have to modify this parameter before the final preparation of the delivery (in a typology rule for exemple )

 

Best regards,

 

Amine

View solution in original post

3 Replies

Avatar

Correct answer by
Level 4

hello @MartinViking,

 

Your sqlExec is weird, to call a variable in sqlExec you have to write "$(variable type)" : 

https://experienceleague.adobe.com/developer/campaign-api/api/f-sqlExec.html?hl=sqlexec

 

In your case it should be :

 

sqlExec("UPDATE NmsDelivery SET iMaxRetry=$(l) WHERE iDeliveryId=$(l)"...

 

$(l) with the letter "L" not with the number "1"

 

The second thing that does not make sense in you query is that you match the iDeliveryId with record.$maxRetry.

It should be the record.$deliveryId.

 

you hole sqlExec should be : 

 

sqlExec("UPDATE NmsDelivery SET iMaxRetry=$(l) WHERE iDeliveryId=$(l)", setMaxRetry, record.$deliveryId);

 

 

After saying all that your solution is not going to work, because after the validation of the delivery, the maxRetry parameter no longer matters. You have to modify this parameter before the final preparation of the delivery (in a typology rule for exemple )

 

Best regards,

 

Amine

Avatar

Level 2

Thank you for the answer! I will look in to setting up a Typology Rule for this instead.

 

Best regards,

Martin

Avatar

Level 1

Hello,
From what I know, instances using momentum will not use the maxretry value.