Baanboard.com

Go Back   Baanboard.com > Forum > Baan Quick Support: Functional & Technical > Tools Administration & Installation

User login

Frontpage Sponsor

Main

Poll
As a Customer What would do to keep your ERP Implementation intact
Proactively define Business Process-- Take the Project Ownership
50%
Handover everything to System Integrator from drawing BP till implementation of ERP
13%
Hire more inhouse skilled & capable IT Resource to work directly with SI
38%
Rely on SI Architects/Consultants
0%
Total votes: 8

Baanboard at LinkedIn


Reference Content

Reply
 
Thread Tools Display Modes
  #1  
Old 28th March 2019, 18:07
amit.mahajan amit.mahajan is offline
Junior Member
 
Join Date: Feb 2010
Posts: 3
amit.mahajan is on a distinguished road
Baan: fp2 - DB: Sql srever 2005 - OS: windows 2003
Purchase Order Approval Process
Baan: ERP LN 6.1 FP10 (Infor ERP 10.4)
DB: SQL Server 2016
OS: Windows 2008
C/S: Both

Hi
I want to control user's action on purchase order approval process. My requirement is if if user will create new order they can approve it as it has "Created" status. Once it is approved and if they will any change in the order its status will change to "Modified". Now, they can't approve it. It will approve then by their superior or any other person who has full control because order will be revision number now. After that authority's satisfaction he/she will approve the order.
How, it can be achieved? Please help.

Regards
Amit Mahajan
Reply With Quote
  #2  
Old 2nd April 2019, 16:55
Ajesh's Avatar
Ajesh Ajesh is offline
Guru
 
Join Date: Feb 2009
Posts: 650
Ajesh is on a distinguished road
Baan: LN 10.4 - DB: Oracle - OS: HP-Unix
Which is your LN Version? You can achieve it through User Exit or Extensibility...
Reply With Quote
  #3  
Old 3rd April 2019, 05:54
amit.mahajan amit.mahajan is offline
Junior Member
 
Join Date: Feb 2010
Posts: 3
amit.mahajan is on a distinguished road
Baan: fp2 - DB: Sql srever 2005 - OS: windows 2003
Hi,
Thanks for reply!!!
We are using LN 10.4
Reply With Quote
  #4  
Old 3rd April 2019, 13:56
Ajesh's Avatar
Ajesh Ajesh is offline
Guru
 
Join Date: Feb 2009
Posts: 650
Ajesh is on a distinguished road
Baan: LN 10.4 - DB: Oracle - OS: HP-Unix
Then in User Exit, you can check the Old Status of the PO and the compare it with the new status. If the Old status is Modified and the new status status is approved, and the user who is approving it is not authorized to do so, you have to dal.set.error.message saying the User is not authorized to do so.

You can do it ,before,before.save,after.before.save,before.after.save sections.
Reply With Quote
  #5  
Old 10th March 2020, 14:38
saenzh saenzh is offline
Junior Member
 
Join Date: May 2019
Posts: 18
saenzh is on a distinguished road
Baan: LN 10.5 - DB: Oracle - OS: Windows 10
Hi, I'm trying to do something similar with a user exit but I'm relatively new to programming so I cannot figure it out. Btw I'm on LN FP5.

I'm trying to make the 'Requested Date' for purchase requisition lines a mandatory field if blank. When I compile the compiler says my function is ignored. Do I need to call the requisition lines session in my script somehow?

My code is as follows:

Here I create a function that is called if the 'Requested Date' field is blank:

function extern long ue.after.before.save.object(long mode)
{
on case mode
case DAL_NEW:
break
case DAL_UPDATE:
break
endcase
| return(0)

if tdpur201.dldt = 0 then
tdpur201.dldt.is.mandatory()
endif
return(0)

}

This is the function that is called:


function extern boolean tdpur201.dldt.is.mandatory()
{
if tdpur201.dldt = 0 then
dal.set.error.message("tdpur20100")
|||Enter a "Requested Date"
return(true)
endif
return(false)
}


Last edited by saenzh : 10th March 2020 at 14:39. Reason: Including LN version.
Reply With Quote
  #6  
Old 10th March 2020, 16:19
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,479
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
1. You need to code the logic in before.before.save.object().
2. You need to put the validations in DAL_NEW for new record validation
3. You need to put the validation in DAL_UPDATE for record modifications
4. You need to return DALHOOKERROR for failed validations

Try this -

Code:
table ttdpur201                                                                            
#include <bic_dal>


function extern long ue.before.before.save.object(long mode)
{
	on case mode
	case DAL_NEW:
			if tdpur201.dldt = 0 then 
				dal.set.error.message("@Requested Date is Mandatory")
				return(DALHOOKERROR)
			endif
		break
	case DAL_UPDATE:
			if tdpur201.dldt = 0 then
				dal.set.error.message("@Requested Date is Mandatory")
				return(DALHOOKERROR)
			endif
		break
	endcase
	return(0)
}

The compiler is giving you that Warning because you have not utilized the return value of your function.

You can use something like the following code in before.before.save.object under DAL_NEW and DAL_UPDATE-

Code:
if  tdpur201.dldt.is.mandatory() then
     return(DALHOOKERROR)
else
     return(true)
endif
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
  #7  
Old 11th March 2020, 00:55
saenzh saenzh is offline
Junior Member
 
Join Date: May 2019
Posts: 18
saenzh is on a distinguished road
Baan: LN 10.5 - DB: Oracle - OS: Windows 10
Thank you Bhushan that worked!

Now the issue is when I tab through the purchase requisition lines session I get the error message indicating to enter the Requested Date field but the field auto populates with the current date.

How do I keep the field blank until the user enters the date?
Reply With Quote
  #8  
Old 11th March 2020, 06:45
bhushanchanda's Avatar
bhushanchanda bhushanchanda is offline
Guru
 
Join Date: Sep 2012
Location: India
Posts: 2,479
bhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura aboutbhushanchanda has a spectacular aura about
Baan: LN FP 1-9, 10.4, a little bit of Baan IV - DB: SQL Server 2008, Oracle - OS: Windows Server 2008 R2, Unix
Hi,


Handling field properties cannot be done in UserExits. Also, I just checked, the table definition shows (atleast for me) that this field is already a mandatory field at table level hence will always have a value.

You may need a wrapper script to do what you are looking for but UE may not help here.
__________________
Regards,

Bhushan

Unless you try to do something beyond what you have already mastered, you will never grow!
Reply With Quote
Sponsored Links
  #9  
Old 12th March 2020, 13:19
saenzh saenzh is offline
Junior Member
 
Join Date: May 2019
Posts: 18
saenzh is on a distinguished road
Baan: LN 10.5 - DB: Oracle - OS: Windows 10
Ok thank you Bhushan. I don't know what a wrapper is right now but I will keep learning and try to solve this problem.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Purchase Order Approval SMORES Distribution, Transportation & Warehousing 2 17th January 2013 14:31
Payment term at Purchase Order teddybear Distribution, Transportation & Warehousing 0 20th September 2005 07:10
purchase order balance srikarthy Distribution, Transportation & Warehousing 4 14th July 2005 00:39
Subcontracting Purchase Order LittleJohn Manufacturing & Supply Chain 3 30th May 2005 05:01
Traceability of Purchase Invoices after running Process Delivered Purchase Orders Neal Matthews Finance, Invoicing and Integration 15 27th November 2001 12:12


All times are GMT +2. The time now is 11:15.


©2001-2020 - Baanboard.com - Baanforums.com