Forum Stats

  • 3,758,164 Users
  • 2,251,349 Discussions
  • 7,870,080 Comments

Discussions

Can I directly connect APEX with ERP Cloud?

User_ZE0KW
User_ZE0KW Member Posts: 5 Red Ribbon
Hello.
I have the doubt if I can extract information from the ERP directly in APEX? (I am new to the world of APEX)
Greetings and thanks for responding


Tagged:

Answers

  • Sylvain Martel
    Sylvain Martel Member Posts: 742 Silver Trophy

    Hello User,

    Why do you doubts? Have you read on the subject? What is the challenge that you are trying to resolve? Do you have a specific question?

    I assume that you are taking about Fusion Applications Cloud, the SaaS ERP from Oracle.

    The reality is that you can use APEX to extend Fusion Applications Cloud (aka ERP Cloud, SCM Cloud, HCM Cloud, etc.). You can consume web services to GET, PATCH, PUT and POST directly in APEX to transact against various business processes. Web services are key to allow reports to be generated or transactions to be created or completed in APEX. We have done APEX applications on Fusion.

    Depending on your use case, you would need a method to single sign-on to Fusion, either you own, IDCS, or anything else that your organization is using with Fusion.

    Not only did we created APEX applications on Fusion, but we also created APEX applications on Workday, a HCM SaaS application.

    I hope I gave you useful information.

    User_ZE0KW
  • User_ZE0KW
    User_ZE0KW Member Posts: 5 Red Ribbon

    Hello.

    I appreciate your response

    The issue is that I install the APEX version "free" and nowhere do I see the option to communicate directly with Fusion Applications Cloud (ERP Oracle), do you know what this problem is due to?


    Greetings.

  • Sylvain Martel
    Sylvain Martel Member Posts: 742 Silver Trophy

    Hello User,

    What is APEX version "free"? APEX is always free (no cost option to be more specific). Please describe what you mean by "communicate". Authenticate? Calling a web service?

    What are you trying to achieve? Once you explain your exact business requirements, we will be able to help you.

    User_ZE0KW
  • User_ZE0KW
    User_ZE0KW Member Posts: 5 Red Ribbon
    Checking APEX nowhere do I see the option to communicate directly with Fusion Applications Cloud (ERP Oracle), do you know why this problem is caused?
    
    or where I can configure the connection to use GET, PATCH, PUT and POST directly to the ERP
    or is there any documentation on how I can do this?
    Greetings.
    


  • Sylvain Martel
    Sylvain Martel Member Posts: 742 Silver Trophy

    Ok, I hope you know about web services... That's the vehicle to get the information from Fusion or to Fusion, depending on your business requirement, which you have not described yet.

    So to achieve this, it requires more than just an APEX wizard. There are many ways to do this, but there is 1 example for you here. Please note that there are many part missing ahead of this code, but since you did not provide any context, I do not know from which angle you want to tackle you business requirements.

    First, you would need call the web service for which you need information from. In this example, Fusion users web service is called from a pre rendering process:

    declare
    l_fusion_url     xxapex_sso_info_defaults.fusion_url%type;
    l_fusion_api     xxapex_sso_info_defaults.fusion_test_api%type; 
    l_jwt_base      varchar2(4000);
    l_response      clob;
    l_http_status_code  apex_web_service.g_status_code%type;
    
    begin
     l_jwt_base := :P_JWT_BASE;
     l_fusion_api := 'hcmRestApi/scim/Users';
      l_fusion_url := 'https://your_fusion_domain/';
    
     -- Preparing RESTful web service call 
     -- ==================================== 
     -- Set the HTTP Headers and the token l_jwt_base 
     apex_web_service.g_request_headers.delete(); 
     apex_web_service.g_request_headers(1).name := 'Authorization'; 
     apex_web_service.g_request_headers(1).value := 'Bearer '||l_jwt_base; 
     apex_web_service.g_request_headers(2).name := 'Content-Type'; 
     apex_web_service.g_request_headers(2).value := 'application/json';  
      
     -- Calling the Cloud ERP REST Service
     l_response := apex_web_service.make_rest_request(   
        p_url    => l_fusion_url||l_fusion_api, 
        p_http_method => 'GET' 
     );  
    
     -- Get the HTTP Response Code.
     l_http_status_code := apex_web_service.g_status_code; 
     :P1_HTTP_STATUS := l_http_status_code;
      
     if l_http_status_code = 200 then
      apex_collection.create_or_truncate_collection( 'REST_COLLECTION' );
      apex_collection.add_member(
        p_collection_name => 'REST_COLLECTION',
        p_clob001 =>    l_response ); 
     end if;    
    end;
    

    Then when you have the JSON message from the web service in a CLOB, you can proceed in a region to display the records from the JSON message in a report:

    select 
        j.ID,
        j.LOCATION,
        j.CREATED,
        j.LASTMODIFIED,    
        j.USERNAME,
        j.DISPLAYNAME,
        j.PREFERREDLANGUAGE,
        j.EMAILS,
        j.ACTIVE  
    from apex_collections c, json_table(
        c.clob001 format json,
        '$.Resources[*]'
        columns (
            ID                            VARCHAR2(4000)  path '$.id',
            LOCATION                      VARCHAR2(4000)  path '$.meta.location',
            CREATED                       VARCHAR2(4000)  path '$.meta.created',
            LASTMODIFIED                  VARCHAR2(4000)  path '$.meta.lastModified',        
            USERNAME                      VARCHAR2(4000)  path '$.userName',
            DISPLAYNAME                   VARCHAR2(4000)  path '$.displayName',
            PREFERREDLANGUAGE             VARCHAR2(10)    path '$.preferredLanguage',
            EMAILS                        VARCHAR2(4000)  path '$.emails.value',        
            ACTIVE                        VARCHAR2(10)    path '$.active'
        )
    ) j
    where c.collection_name = 'REST_COLLECTION'
      and upper(j.USERNAME) like upper('%'||nvl(:P1_USERNAME,j.USERNAME)||'%')
    
    

    This will display Fusion users in a IR or Classic Report.


    Hope this helps!

    User_ZE0KW
  • User_ZE0KW
    User_ZE0KW Member Posts: 5 Red Ribbon

    Thank you very much for the information.


    I am new to working with Apex, now I have to investigate how to use what you provided me, do you have any documentation or something that can help me?

  • Sylvain Martel
    Sylvain Martel Member Posts: 742 Silver Trophy

    Using web services is more on the advanced side of things. I don't think you will find much ready to use code. If you are new to APEX, it's a big step to jump into such a development.

    Look at the APEX APIs documentation and at APEX web modules.

    You might need help from an expert and hire someone to help you out.

    User_ZE0KW
  • User_ZE0KW
    User_ZE0KW Member Posts: 5 Red Ribbon

    I have tried to find information on how to do it and I cannot find it.

    I already have my Apex mounted and I even have ERP, but I still can't find the procedure to use GET, PATCH, PUT and POST directly to the ERP.

    Keep investigating.


    Greetings and thanks

  • Sylvain Martel
    Sylvain Martel Member Posts: 742 Silver Trophy

    Dear User,

    Working with SaaS applications and web services requires more than a wizard!

    Contact me and if you need professional help.