Maximo

Maximo

Come for answers, stay for best practices. All we're missing is you.

 View Only

Display no records when savedQuery is not present in the OSLC GET API request

  • 1.  Display no records when savedQuery is not present in the OSLC GET API request

    Posted Wed August 14, 2024 04:07 AM
    Edited by Kalpana Devaraj Thu August 22, 2024 06:35 AM

    Hi ,

    Good day!


    Please provide your assistance with my request.


    Getting expected results when a saved query is present in the GET request of the OSLC API based on the business rules:

    https://hostname/maximo/oslc/os/objectstructurename?lean=1&oslc.select=*&oslc.pageSize=10&stablepaging=1&savedQuery=getLatestWOUpdates


    If the URL does not have a saved query parameter in the GET request of the OSLC API, then I should not return any results, but currently it is returning all the results. 

    We can customize through a script without launch point whatever we want, but the URL needs to be modified as below, which is not recommended.
    https://hostnamet/maximo/oslc/script/scriptname?lean=1


    Java customization is also not recommended.

    I tried it with the integration script on object structure with outbound definition; overridemethod() got trigered but was unable to take query parameters. If I try to use ctx.getJsonRequest(), getQueryParam("savedQuery"), then I am getting the below error message.

    "reasonCode": "BMXAA7837E",
    "message": "BMXAA7837E: An error occurred that prevented the OSOUT. WOVENDORAPI script for the null launch point from running.AttributeError: 'NoneType' object has no attribute 'getQueryParam' in <script> at line number 19".
    "statusCode": "400"



    ------------------------------
    Kalpana Devaraj
    ------------------------------