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

Announcements

News and Announcements icon
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
    Microsoft Employee 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
    Microsoft Employee 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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Laurens vd Tang Profile Picture

Laurens vd Tang 88 Super User 2026 Season 1

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 77 Super User 2026 Season 1

#3
Sagar Suman Profile Picture

Sagar Suman 64 Super User 2026 Season 1

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans