Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

How to validate payments?

(0) ShareShare
ReportReport
Posted on by 424

I have put some validation in the 'POS Transaction line'.'Amount in Currency' field.

I am trying to display the mode of payment while punching the payment.

I written as:

IF "Entry Type"=Rec."Entry Type"::Payment THEN 

 MESSAGE('%1',"Entry Type");

Why it is not working while punching payment in the POS.

I noticed no validation works if we are punching payments. Validation works perfect if we punch item.

How to validate payments?

Regards,

Abdul.

*This post is locked for comments

  • Verified answer
    AbduTeeyech Profile Picture
    424 on at
    RE: How to validate payments?

    Hi Amol,
    I did that, but no hope. and, we are not using lots. ours is fashion retail.

    However, now I fixed that problem.

    I put validation in the POS Trans. Line.insert trigger, to check for the Amount in currency field.
    It works.

    dynamics-nav.jpg

    Abdul,

  • Verified answer
    Amol Salvi Profile Picture
    18,694 on at
    RE: How to validate payments?

    Hi Abdul,

    You need to write code on that field where the lot no/batch no field is entered/scanned

    Write a code as below on OnValidate trigger on LotNo/Batch No

    VALIDATE("Amount in Currency);

    VALIDATE(Quantity);

    So whenever lot no get scan the onvalidate trigger will get fired and in context of that the Amount in Currency onvalidate trigger will also get fired.

    Hope this helps

  • AbduTeeyech Profile Picture
    424 on at
    RE: How to validate payments?

    when we scan item from Point of Sale. LS Retail (v7.1.36).

  • Verified answer
    Tharanga Chandrasekara Profile Picture
    23,116 on at
    RE: How to validate payments?

    What you mean by punching from POS?

  • AbduTeeyech Profile Picture
    424 on at
    RE: How to validate payments?

    Hi Tharanga,

    When I manually try to change 'Amount In Currency' field inside the 'POS Trans. Line'

    table, the trigger fires.

    But, why it is not firing when I punch from POS?? that too exists only when punching payments?

  • Verified answer
    Tharanga Chandrasekara Profile Picture
    23,116 on at
    RE: How to validate payments?

    Thank you for the screenshots. Is the first message box in the "Amount In Currency" get execute? If it is not getting executed then it is a bit problem, because no matter your conditions first message box should execute at the time of you stop typing anything in the "Amount in Currency" field and move out of it.

  • AbduTeeyech Profile Picture
    424 on at
    RE: How to validate payments?

    Hi Tharanga/ Amol,

    Below is the screen shot of 'Amount In Currency' on validate.

    Qty-Valdn.jpg

    And, below  message I put in 'Quantity - OnValidate()', also NOT displaying while punching the 'Payments' in the POS. And it displays if I punch an 'item' in the POS.

    Qty-Valdn.jpg

    Regards,

    Abdul.

  • Suggested answer
    Amol Salvi Profile Picture
    18,694 on at
    RE: How to validate payments?

    Hi Abdul,

    Where you have written code  ?

    Is it on Page or Table  on validate trigger???

  • Verified answer
    Tharanga Chandrasekara Profile Picture
    23,116 on at
    RE: How to validate payments?

    I would add a new message box to your code to check, if the code really get execute. I think you need to debug your code and see for possible issues. Looking at your code I do not see any issue for its not getting executing.

    As I previously said in my reply, only thing I can think of is that trigger issue. If you can post a screenshot of the code where you have written and the place you actually enter the data, we will be able to provide more input to this. 

    MESSAGE('%1','Trigger execute');
    IF "Entry Type"=Rec."Entry Type"::Payment THEN 
    BEGIN
       MESSAGE('%1',format("Entry Type"));
       IF Number='11' THEN
       BEGIN
          IF "Amount In Currency" MOD 50 <> 0 THEN
             ERROR ('Amount is not divisible by 50');
       END;
    END;


  • AbduTeeyech Profile Picture
    424 on at
    RE: How to validate payments?

    Hi Nareshwar,

    even if the  'Number' is not 11, then it should at least display the message right? (  MESSAGE('%1',FORMAT("Entry Type"));  )

    In my POS Trans. Line table, the 'Entry type' is 'Payment' and 'Number' is 11.

    'POS Trans. Line' table records available in the screen shot.

    But, still the validation not working.

    Validation-error.jpg

    I can tell you another thing, that, I have put same codes inside the onvalidate of Qty. column.

    Same happens for entry-type:'payments'. For entry-type:'Items', the validation in the Qty column works good.

    Some thing smells not-normal.

    Regards,

    Abdul.

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

Daivat Vartak – Community Spotlight

We are honored to recognize Daivat Vartak as our March 2025 Community…

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Kudos to the February Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,865 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,723 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans