Question

Push notifications not triggering when GI has condition on custom field

  • 19 January 2024
  • 11 replies
  • 107 views

Userlevel 4
Badge

We’ve had a push notification which has been working for quite some time, and then a couple of months ago, it simply stopped firing/triggering push notifications.

After some investigation, it appears that when you make use of a custom field in the conditions tab of the GI that’s being monitored, it simply doesn’t trigger. 

To test my theory, I set up a super basic GI and managed to get push notifications to go through to https://webhook.site/

However, as soon as I add a custom field into the condition tab of the same GI, the push notifications no longer trigger. 

 

Based on this test, it looks like custom fields are no longer supported. We recently upgraded to the version 23.112.0032. 

Is anyone else aware of this change, and what options do I have to trigger push notifications based on a custom field on the SOOrder changing?


11 replies

Userlevel 7
Badge +11

Hi @chris49 ,

For the SOOrder.SBStatus condition, you assigned the Contact.Customer. Is this correct?

If you view the inquiry, are you able to fetch the data?

Userlevel 4
Badge

Hey @jinin , yes, I am indeed able to fetch the information. Note that SBStatus is a field on the order, not on the contact/customer.

Userlevel 7
Badge +11

Could you please export the GI as XML and share it?

Userlevel 4
Badge

Hi @jinin , please find attached.

Many thanks

Userlevel 7
Badge +11

Hi @chris49 ,

I created a field on the SOScreen and tested it, and it worked for me. I've included a sample customization package with a custom field, GI, and push notification. Please review, and feel free to reach out if you have any questions.

Userlevel 4
Badge

Hi @jinin ,

Thank you kindly. I will try this out on a test environment, and have a look at the differences. I’m still quite a bit dumbfounded by this, as this used to work perfectly fine, and just stopped all of a sudden. 

I will revert with some feedback soon.

Thanks

Userlevel 4
Badge

Hey @jinin ,

Awesome, so I tested your version, and indeed it works. I wasn’t sure if this makes a difference, but I do not add my custom fields directly onto the SOOrder table in the way that your install script does, instead I’ve added a custom table that links to the SOOrder table since there were quite a few fields that related to what we did to implement the functionality. 

 Attached is the customisation project that creates the custom table, and then adds the fields to the Order screen under the ‘Back Order Details’ tab. In particular, the field that I’m having an issue with is the SBStatus field, which in turn is a field that makes use of the SBSOOrderBackOrderStatus class to obtain its list of key => value pairs. 

With that being said, I now wonder whether it’s not a case of, “Push notifications are not triggering when a GI has a condition on a custom field, which is from a custom table joined to the SOOrder table”?

I’m not too sure whether you will be able to see the above-mentioned classes, etc. from the customisation script directly, so herewith are the 2 classes’ code:

using PX.Data;
using PX.Data.BQL;

namespace SBSOOrderEnhancements
{
public class SBSOOrderBackOrderStatus
{
public const string NewT = "N";
public const string NewText = "New";
public const string ContactCustomer = "C";
public const string ContactCustomerText = "Contact Customer";
public const string WaitingForCustomer = "W";
public const string WaitingForCustomerText = "Waiting for Customer Feedback";
public const string CustomerWaiting = "H";
public const string CustomerWaitingText = "Happy to Wait";

public class ListAttribute : PXStringListAttribute
{
public ListAttribute() : base(
new[]
{
Pair(NewT, NewText),
Pair(ContactCustomer, ContactCustomerText),
Pair(WaitingForCustomer, WaitingForCustomerText),
Pair(CustomerWaiting, CustomerWaitingText),
}
){ }
}

public class newT : BqlString.Constant<newT> { public newT() : base(NewT) { } }
public class contactCustomer : BqlString.Constant<contactCustomer> { public contactCustomer() : base(ContactCustomer) { } }
public class waitingForCustomer : BqlString.Constant<waitingForCustomer> { public waitingForCustomer() : base(WaitingForCustomer) { } }
public class customerWaiting : BqlString.Constant<customerWaiting> { public customerWaiting() : base(CustomerWaiting) { } }
}
}
using PX.Data;
using PX.Data.BQL;
using PX.Objects.SO;
using System;

namespace SBSOOrderEnhancements
{
[Serializable]
[PXCacheName("SilvertreeBrands Back Orders")]
[PXTable(typeof(SOOrder.orderType), typeof(SOOrder.orderNbr), IsOptional = true)]
public class SBSOOrderBackOrder : PXCacheExtension<SOOrder>
{
#region SBStatus
[PXDBString(1, IsFixed = true)]
[PXDefault("N", PersistingCheck = PXPersistingCheck.Nothing)]
[PXUIField(DisplayName = "Status", Visibility = PXUIVisibility.SelectorVisible)]
[SBSOOrderBackOrderStatus.List]
public virtual string SBStatus { get; set; }
public abstract class sBStatus : BqlString.Field<sBStatus> { }
#endregion

#region SBComment
[PXDBLocalizableString(IsUnicode = true)]
[PXUIField(DisplayName = "Comments")]
public virtual string SBComment { get; set; }
public abstract class sBComment : BqlString.Field<sBComment> { }
#endregion

#region SBETADate
[PXDBDate()]
[PXUIField(DisplayName = "ETA", Visibility = PXUIVisibility.SelectorVisible)]
public virtual DateTime? SBETADate { get; set; }
public abstract class sBETADate : BqlString.Field<sBETADate> { }
#endregion

#region SBNewDate
[PXDBDate()]
[PXUIField(DisplayName = "New", Visibility = PXUIVisibility.SelectorVisible)]
public virtual DateTime? SBNewDate { get; set; }
public abstract class sBNewDate : BqlString.Field<sBNewDate> { }
#endregion

#region SBContactCustomerDate
[PXDBDate()]
[PXUIField(DisplayName = "Contact Customer", Visibility = PXUIVisibility.SelectorVisible)]
public virtual DateTime? SBContactCustomerDate { get; set; }
public abstract class sBContactCustomerDate : BqlString.Field<sBContactCustomerDate> { }
#endregion

#region SBAwaitCustomerFeedbackDate
[PXDBDate()]
[PXUIField(DisplayName = "Waiting For Feedback", Visibility = PXUIVisibility.SelectorVisible)]
public virtual DateTime? SBAwaitCustomerFeedbackDate { get; set; }
public abstract class sBAwaitCustomerFeedbackDate : BqlString.Field<sBAwaitCustomerFeedbackDate> { }
#endregion

#region SBCustomerWaitingDate
[PXDBDate()]
[PXUIField(DisplayName = "Happy to Wait", Visibility = PXUIVisibility.SelectorVisible)]
public virtual DateTime? SBCustomerWaitingDate { get; set; }
public abstract class sBCustomerWaitingDate : BqlString.Field<sBCustomerWaitingDate> { }
#endregion
}
}

 

Userlevel 7
Badge +11

Hi @chris49 ,

I've published the package and checked, but it's not working with the SBStatus field. I will review the code and get back to you.

Userlevel 4
Badge

Hi @jinin ,

Thank you very much 🙏🏻 , looking forward to your response.

Userlevel 7
Badge

Hi @chris49 were you able to find a solution? Thank you!

Userlevel 4
Badge

Hi @chris49 were you able to find a solution? Thank you!

Good morning @Chris Hackett , 

No, not yet. I’ve logged a case with Acumatica Support, and they are investigating the matter. 

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved