cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Customising fiori applications by coding

PRSTG
Newcomer
0 Kudos
257

So I want to write add a code in existing fiori app called "Manage assignements" wherein a button is to be desabled after reading a input screen and if the input screen matches a particular value. This code is working in the console in inspect tab at runtime. 

What we want to achive is to integrate this javascript code to the fiori app itself by default. Is it possible? What efforts are required?

 

(function() {
    function disableButtonIfConditionMet() {
        var inputElement = document.getElementById("application-DataSetMatchingAssignment-manage-component---worklist--smartFilterbar-filterItemControl_BASIC-DISP_GROUP-inner");
        var buttonElement = document.getElementById("application-DataSetMatchingAssignment-manage-component---worklist--btnAssign");
 
        if (inputElement && buttonElement) {
            if (inputElement.value === "1520 (Trading Partner balance)") {
                buttonElement.disabled = true;
            } else {
                buttonElement.disabled = false;
            }
        }
    }
 
    // Run the function initially
    disableButtonIfConditionMet();
 
    // Set an interval to run the function every second
    setInterval(disableButtonIfConditionMet, 1000);
})();

 

@SAPSupport SAP Fiori for SAP S/4HANA SAP Fiori Makers 

Accepted Solutions (0)

Answers (1)

Answers (1)

akuller
Participant
0 Kudos

search for adaption/extension projects and check whether you really want to integrate the code in this way.