Skip to main content
Solved

Background color for status field

  • May 18, 2023 10:20 AM UTC
  • 5 replies
  • 564 views
  • Translate All

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.

View original

5 replies

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • May 18, 2023 11:00 AM UTC

Hi @venkatreddy43  Can you try like below

 

 

Translate

  • Author
  • Freshman I
  • May 19, 2023 8:55 AM UTC

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;
} 

Translate

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Answer
  • May 20, 2023 4:15 PM UTC

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.

Translate

  • Author
  • Freshman I
  • May 21, 2023 4:39 AM UTC

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

Translate

mehdihasanov
Acumatica Employee
  • Acumatica Employee
  • Aug 10, 2023 5:11 PM UTC

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

That should work

Translate