cancel
Showing results for 
Search instead for 
Did you mean: 

Prevent past date entry on the delivery date field

Former Member
0 Kudos

Hi Guys,

I was wondering whether it is possible within standard SAP Business one 8.8 to prevent users from entering past date in the delivery date field on the Sales order screen. I have people making mistakes by entering 10/10/2010 instead of 10/10/2011. This caused problems with reports etc..

Is there a formatted search query i can create to warn/alert users with a message stating incorrect date entered? Please advice best course of action?

Regards

nick

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Nic.......

You can do this by two ways........

You can either stop users to do previous year entry by Locking the Last Year Posting Period or you may create a SP Transaction Notification to restrict so that you can never ever do entries in previous Year.........

Regards,

Rahul

Former Member
0 Kudos

HI Raul,

How can i create a SO Transaction Notification to restrict so that you can never ever do entries in previous Year?

Former Member
0 Kudos

Hi,

Try:

IF @object_type = '17' and @transaction_type = 'A'

BEGIN

IF EXISTS (SELECT T0.DocEntry

FROM dbo.ORDR T0 INNER JOIN RDR1 T1 ON T1.DocEntry=T0.DocEntry

WHERE DateDiff(YY,T1.ShipDate, GetDate())>0 AND T0.DocEntry = @list_of_cols_val_tab_del)

BEGIN

select @error = 17,

@error_message = 'You are not allowed to post to previous year.'

END

END

Thanks,

Gordon

Former Member
0 Kudos

Hi Gordon,

I have tried to add this query to a Formatted search and i am receiving an error message:

1). [Microsoft][SQL Server Native Client 10.0][SQL Server]Must declare the scalar variable "@object_type".

2). [Microsoft][SQL Server Native Client 10.0][SQL Server]Must declare the scalar variable "@list_of_cols_val_tab_del".

3). [Microsoft][SQL Server

Former Member
0 Kudos

This is not a FMS query but the SQL code to add to SP TransactionNotification.

Former Member
0 Kudos

Hi

There is a procedure in SQL , paste the query Given by Gordon over there, it will automatically block the user if they select wrong date.

Regards

former_member445201
Participant
0 Kudos

Hi,

I have added the query on to the Stored Precedures on the SQL management studio under Programmability> stored precedures. I have created a new query and saved it under this location. It still allows me to add the sales order with previous date under the delivery date field.

Is the above steps correct? I have done this on my test database as i was not too sure on what to do..

former_member196081
Active Contributor
0 Kudos

Hi,

code given by Gordon will apply on following path..

Go to SQL Server>>Select Database>>Programmibility>>Stored Procedure>>Select SBO_SP_TransactionNotification>>Right Click>>Select Modify>> Paste Given Code Here(Under Add code Here Row)

former_member445201
Participant
0 Kudos

Deepak,

The following code is already in this section? Can i just add Gordon query below the last "END" statement?

-- ADD YOUR CODE HERE

declare @islocked int

select @islocked = 0

if(@object_type = '17' and @transaction_type <> 'A')

select @islocked = U_LockedForEdit from [@A1WMS_Staging] where U_objType = '17' and U_docEntry = @list_of_cols_val_tab_del

if(@object_type = '22' and @transaction_type <> 'A')

select @islocked = U_LockedForEdit from [@A1WMS_Staging] where U_objType = '22' and U_docEntry = @list_of_cols_val_tab_del

if(@object_type = '202' and @transaction_type <> 'A')

select @islocked = U_LockedForEdit from [@A1WMS_Staging] where U_objType = '202' and U_docEntry = @list_of_cols_val_tab_del

if(@islocked <> 0)

begin

select @error = 999

select @error_message = 'Order Cannot be Updated/Canceled/Deleted as it is Locked in WMS'

end

former_member196081
Active Contributor
0 Kudos

Hi,

Paste the code above following line....

-- Select the return values

select @error, @error_message

end

former_member218051
Active Contributor
0 Kudos

Hi Nick,

You have to add the SP_TN under

Programmability -


> Stored Procedure -


> SBO_SP_TransactionNotification -


>

Right Click -


> Modify

And paste the code given by Gordon below

"ADD YOUR CODE HERE"

Thanks

Malhaar

Answers (1)

Answers (1)

jitin_chawla
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

Are all your postings complete for the year 2010? If yes, then have you not set the period to 'LOCKED' under the posting period window?

Kind Regards,

Jitin

SAP Business One Forum Team

Former Member
0 Kudos

Hi Jitin,

All 2010 period codes under administrator > system initialisation > Posting periods has the closing period under Period status. We closed all period from previous months.

I want to prevent users entering previous dates only on the delivery date as we have a warehouse management application called Accellos which works on the delivery date field.

jitin_chawla
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

The implications of different Posting Period Status.

When Posting Period status is set as:

Locked

Any data entry or journal entry will be disabled for all users. The functionality corresponds to the combination of field values 'Active' = No, 'Locked' = Yes from the previous versions.

Unlocked

Data or journal entry can be entered by authorized users in this period. The functionality corresponds to the combination of field values 'Active' = Yes, 'Locked' = No from the previous versions.

Unlocked Except Sales

Data and journal entry can be entered by authorized users within all document types except any sales document.

Work under this period status is allowed only for those users who have assigned 'Full Authorization' in General Authorizations form -> General group -> Period Status: Unlocked Except Sales.

Closing Period

Data entry and journal entry can be performed by authorized users within all document types.

Work under this period status is allowed only for those users who have assigned 'Full Authorization' in General Authorizations form -> General group -> Period Status: Closing Period.

So this means that data entry can be performed in all documents types by authorized user.

Please check the authorization.

Kind Regards,

Jitin

SAP Business One Forum Team

Former Member
0 Kudos

Hi Jitin,

I have done this and it seems to warn the user

"In "Due Date" field, enter date that is equal to or later than posting date"

This is good however if i ignore this message and proceed with the sales order it will add the SO onto the system. Can i prevent the user from add the order?

jitin_chawla
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

I think i found out what you are looking for.

Go to the

Administration > System Initialization > Document Settings > General Tab and

check the working of following check box :

Block documents with earlier Posting Date

You can over-ride this condition if you check for Per Document tab in the Document Settings as well.

Check if this is what you are looking for.

Kind Regards,

Jitin

SAP Business One Forum Team

Former Member
0 Kudos

Hi Jitin,

I have ticked Block documents with earlier Posting Date > logged out of SAP and back in. It still allow me to complete the SO??? It did nothing new than previously

jitin_chawla
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,

Have you checked with other documents?

This is what I have found on Online Help (F1) for the checkbox :


Block Documents with Earlier Posting Date 

Select to block the posting process of the documents that creates automatic accounting journal entries (invoice, credit memo, deposit, and payment documents).
 

Sales Order do not create a Journal Entry. Check the same thing with Purchase Order. PO also does not create a JE.

Kind Regards,

Jitin

SAP Business One Forum Team