function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Lukasz PiziakLukasz Piziak 

Compiled size Limit 3,000 bytes on custom button

Hello guys, I'm wondering if you can help me with re-constarcting formula below in relation to the 3.000 bytes compiled size limit. Following formula is based on a user colour selection of the picklist field and is resulting with the proper code. My issue is that I need to add more colour options and unfortunatelly I'm hitting size limit.

!IF( ISPICKVAL(SCMC__Production_Order__c.Label_Band_Colour__c , "Black"), SCMC__Production_Order__c.Large_Label_Black_Band__c , 
IF(ISPICKVAL( SCMC__Production_Order__c.Label_Band_Colour__c , "Blue"), SCMC__Production_Order__c.Large_Label_Blue_Band__c , 
IF(ISPICKVAL( SCMC__Production_Order__c.Label_Band_Colour__c , "Brown"), SCMC__Production_Order__c.Large_Label_Brown_Band__c , 
IF(ISPICKVAL( SCMC__Production_Order__c.Label_Band_Colour__c , "Green (Dark)"), SCMC__Production_Order__c.Large_Label_Green_Dark_Band__c , 
IF(ISPICKVAL( SCMC__Production_Order__c.Label_Band_Colour__c , "Green (Light)"), SCMC__Production_Order__c.Large_Label_Green_Light_Band__c , 
IF(ISPICKVAL( SCMC__Production_Order__c.Label_Band_Colour__c , "Red"), SCMC__Production_Order__c.Large_Label_Red_Band__c , 
IF(ISPICKVAL( SCMC__Production_Order__c.Label_Band_Colour__c , "Yellow"), SCMC__Production_Order__c.Large_Label_Yellow_Band__c , 
IF(ISPICKVAL( SCMC__Production_Order__c.Label_Band_Colour__c , "Grey"), SCMC__Production_Order__c.Large_Label_Grey_Band__c , 
IF(ISPICKVAL( SCMC__Production_Order__c.Label_Band_Colour__c , "Purple"), SCMC__Production_Order__c.Large_Label_Purple_Band__c , 
IF(ISPICKVAL( SCMC__Production_Order__c.Label_Band_Colour__c , "Orange"), SCMC__Production_Order__c.Large_Label_Orange_Band__c , 


IF(ISPICKVAL( SCMC__Production_Order__c.Label_Body_Colour__c , "Black"), SCMC__Production_Order__c.Large_Label_Black_Body__c , 
IF(ISPICKVAL( SCMC__Production_Order__c.Label_Body_Colour__c , "Blue"), SCMC__Production_Order__c.Large_Label_Blue_Body__c , 
IF(ISPICKVAL( SCMC__Production_Order__c.Label_Body_Colour__c , "Brown"), SCMC__Production_Order__c.Large_Label_Brown_Body__c , 
IF(ISPICKVAL( SCMC__Production_Order__c.Label_Body_Colour__c , "Green (Dark)"), SCMC__Production_Order__c.Large_Label_Green_Dark_Body__c , 
IF(ISPICKVAL( SCMC__Production_Order__c.Label_Body_Colour__c , "Green (Light)"), SCMC__Production_Order__c.Large_Label_Green_Light_Body__c , 
IF(ISPICKVAL( SCMC__Production_Order__c.Label_Body_Colour__c , "Orange"), SCMC__Production_Order__c.Large_Label_Orange_Body__c , 
IF(ISPICKVAL( SCMC__Production_Order__c.Label_Body_Colour__c , "Red"), SCMC__Production_Order__c.Large_Label_Red_Body__c , 
IF(ISPICKVAL( SCMC__Production_Order__c.Label_Body_Colour__c , "Yellow"), SCMC__Production_Order__c.Large_Label_Yellow_Body__c , 
IF(ISPICKVAL( SCMC__Production_Order__c.Label_Body_Colour__c , "Grey"), SCMC__Production_Order__c.Large_Label_Grey_Body__c , 



IF(ISPICKVAL( SCMC__Production_Order__c.Stripped_Band_Colour__c , "Black"), SCMC__Production_Order__c.Large_Black_Stripped_Band_Label__c , 
IF(ISPICKVAL( SCMC__Production_Order__c.Stripped_Band_Colour__c , "Blue"), SCMC__Production_Order__c.Large_Blue_Stripped_Band_Label__c , 
IF(ISPICKVAL( SCMC__Production_Order__c.Stripped_Band_Colour__c , "Green (Light)"), SCMC__Production_Order__c.Large_Green_Light_Stripped_Band_Label__c , 
IF(ISPICKVAL( SCMC__Production_Order__c.Stripped_Band_Colour__c , "Red"), SCMC__Production_Order__c.Large_Red_Stripped_Band_Label__c , 
SCMC__Production_Order__c.Large_Label_Standard__c )))))))))))))))))))))))

Many Thanks for help
Best Answer chosen by Lukasz Piziak
Murali MattaMurali Matta
Hi Lukasz,

I think this links can help you

https://resources.docs.salesforce.com/206/latest/en-us/sfdc/pdf/salesforce_formula_size_tipsheet.pdf
https://help.salesforce.com/articleView?id=000005456&language=en_US&type=1

Thanks,
Murali