Skip to main content
Question

Custom Event based on two tabs


Forum|alt.badge.img+1
  • Do Gooder (Customer)
  • 1 reply

Hi, 

My requests concerns IFS V8. 

I would like to create an event preventing users to create a an Advance Supplier Invoices when they choose a specific VAT Code. 

 

The 2 datas are accessible on two different tabs : 

  • Advance Invoice : INVOICE_TAB
  • VAT Code : INVOICE_ITEM_TAB

For now, i didn’t found a way to create an event based on two differents tabs. 

Is it possible, if it’s the case could you give me some details on how to perform it ? 

 

Thanks in advance :)

 

Best Regards, 

4 replies

asahin
Do Gooder (Customer)
Forum|alt.badge.img+4
  • Do Gooder (Customer)
  • 21 replies
  • August 12, 2024

Hello;

It is very easy if it is IFS Cloud, but I think you can do it by creating a trigger in PLSQ. Or you can edit the procedure that performs the operation in the relevant API.


Marcel.Ausan
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • 1142 replies
  • August 12, 2024

@IFSAD since you are monitoring the VAT Code in Invoice Item, I think you could easily throw an error message by creating a Custom Event on INVOICE_ITEM_TAB and monitoring the VAT Code columns for the incorrect values.

BEGIN

     Error_SYS.Record_General('InvoiceItem','WrongVATCode: You are not allowed to create an invoice item with this VAT Code.' );

END;

However, I guess this would mean that the Invoice header will be created anyways and then what you are stopping is the invoice line creation. Then if needed and no other invoice lines exist I guess you could call invoice_api.remove_ function to delete the already created invoice header.


Forum|alt.badge.img+1
  • Author
  • Do Gooder (Customer)
  • 1 reply
  • August 12, 2024

@Marcel.Ausan Hi Marcel, 

 

Thanks for your reply, indeed this works but in my case i would like to add a second condition when the flag “Advance Invoice” is flagged in the header of the supplier invoice (TAB “INVOICE_TAB”). 


Marcel.Ausan
Ultimate Hero (Partner)
Forum|alt.badge.img+22
  • Ultimate Hero (Partner)
  • 1142 replies
  • August 13, 2024

@IFSAD then before throwing the error message you should define a cursor that would be a select from invoice_tab checking for the advance invoice flag. Then you would open the cursor and if the advance_invoice flag = true then trigger the error, else null.


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