Solved

Background color for status field

  • 18 May 2023
  • 5 replies
  • 239 views

Hello ,

  
I want to display green background color to the status field with font color as white in the sales order screen. I Followed Two methods for that,
 1)Method 1: By using below code in  this i obtained colour for status value not in the background, i need background colour for the status field and letters are in white colour. 
          

  <px:PXDataSource>
           <ClientEvents CommandPerformed="changeStatusColor" />
       </px:PXDataSource>

 <script type="text/javascript">
        function changeStatusColor(sender, e) {
            var edStatus = px_all["ctl00_phF_form_t0_edStatus"];
            var edStatusControl = document.getElementById("ctl00_phF_form_t0_edStatus");
            if (edStatus && edStatus.value == "H")
                edStatusControl.background.color = "#FF0000";
            else
                edStatusControl.style.color = "#00FF00";
        }
    </script>

Method 2: Using this method, I received no updates to the field. in this case, I make CSS under the Visual Studio App_Themes folder, as shown below.
   
ASPX:
  <px:PXDropDown ID="edStatus" runat="server" DataField="Status" Enabled="False" CssClass="CustomAMIClassGreen" ></px:PXDropDown>

.CSS
  
    .CustomAMIClassGreen

{
    background-color: green;
    font-weight: bold;
}
      

 

Can anyone suggest the solution for this?

icon

Best answer by Naveen Boga 20 May 2023, 18:15

View original

5 replies

Userlevel 7
Badge +17

Hi @venkatreddy43  Can you try like below

 

 

Hello Naveen,
Thank you for the response.The above article is to add color to entire grids in acumatica.
We want it to show only on one field. We have added similar CSS class and assigned it to status field but it is not working. Do you have any other solution or suggestion for the above article approach.

.CustomAMIClassGreen {  

  background-color: green !important;
    color: black !important;
    font-family: courrier !important;

Userlevel 7
Badge +17

Hi @venkatreddy43  Thanks for the update!

I don’t think it will work to change the background color for that only STATUS. But, as a final option, please check with the Acumatica support team by raising a support case.

@Hughes Beausejour @Nayan Mansinha , do you have any quick suggestions on this, or do I need to raise a support case?

Userlevel 2

Have you tried adding something like this?
edStatusControl.style.setProperty("background-color", "rgba(112, 173, 71, 0.2)", "important");

That should work

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved