Skip to main content
Solved

Background color for status field


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
Did this topic help you find an answer to your question?

5 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3412 replies
  • May 18, 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
  • 3412 replies
  • 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.


@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
  • 8 replies
  • 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


Reply


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