Solved

sales quotation released by document

  • 29 October 2020
  • 4 replies
  • 238 views

Userlevel 1
Badge +4

Hello, 

We need to use document approval for sales quotation approval. This because we have to approve the sales quotation by different users before release. 

Can someone help me with the statement to trigger the release of the sales quotation, when the connected document is released.  

The event trigger is not the problem, but the action to preform the release of the sales quotation. 

A general direction for the statement is needed . 

The document title is the same as the sales quotation number. 

 

Thanks

icon

Best answer by Hans Andersen 1 November 2020, 09:38

View original

4 replies

Userlevel 6
Badge +14

Have you tried something like this:

declare 
  info_ varchar2(32000):= null;
  objid_ varchar2(32000);
  objversion_ varchar2(32000);
  null_ varchar2(32000):=null;
begin
  
  select q.objid, q.objversion into objid_, objversion_
  from order_quotation q where q.quotation_no=&new:xxxxxx;
  
  ORDER_QUOTATION_API.RELEASE__( info_ , objid_ , objversion_ , null_ , 'DO' );
  
end;

Userlevel 1
Badge +4

Hi Hans,

I can't get it to work.

See below the event, and event action.

What am i missing?

 

 

Userlevel 6
Badge +14

try with this:

declare 
  info_ varchar2(32000):= null;
  objid_ varchar2(32000);
  objversion_ varchar2(32000);
  null_ varchar2(32000):=null;
  pragma autonomous_transaction; 
begin
  
  select q.objid, q.objversion into objid_, objversion_
  from order_quotation q where q.quotation_no=doc_title_api.Get_Title('&NEW:DOC_CLASS', '&NEW:DOC_NO');
  
  ORDER_QUOTATION_API.RELEASE__( info_ , objid_ , objversion_ , null_ , 'DO' );

  commit;  

end; 

Userlevel 1
Badge +4

Hi Hans,

Thanks for pointing us i the right direction, it's working great. 

We only had to set a extra condition on the condition for performing the action to prevent it from triggering on every release. 

 

Again thanks 

Reply