Skip to main content
Answer

Background color for status field

  • May 18, 2023
  • 5 replies
  • 464 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?

Best answer by Naveen Boga

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.

5 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • May 18, 2023

Hi @venkatreddy43  Can you try like below

 

 


  • Author
  • Freshman I
  • May 19, 2023

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;


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • Answer
  • May 20, 2023

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.


  • Author
  • Freshman I
  • May 21, 2023

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


mehdihasanov
Acumatica Employee
  • Acumatica Employee
  • August 10, 2023

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

That should work