web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Supply chain | Supply Chain Management, Commerce
Answered

PostCustomerAddTrigger is not working while adding customer to transaction

(0) ShareShare
ReportReport
Posted on by 396

Dear Community,

I am trying to display one dialogue after adding the customer to the tansaction. Unfortunately, the PostCustomerAddTrigger is not calling on the customer add to sale operation.

Can anyone please let us know, how can we proceed?

Thank you in Advance...

I have the same question (0)
  • Ramune Profile Picture
    on at

    Hi Pankaj,

    As this question is related to the code change, I will leave it for the community to answer. Let's see if anybody has experienced the same and can advise for you anything.

  • Suggested answer
    CU03061412-0 Profile Picture
    2 on at

    Hi Pankaj,

    Yes, it doesn't work for number of years and till now. We can handle it by using the "PostOperationTrigger" for the same affect and it should help out.

    Here is sample solution for it.

    Please do test based on your needs

    import * as Triggers from "PosApi/Extend/Triggers/OperationTriggers";

    import { ObjectExtensions, StringExtensions} from "PosApi/TypeExtensions";

    import { ClientEntities, ProxyEntities } from "PosApi/Entities";

    export default class PostOperationTrigger extends Triggers.PostOperationTrigger {

       /**

        * Executes the trigger functionality.

        * @param {Triggers.IPostCustomerAddTriggerOptions} options The options provided to the trigger.

        */

       public execute(options: Triggers.IPostOperationTriggerOptions): Promise<void> {

           if (ObjectExtensions.isNullOrUndefined(options) === false) {

               let operationId: ProxyEntities.RetailOperation = options.operationRequest.operationId;

               let isPostSetCustomerOperation: boolean = operationId === ProxyEntities.RetailOperation.SetCustomer;

               if (isPostSetCustomerOperation == true) {

                         //do your logic here...

                 }

               return Promise.resolve();

           }

           return Promise.resolve();

       }

  • Pankaj_93 Profile Picture
    396 on at

    Hi Rizwan,

    Thank you very much for your response.

  • Suggested answer
    Diogo_STMonteiro Profile Picture
    on at

    Yes, you are right this Customer trigger is only triggered when a new customer is created and added to the cart/sale, so yes, its working as expected.

    If you want a trigger when customer is added to a cart, please use PreCustomerSetTrigger.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 301 Super User 2025 Season 2

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 118 Super User 2025 Season 2

#3
Siv Sagar Profile Picture

Siv Sagar 105 Super User 2025 Season 2

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans