Skip to main content

Notifications

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...

  • Suggested answer
    Diogo_STMonteiro Profile Picture
    on at
    RE: PostCustomerAddTrigger is not working while adding customer to transaction

    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.

  • Pankaj_93 Profile Picture
    396 on at
    RE: PostCustomerAddTrigger is not working while adding customer to transaction

    Hi Rizwan,

    Thank you very much for your response.

  • Suggested answer
    CU03061412-0 Profile Picture
    2 on at
    RE: PostCustomerAddTrigger is not working while adding customer to transaction

    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();

       }

  • Ramune Profile Picture
    on at
    RE: PostCustomerAddTrigger is not working while adding customer to transaction

    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.

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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Supply chain | Supply Chain Management, Commerce

#1
Zain Mehmood Profile Picture

Zain Mehmood 462 Moderator

#2
Danny Bilodeau Profile Picture

Danny Bilodeau 156 Moderator

#3
Laurens vd Tang Profile Picture

Laurens vd Tang 120 Super User 2025 Season 1

Featured topics

Product updates

Dynamics 365 release plans