Add notifications on SalesOrders

The 1C:Enterprise developers forum

#1
People who like this:0Yes/0No
Active user
Rating: 8
Joined: Oct 15, 2024
Company:

Add notifications on SalesOrders.
In Document SalesOrder, in DocumentForm.
When create Sales Order and then click button Post, a notification appears when The consumer has an SalesInvoice whose payment status is overdue. After that, button Post and Generate can't be click. (Button become readonly).

 
#2
People who like this:0Yes/0No
Administrator
Rating: 32
Joined: Oct 3, 2019
Company:

Dear Gigha,

in 1C it works a little differently. We can't block the Post button (well, it's possible, but it's not done that way), and all checks are usually performed during the process when the user tries to write a document.

For example, the "BeforeWrite" procedure in the object module is perfect for performing such checks (see screenshots)

Download 1.png (8.87 KB)
Download 2.png (45.69 KB)
 
#3
People who like this:0Yes/0No
Active user
Rating: 8
Joined: Oct 15, 2024
Company:

Quote
Dear Gigha,

in 1C it works a little differently. We can't block the Post button (well, it's possible, but it's not done that way), and all checks are usually performed during the process when the user tries to write a document.

For example, the "BeforeWrite" procedure in the object module is perfect for performing such checks (see screenshots)

I create a new sales order. The customer name in the sales order is Pleer Düsseldorf. After that, I click "Post" or "Generate." If Pleer Düsseldorf has a sales invoice with an overdue payment status, a notification appears. After that, the "Post" and "Generate" buttons become read-only and cannot be clicked. How I can I do that?

 
#4
People who like this:0Yes/0No
Administrator
Rating: 32
Joined: Oct 3, 2019
Company:

Quote
Gigha wrote:
After that, the "Post" and "Generate" buttons become read-only and cannot be clicked. How I can I do that?

In short - no way.

The check for the user having unpaid payments should be performed at the time of document posting (or at the time of recording). If there is an overdue payment - then we do "Cancel = True" and Post (or Write) procedure is not performed.

There is another option for doing such a check: when the user selects a Customer, at this moment the program can check if this Client has overdue payments and issue a message to the user.

 
#5
People who like this:0Yes/0No
Active user
Rating: 8
Joined: Oct 15, 2024
Company:

Quote
There is another option for doing such a check: when the user selects a Customer, at this moment the program can check if this Client has overdue payments and issue a message to the user.

How can I implement this option?

 
#6
People who like this:0Yes/0No
Administrator
Rating: 32
Joined: Oct 3, 2019
Company:

Please look at the screenshots.

This is an example from 1C:Drive. When selecting a counterparty, the "ProcessCounterpartyChange" procedure is triggered, which performs various necessary checks. This is where you can insert the functionality you need.

Download 1.png (109.25 KB)
Download 2.png (64.93 KB)
 
Subscribe
Users browsing this topic (guests: 1, registered: 0, hidden: 0)
Be the first to know tips & tricks on business application development!

A confirmation e-mail has been sent to the e-mail address you provided .

Click the link in the e-mail to confirm and activate the subscription.