Skip to main content

Hello,

I am just struggling to find the correct API for changing the state in routing alternate.

 

 

I just installed the extensino IFS cloud web devtools, but I don’t know where to look in there for called API’s???

 

Please help.

@westjan I assume you mean the PL/SQL API, right?

See below for example for changing status to Retire:

 

In DevTools - go to Combined Trace Log - filter for retire - to easily find what yopu’re looking for:

 


thanks a lot for your answer,

this is completely different call then it used to be in Apps10. 

In Apps10 i used to run this script to change the state of routing alternate:

DECLARE
   p0_ VARCHAR2(32000) := NULL;
   p1_ VARCHAR2(32000) := NULL;
   p2_ VARCHAR2(32000) := NULL;
   p3_ VARCHAR2(32000);
   p4_ VARCHAR2(32000) := 'DO';

BEGIN
    for i in (
            select * from routing_alternate where objstate = 'Tentative'
    )
    loop
        begin
            p1_ := i.objid;
            p2_ := i.objversion;    

                        
            IFSAPP.ROUTING_ALTERNATE_API.PLAN__( p0_ , p1_ , p2_ , p3_ , p4_ );
            commit;
            
            exception when others then
                dbms_output.put_line(i.part_no||' - '||sqlerrm);
                
        end;
    end loop;
END;

 

and you can even run it in IFScloud, but the behaviour is strange. 

So I am a bit confused what is the best to use for changing the state, because even this API “IFSAPP.ROUTING_ALTERNATE_API.PLAN__” exists in IFScloud!!

 

Any suggestions?

Thanks a lot


@westjan well the whole architecture changed in IFS Cloud. IFS has introduced the so called service wrapper PL/SQL packages that are called by the REST API projections. These are the %HANDLING_SVC.

These wrapper PL/SQL packages will call the ‘good old’ %_API PL/SQL packages.

If you want to use the wrapper functions in your pl/sql event action you need to set ODP_SESSION to true.

Fnd_Session_API.Set_Property('ODP_SESSION', 'TRUE');
... logic to execute your wrapper function
Fnd_Session_API.Set_Property('ODP_SESSION', 'FALSE');

See below a post where you and see an implementation example:

 


@westjan you could read more on this architecture changes here: https://docs.ifs.com/techdocs/25r1/060_development/022_user_interface/030_aurena_dev/010_aurena_overview/#ifs_cloud_web_layers

 


The API architecture has wholly changed with Aurena/IFS Cloud.

If you haven’t already looked at it, take a look at the API Explorer page, find the API you’re interested in (which you can see in your log) and then you can access both the API specification and documentation from there which includes details of all of the API functions, parameters etc. 

This is very comprehensive… I think you’ll find it useful :)

 


Thanks a lot for giving me right direction. :)

 

So i rewrite my code like that, and it is working perfectly:

DECLARE
    return_array_ Routing_Handling_SVC.Entity_Small_Drr;

BEGIN
    for i in (
            select * from routing_alternate where objstate = 'Tentative'
    )
    loop
        begin
            Fnd_Session_API.Set_Property('ODP_SESSION', 'TRUE');
    
            return_array_ := Routing_Handling_SVC.Ev_Plan('*', i.part_no, i.contract, i.routing_revision, i.alternative_no, i.bom_type_db, 'DO', routing_alternate## => '');            
            
            Fnd_Session_API.Set_Property('ODP_SESSION', 'FALSE');
            
            exception when others then
                dbms_output.put_line(i.part_no||sqlerrm);
        end;
    end loop;
END;

 

I have last 2 questions:

  1. what is the first ‘*” in  Routing_Handling_SVC.Ev_Plan. I found out in db this:
    --@PoReadOnly(Ev_Plan)
    FUNCTION Ev_Plan(etag_ IN VARCHAR2, part_no_ IN VARCHAR2, contract_ IN VARCHAR2, routing_revision_ IN VARCHAR2, alternative_no_ IN VARCHAR2, bom_type_ IN VARCHAR2, action_ IN VARCHAR2, routing_alternate## IN VARCHAR2) RETURN Entity_Small_Drr;

    Is the etag always ‘*’?? Where to find out for different functions?
     
  2. Does it mean, that my old code from Apps10 (direct calling the APIs) is forbidden in IFScloud?? Even if the old code is working correctly?

@westjan 

  1. When using SVC wrappers I’ve always used ‘*’ for etag. Normally the etag is the unique indetifier of the record - objkey fromDB. You only need to pass the etag when you update a record - so the system knows which record to update. When calling different functions except CRUD_Update I think you can pass etag as ‘*’
  2. Your old code will work. But the thing is that in IFS Cloud, PL/SQL Event Actions are deprecated. IFS is advising to not use them anymore. Instead BPA Workflows should be used.

https://docs.ifs.com/techdocs/25r1/040_tailoring/100_tailoring_overview/#common_scenarios

 


Thanks a lot for your help.


Reply