Hi Community!
I recently updated our iOS app configuration to include a sound for when delivering push messages. This works fine for when I create new deliveries, BUT. We have several continuous deliveries running, where the available sound drop-down is not visible to me. So in order to fix that, apparantly I need to create entirely new deliveries, which seems like a waste of time.
So I thought I might as well try to update the values through either
However, I can not choose and update this field from mass update or update activity since it is simply not present for me to choose and update. I am also unsure how I can update this field using JS or SQL. I haven't been succesful yet. Any help in regards to how I can update that 1 field for multiple deliveries would be greatly appreciated!
Visible from generic query editor:
Not visible from update element in workflow:
Solved! Go to Solution.
Views
Replies
Total Likes
Hi @SorenDP
this information is not stored an independent field in database but in a XML field.
You can reach this XML via JS, locate your field in a tree, make an update and save XML back to database.
You can select all deliveries in the standard query and pass their primary keys to JS node for an update.
Below is code example to update the bounce email in the delivery. Just adapt it for you needs.
var query = xtk.queryDef.create(
<queryDef schema={vars.targetSchema} operation="select">
<select>
<node expr="@id"/>
</select>
</queryDef>);
var result = query.ExecuteQuery();
for each (var record in result) {
try {
var delivery = NLWS.nmsDelivery.load(record.@id);
delivery.mailParameters.bounceAddress = 'custom@email.com';
delivery.save()
logInfo ('Succesfull for template: '+record.@id)}
catch (e){
logInfo('Error with template: '+record.@id +' with error: '+e)}
}
Cheers,
Milan
Views
Replies
Total Likes
Hi @SorenDP
this information is not stored an independent field in database but in a XML field.
You can reach this XML via JS, locate your field in a tree, make an update and save XML back to database.
You can select all deliveries in the standard query and pass their primary keys to JS node for an update.
Below is code example to update the bounce email in the delivery. Just adapt it for you needs.
var query = xtk.queryDef.create(
<queryDef schema={vars.targetSchema} operation="select">
<select>
<node expr="@id"/>
</select>
</queryDef>);
var result = query.ExecuteQuery();
for each (var record in result) {
try {
var delivery = NLWS.nmsDelivery.load(record.@id);
delivery.mailParameters.bounceAddress = 'custom@email.com';
delivery.save()
logInfo ('Succesfull for template: '+record.@id)}
catch (e){
logInfo('Error with template: '+record.@id +' with error: '+e)}
}
Cheers,
Milan
Views
Replies
Total Likes
Thank you very much @Milan_Vucetic !
This was exactly what I was looking for. It seems to have solved the underlying issue and I now have sounds on our iOS push messages - Awesome!
If anyone sees this post and face the same issue, I used this code:
var query = xtk.queryDef.create(
<queryDef schema="temp:query3" operation="select">
<select>
<node expr="@id"/>
</select>
</queryDef>);
var result = query.ExecuteQuery();
for each (var record in result) {
try {
var delivery = NLWS.nmsDelivery.load(record.@id);
delivery.content.iosSound.source = 'default';
//delivery.content.iosAvailableSounds.source = 'default';
delivery.save()
logInfo ('Succesfull for template: '+record.@id)}
catch (e){
logInfo('Error with template: '+record.@id +' with error: '+e)}
}
Views
Replies
Total Likes
Views
Likes
Replies