Skip to main content
Solved

sales quotation released by document

  • October 29, 2020
  • 4 replies
  • 249 views

Forum|alt.badge.img+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

Best answer by Hans Andersen

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; 

View original
Did this topic help you find an answer to your question?

4 replies

Forum|alt.badge.img+14
  • Hero (Partner)
  • 241 replies
  • October 30, 2020

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;


Forum|alt.badge.img+4
  • Author
  • Do Gooder
  • 6 replies
  • October 30, 2020

Hi Hans,

I can't get it to work.

See below the event, and event action.

What am i missing?

 

 


Forum|alt.badge.img+14
  • Hero (Partner)
  • 241 replies
  • Answer
  • November 1, 2020

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; 


Forum|alt.badge.img+4
  • Author
  • Do Gooder
  • 6 replies
  • November 18, 2020

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


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings