Skip to main content
Solved

How to Customize Footer level Color in Sales Order Screen


Forum|alt.badge.img

Hello 

I want to change the color for text in footer section(On Hand, Available, Available for shipping) in sales order screen.

Can you please suggest anyone?

Thanks,

Best answer by Saikrishna V

@davidnavasardyan ​@Naveen Boga ​@hdussa ​@Vignesh Ponnusamy 

I was able to display color in the footer section of the Sales Order screen (SO301000) by adding JavaScript to so301000.aspx, and it is working as expected.

 

However, when I try to integrate the same JavaScript into the Edit ASPX file within a customization package, the script gets removed when I click Generate Customization Script. I also attempted to use the JavaScript control to add the script, but it did not work.

<script type="text/javascript">
    function highlightAvailableForShipping() {
        let elements = document.querySelectorAll(".toolLabel nobr");

        elements.forEach((element) => {
            let text = element.innerHTML;
            let updatedText = text.replace(
                /\b(Unavailable)\b/g,
                '<span style="color: red; font-weight: bold;">$1</span>'
            );
            element.innerHTML = updatedText;
        });
    }
    setTimeout(highlightAvailableForShipping, 2000);
</script>

 

Could you suggest a way to include JavaScript in the package?

Thankyou Sai,

 

View original
Did this topic help you find an answer to your question?

10 replies

Forum|alt.badge.img+12
  • Acumatica Support Team
  • 866 replies
  • February 24, 2025

Hi ​@SaikrishnaVaddepalli 

You need to explore customization. I could not find any specific documentation/ instruction. Here are couple of related threads ( not specific to your thread ). 

https://asiablog.acumatica.com/index.php/2016/12/using-colors-in-acumatica/

https://www.acumatica.com/blog/acumatica-customization-theming-white-labeling/

Regards,


Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • 23 replies
  • February 24, 2025

@vkumar Thanks for sharing the thread links will try with this.


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3393 replies
  • February 24, 2025

I too did not find any specific documentation/ instructions adding colors to the footer section. The above provided links will be useful when we wanted add the colors for the GRID and Form level fields.

Please raise a support case with Acumatica to check if this is feasible.

 


davidnavasardyan
Jr Varsity I
Forum|alt.badge.img+2

Hi ​@SaikrishnaVaddepalli , I recommend using JavaScript to change the color of the footer section. Below is a simple code snippet that may help you: 

$(document).ready(function(){
    $("#ctl00_phF_form_edFieldName").css("background-color", "yellow");
});

Replace #ctl00_phF_form_edFieldName with the actual ID of the field you want to modify.


Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • 23 replies
  • February 25, 2025

Thank you ​@Naveen Boga ​@davidnavasardyan for providing the details.

Based on the specific logged-in user condition, I need to change the color of the footer section. I will try using JS, and if that doesn’t work, I will raise a support case with Acumatica.


hdussa
Jr Varsity I
Forum|alt.badge.img
  • Jr Varsity I
  • 99 replies
  • February 25, 2025

Hello ​@SaikrishnaVaddepalli ,

You can try using the ​@davidnavasardyan suggestion of applying the color using jQuery function if it is not a concern of using scripts.

Good luck!


Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • 23 replies
  • Answer
  • March 5, 2025

@davidnavasardyan ​@Naveen Boga ​@hdussa ​@Vignesh Ponnusamy 

I was able to display color in the footer section of the Sales Order screen (SO301000) by adding JavaScript to so301000.aspx, and it is working as expected.

 

However, when I try to integrate the same JavaScript into the Edit ASPX file within a customization package, the script gets removed when I click Generate Customization Script. I also attempted to use the JavaScript control to add the script, but it did not work.

<script type="text/javascript">
    function highlightAvailableForShipping() {
        let elements = document.querySelectorAll(".toolLabel nobr");

        elements.forEach((element) => {
            let text = element.innerHTML;
            let updatedText = text.replace(
                /\b(Unavailable)\b/g,
                '<span style="color: red; font-weight: bold;">$1</span>'
            );
            element.innerHTML = updatedText;
        });
    }
    setTimeout(highlightAvailableForShipping, 2000);
</script>

 

Could you suggest a way to include JavaScript in the package?

Thankyou Sai,

 


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3393 replies
  • March 5, 2025

Thanks ​@SaikrishnaVaddepalli for sharing the solution.


Vignesh Ponnusamy
Acumatica Moderator
Forum|alt.badge.img+5

@SaikrishnaVaddepalli, To include the changes in the aspx might be tricky. You can try the following,

  • You can edit the SO301000.aspx from the Pages folder of the website in you local
  • Remove SO301000.aspx from the files.list in the root folder of the site
  • Then from Files section the customization project, add the SO301000.aspx 

This step should place the aspx in other site but it will not work if you have customization project that modifies the SO301000.aspx. So in that case you have directly modify the aspx in the CstPublished folder. Good Luck.!


davidnavasardyan
Jr Varsity I
Forum|alt.badge.img+2

@SaikrishnaVaddepalli 

Yes, you are right. It is a problem when trying to modify an ASPX file via a Generate Customization Script .

I would suggest moving your code to a separate .js file, which will keep your code much cleaner. Additionally, you can dynamically load the JavaScript file using PXJavaScript.

Here is an example of how you can use it:

<px:PXJavaScript 
    runat="server" 
    ID="CstSetFooterColorJavaScript"  
    IsStartupScript="False" 
    Script="window.addEventListener('load', () => { 
        const s = document.createElement('script'); 
        s.src = '../[YOUR_SCRIPT].js';  
        s.onload = () => { 
            if (typeof highlightAvailableForShipping=== 'function') { 
                highlightAvailableForShipping(); 
            } else { 
                console.error('highlightAvailableForShippingis not defined');  
            } 
        }; 
        s.onerror = () => console.error('Failed to load highlightAvailableForShippingis script:', s.src);  
        document.head.appendChild(s); 
    });" 
/>

And in your JavaScript file ([YOUR_SCRIPT].js), write the following code:

window.addEventListener('load', () => { 
    // Your code executes after the page has fully loaded 
});

This approach will ensure better code organization and maintainability. Let me know if you need further assistance!


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings