Skip to main content

Dear Community,

We are using IFS version 8.We are performing Gate out of invoices regularly.While creating invoice through load list user need to create Gate pass request after “Delivered” state of Load list.Many time we have observed that user misses this step and performs Create Invoice step and invoice get created for this load list.

But when this same invoice we are going to Gate Out due to non availability of Gate pass requests Gate out not possible.So Each time we need to search that Load list and create the Gate pass request and confirm it.It takes lot of time of Gate out person.

So can we restrict creation of invoice if Gate pass request is not created for that invoice.

I have tried it by creating the following trigger but its not working.

Requesting help of the exerts(Hero) here…!!!

***************************************************************************************

CREATE TRIGGER LOADLIST
BEFORE INSERT OR UPDATE ON cust_order_load_list_tab
FOR EACH ROW

WHEN (NEW.CONTRACT='PPR01')

DECLARE


CURSOR C1 IS
SELECT COUNT (*) FROM C_GATE_PASS_REQUEST_CO_LL T
WHERE T.contract='PPR01'
AND T.state='Inspected'
AND T.load_id=:NEW.load_id;


cnt_ NUMBER;

BEGIN

      OPEN C1;
      FETCH C1 INTO cnt_;
      CLOSE C1;
     
      IF NVL(CNT_,0) = 0 THEN
      ERROR_SYS.RECORD_GENERAL('CGatePassRequest','ERRORLOADLIST: Please create and confirm Gate Pass Request before proceeding . Please check with admin. Error Through trigger INVNETORY_PART_05082020. ',:NEW.PART_NO );
      END IF;

END;

***********************************************************************************************

Regards

Deepak Navale

 

 

hi @Deepak 

I’m not really familiar with creating triggers directly - we recommend using events through IFS. But, that aside:

Maybe you need a colon : in front of NEW.CONTRACT in line 5?

I guess that you are just not seeing any error - 

I would try putting another error message at the end, after the END IF; - that can tell you whether the logic is running, and the cursor is returning 0, or >0, or the script is not running at all…

 

Something like 

 ERROR_SYS.RECORD_GENERAL('CGatePassRequest','value in cnt is ' || cnt_);


Aside:

It’s best to avoid putting something like ERRORLOADLIST: at the start of a custom error message.  IFS interprets a group of capital letters followed by a : as text that should be translated, so you can get some weird results :sweat_smile:


Reply