• Javier Maldonado
  • NEWBIE
  • 50 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 16
    Questions
  • 27
    Replies
The project that I'm working now is to add a suffix 4 digits alphanumeric sequential code, to a part number, the suffix is starting with AAA0 and then AAA1, AAA2 and go on, this suffix it will be the same when the record contains the same attributes and is going to vary every time that part number is new and different to another one, so all part numbers are going to have this suffix as a part of this part number, in that way we can make this part number the same over the all database.
As the first step, I'm trying to avoid creating a bunch of records at this custom object, and my goal would be, generate this suffix every time that I need it, rather than input these suffix at once on this custom object, we are talking about of more than 175000 of records.
My question would be, how can I guarantee the sequentiality of this suffix? is there a way how to do it using a trigger?... I've tried to write some kind of code but I couldn't find the way how to keep the counters updated for the next sequential code.
The below code is creating all sequential 4 digits code an is working fine in AnonymousWindow...
string [] a = new string[] {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
string [] b = new string[] {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
string [] c = new string[] {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
string [] d = new string[] {'0','1','2','3','4','5','6','7','8','9'};
 
for(integer i=0; i<a.size(); i++)
    for(integer j=0; j<b.size(); j++)
    	for(integer k=0; k<c.size(); k++)
    		for(integer l=0; l<d.size(); l++)
    
        		System.debug( a[i] + b[j] + c[k] + d[l]);
				System.debug( 'special==> '+a[1] + b[2] + c[3] + d[4]);
				System.debug( 'Total==> '+a.size()*b.size()*c.size()*d.size());
Any idea or suggestion will be welcome...
 
I'm trying to develop a Test Class to Cover the below Method:
public List<SelectOption> getlength(){
        List<SelectOption> options = new List<SelectOption>();            
        if(var_SystemOfMeasurement =='Imperial System'){
            cpl.Length_Units__c = 'Yards';
            options.add(new SelectOption('','--Length--'));
            options.add(new SelectOption('36','36'));
            options.add(new SelectOption('18','18'));
        }
        else if((cpl.Currency__c == 'USD' || cpl.Currency__c == 'CAD') && var_SystemOfMeasurement == 'Metric System'){
            cpl.Length_Units__c = 'Meters';
            options.add(new SelectOption('','--Length--'));            
            options.add(new SelectOption('33','33'));
            options.add(new SelectOption('16.5','16.5'));
        }
        else if((cpl.Currency__c == 'EUR' || cpl.Currency__c == 'GBP') && var_SystemOfMeasurement == 'Metric System'){
            cpl.Length_Units__c = 'Meters';
            options.add(new SelectOption('','--Length--'));            
            options.add(new SelectOption('30','30'));
            options.add(new SelectOption('15','15'));
        }
        return options;
    }

Honestly, I have not idea how to transfer cpl.Currency__c variable into my test class and how to develop this condition so far that I have done is made some system.assert, but they are not enough to cover all my class... after all insert below a snippet of my test class
ZT_Controller tst = new ZT_Controller(sc);
        
        
        tst.getSystemOfMeasurement();
        
        tst.var_SystemOfMeasurement='Imperial System';
        system.assertEquals(tst.var_SystemOfMeasurement, 'Imperial System');

 
I wrote a trigger that updates 4 fields into account that are related... our customization makes that we have Billing and Shipping accounts, so the shipping account has a lookup field that relates this shipping account to the billing account, so that this trigger does is basically change this 4 fields in all these relate accounts automatically.
In general, this trigger is working well, but I'm receiving the error when there are 30 - 40 accounts associated with this Billing account. How can I fix this issue?
 
trigger AccountUpdateTerms on Account (before update, after update) {

    Map<Id, Account> acc = new Map<Id, Account>();
    
    acc = trigger.oldMap;
    
    for(account newacc : trigger.new){
    
        if(newacc.Credit_Hold__c != acc.get(newacc.Id).Credit_Hold__c || newacc.Payment_Terms__c != acc.get(newacc.Id).Payment_Terms__c ||
           newacc.Price_Level__c != acc.get(newacc.Id).Price_Level__c){
        
           List<Account> accupd = new List<Account>();
            
           accupd = [SELECT Id,Company_Code__c,Bill_To_Account__c,Credit_Hold__c,Payment_Terms__c FROM Account WHERE Bill_To_Account__c =: newacc.Id ]; 
        
           if(trigger.isBefore && accupd.size() >0){
           
               for(account upd : accupd){
                    
                   upd.ByPass_Validation_Rules__c= TRUE;
                
               }
                
               update accupd;
           
           }
           
           if(trigger.isAfter && accupd.size() >0){
           
               for(account upd : accupd){
                    upd.Company_Code__c = newacc.Company_Code__c;
                    upd.Credit_Hold__c = newacc.Credit_Hold__c;
                    upd.Payment_Terms__c = newacc.Payment_Terms__c;
                    upd.Price_Level__c= newacc.Price_Level__c;   
               }
                    
               update accupd;
           
           }
        
        }    
   
    }

}

 
Hello community,

This is a dilemma that I'm facing in my code because my research is taking me to resolve this problem using "hard code" which is a not good practice... so, I'm pulling information from the same custom object to build a conveyor belt using 2 layers, 1 layer on top and 1 layer on bottom, the issue is - not all materials are compatibles each other - and that I'm trying to do is after the top layer is selected, shown as bottom layer just the compatibles material with the top layer... In this case, I have 26 different material available on top, and for each top bottom, I have since 2 until 20 different materials on the bottom, at the end could be a bunch of different combinations following this rule.

As a good point, I tried to developed an SOQL, but there is no any constant that I can use in between those materials, obviously, the Top Layer is  SOQL but my problem starts when I try to filter the bottom layer using the top layer as a dependent field...

Any suggestion or idea will be welcoming...

User-added image
 
I'm trying to build a visualforce page that allows me to get information to input a record, in this case, a specific field which is Product_Type is not going to change, and that I'm looking for is make this value by default will be 'Open Mesh', so when I start to input the information, the field Product_Type = 'Open Mesh' is a hidden value by default.

Any help will be welcome... Thanks in advance
I'm trying to query all related record in a child list from opportunity object, but I've not achieved this:

Parent Object: Opportunity

Child Object: Opportunity_Product__c (Custom Object)
Fields: Product_Description1__c and Product_Dimension__c
Master-Detail(Opportunity): Opportunity__c

So far, I have:
Select Id, Name, 
(
Select Id, Opportunity__r.Opportunity__c, 
Opportunity__r.Product_Description1__c, 
Opportunity__r.Product_Dimesion__c 

from Opportunity_Product__c

from Opportunity where id =  '0061b000002DjSCAA0'

Any HELP, will appreciated... Thanks
Hello everyone,
I'm facing a challenge now, and I just want to obtain your best advice because this is a really interesting project...
I have a custom related list called "Opportunity Products" in to my standard object Opportunity, this related list contain every item used in this opportunity, including price, quantity and also the amount... the challenge begin when I'm looking  automate the process, to updated a field called "Product Description" using the "Product Description" from my "Opportunity Products" related list, and using just the 3 largest amount records, shown in this related list... so the first step is, to identify the 3 largest amount, to then update this field...
I could identify the first large amount using a RollUp field (easy), but I'm trying to identify, the 2 seconds largest amount, and I found this really tricky.. so any light will be really welcomed... Thanks in advance...

User-added image
I created a visualforce page that use account (standard object) as a realated field, in to the custom object Customer_s_Price_List__c, so that I want to do is dynamically show the name of the company in to the section header instead to show the ID (18 digits)...

Can somebody help me???

User-added image

My visualforce code below...
<apex:page cache="true" expires="600" standardController="Customer_s_Price_List__c" extensions="Plasma_controller_SFDC1" showHeader="false" tabStyle="account">
    <apex:sectionheader title="Customer Price -" subtitle="{!Customer_s_Price_List__c.Account__c}"/>
    <chatter:feedwithfollowers entityId="{!Customer_s_Price_List__c.Id}"/>  
    <apex:form >

THANKS in advance...
Hello everyone...

I'm trying to align in to the same row, two input fields contained in the same block, is this possible or am I wasting my time trying to achieve this point.

I've been tried using style= (margin, padding, position, etc...)... any idea???

User-added image

My Code
<apex:pageBlockSection columns="1" id="Fabric_Tape" >
          <apex:pageBlockSectionItem id="STD_Width"  rendered="{!IF(Customer_s_Price_List__c.Wide_Imperial__c<>TEXT(ProductMaxWidth),true,false)}">
          <apex:outputLabel value="Length (Yards)" style="position:absolute; margin-top: -9pt; margin-left: -60pt; "  />
                   <apex:selectList size="1" value="{!Customer_s_Price_List__c.Long_Imperial__c}" style="margin-top: -9pt; margin-left: 0pt; margin-right: -10pt;" rendered="{!IF(Customer_s_Price_List__c.Wide_Imperial__c<>TEXT(ProductMaxWidth),true,false)}">
                        <apex:selectOptions value="{!length_FT_Imp}" />
                   </apex:selectList>
</apex:pageBlockSectionItem>

 
Hello everyone...

I'm working now in a complex part of my developing app, which is a full custom code, so that I will try to do is:
- Compare 2 variable; 1 from a pick list field (Width), and the other one from a field (Max_Width)
- Get 3 types of result:
  * Width > Max_Width; pop up a message to avoid create the record "Please pick width less than Max_Width"
  * Width = Max_Width; show a section with two fields Long_Imperial(number) and Length_Units(picklist field)
  * Width < Max_Width; show a section with standard pick list length

I've developed this code below, but I have no idea how transfer data in between them... Can somebody show me some light or help me with this code?, I don't know, whether it is possible that I'm trying to do, or not...

Thanks in advance, any advice it will be welcome

----VISUALFORCE---
<apex:pageBlockSection title="Imperial System" columns="1" 
                                rendered="{!Customer_s_Price_List__c.System_Of_Measurement__c == 'Imperial System'
                                && ( Customer_s_Price_List__c.Product_Type__c == 'Fabric' || Customer_s_Price_List__c.Product_Type__c == 'Tape') }">
     <apex:pageBlockSectionItem >
        <apex:outputLabel >Width(inches)</apex:outputLabel>
        <apex:inputField value="{!Customer_s_Price_List__c.Wide_Imperial__c}"> 
           <apex:actionSupport event="onchange" reRender="check_width"/>
        </apex:inputField>                          
     </apex:pageBlockSectionItem> 
     
     <apex:outputPanel id="check_width">
        <apex:pageBlock rendered="{!Tape_Fabric}">
  
        </apex:pageBlock>
     </apex:outputPanel>
</apex:pageBlockSection>

--------APEX------------
<public boolean Compare_width{get;set;}
public decimal var_Max_Width {get; set;}

public PageReference Tape_Fabric(){
    var_Max_Width = cpl.Max_Width__c;
    
    //Convert String in Decimal
    String temp = var_width;
    Decimal var_width_dec = Decimal.valueOf(temp);
   
    if(var_width_dec > var_Max_Width ){
        ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Please select width '));
    }
    if(var_width_dec == var_Max_Width ){
        
    }
    if(var_width_dec < var_Max_Width ){
        List<SelectOption> options = new List<SelectOption>();
        var_width = cpl.Wide_Imperial__c;
        var_Max_Width = cpl.Max_Width__c;
        if(var_width <> null  || Test.isRunningtest() )
        {
            if((var_Product_Type =='Tape' || var_Product_Type =='Fabric') && (var_width =='1/4' || 
                                             var_width =='3/8' ) || Test.isRunningtest()){
                options.add(new SelectOption('18','18'));
                options.add(new SelectOption('3','3'));
                }
            if((var_Product_Type =='Tape' || var_Product_Type =='Fabric') && !(var_width =='1/4' || 
                                             var_width =='3/8' ) || Test.isRunningtest()){
                options.add(new SelectOption('36','36'));
                options.add(new SelectOption('3','3'));
                }
        }
        return option;
    }
}>

 
Hello everyone,

Can somebody give me a hand... I just createD this test code, but it is not giving me any code coverage, and no errors neither...

TRIGGER
trigger SelectRecordType on Case (before insert) { 
    for (case cs :Trigger.new){
        if(cs.Type == 'Billing Adjustment'){
            cs.RecordTypeId='012180000004KrD'; 
            }
        else if(cs.Type == 'RMA'){
                cs.RecordTypeId='01240000000IbO4';
            }
    }  
}

TEST
@isTest(seeAllData=True)
public class SelectRecordType_Test {
    static TestMethod void SelectRecordType(){
        case c = new case();
        string tp = c.Type;
        if(tp == 'Billing Adjustment'){
            c.RecordTypeId='012180000004KrD'; 
        } else if(tp == 'RMA'){
            c.RecordTypeId='01240000000IbO4';
        }
    }
}
I'm working to find the way how to hide 1 of the 3 values from my pick list field, based on 2 different previous value content... 

I have a field "length" (picklist  9, 18, 36), field "width" (picklist  1/4, 3/8, 1/2, 3/4, 1) and field "material" (x, y and z ). I would like to filter the field "length" based on Material_Field and Width_Field, so as described below:

User-added image

please put some code if it's possible. THANKS
I'm working to build a custom application that allow me to get the price, on different levels, but my problem begins when I try to show the values on the formula fields (5 differents criteria to calculate the price) before save the record, because I have to fill some other fields, after to see what price level is attached to the customer, and keep this record saved according out process manual.

Currently I'm using "outputField", but doesn't work, because is not a dynamic binding in visualforce. I can show the label of each one of my fields but I cannot show the results. 

Any idea how can I resolve my issue?...
 
User-added image
Hellow everyone,

I'm pretty new coding in APEX, so I did this code below to run few fields in a Custom Object combined with a Dependent drop down Pick List, but I'm having a error, described in the subject. I would like to know what my error is, or what I'm doing wrong with this!!! any recommendation I'll appreciate...

APEX CODE
public with sharing class Dependence {
    public string var_Product_Type { get; set; }
    public string var_Product_Name { get; set; }
    
    public Dependence() {
        var_Product_Type = var_Product_Name = null;
        
    }    
          
    public List<SelectOption> getListGroups() {
        List<SelectOption> options = new List<SelectOption> { new SelectOption('','-- Type --') };
        for(Schema.PicklistEntry gr:Product2.Family.getDescribe().getPicklistValues()) {
            options.add(new SelectOption(gr.getValue(),gr.getLabel()));
        }
        return options;
    }
    
    public List<SelectOption> getListProducts() {
        List<SelectOption> options = new List<SelectOption>();
        if(var_Product_Type == null || var_Product_Type == '')
            return options;
        options.add(new SelectOption('','-- Name --'));
        for(Product2 pr:[select id, name from product2 where family = :var_Product_Type]) {
            options.add(new SelectOption(pr.id,pr.name));
        }
        return options;
    }
       
}

VISUALFORCE CODE
<apex:page standardController="Customer_s_Price_List__c" extensions="Dependence">        
    <apex:sectionheader title="{!$ObjectType.Customer_s_Price_List__c.label} Detail" subtitle="{!Customer_s_Price_List__c.Name}"/>
    <chatter:feedwithfollowers entityId="{!Customer_s_Price_List__c.Id}"/>
    <apex:form>
    
        <apex:pageBlock title="Customer's Price List" id="OppPageBlock" mode="edit">
            <apex:pageMessages />                 
                <apex:pageBlockButtons >                 
                    <apex:commandButton value="Save" action="{!save}"/>
                    <apex:commandButton value="Save & New" action="{!saveAndNew}"/>
                    <apex:commandButton value="Cancel" action="{!cancel}"/>                        
                </apex:pageBlockButtons>                                                                                                                         
            
            <apex:actionRegion>
                                                                                                                                    
                    <apex:pageBlockSection title="Customer's Price" columns="1">
                            <apex:inputField value="{!Customer_s_Price_List__c.Account__c}"/>
                            
                            <apex:pageBlockSectionItem >
                                <apex:outputLabel >Product Type</apex:outputLabel>
                                <apex:selectList size="1" multiselect="false" value="{!var_Product_Type}">
                                    <apex:selectOptions value="{!ListGroups}"/>
                                    <apex:actionSupport reRender="theForm" event="onchange"/>
                                </apex:selectList>
                            </apex:pageBlockSectionItem>
                            <apex:pageBlockSectionItem >
                                <apex:outputLabel >Product Name</apex:outputLabel>
                                <apex:selectList value="{!var_Product_Name}" size="1" multiselect="false">
                                    <apex:selectOptions value="{!listProducts}"/>
                                    <apex:actionSupport reRender="theForm" event="onchange"/>
                                </apex:selectList>
                            </apex:pageBlockSectionItem>
                                                                            
                                <apex:outputLabel value="System Of Measurement"/>                         
                                <apex:outputLabel >                             
                                    <apex:inputField value="{!Customer_s_Price_List__c.System_Of_Measurement__c}">                                 
                                        <apex:actionSupport event="onchange" rerender=" OppPageBlock " status="Product Type"/>                           
                                    </apex:inputField>                             
                                    <apex:actionStatus startText="applying value..." id="System_Of_Measurement__c"/>                          
                                </apex:outputLabel>                     
                            
                    </apex:pageBlockSection>                
                        <apex:pageBlockSection title="Imperial System" columns="2" rendered="{!Customer_s_Price_List__c.System_Of_Measurement__c == 'Imperial System'}">                 
                            <apex:inputField value="{!Customer_s_Price_List__c.Wide_Imperial__c}"/>
                            <apex:inputField value="{!Customer_s_Price_List__c.Long_Imperial__c}"/>
                        </apex:pageBlockSection>             
                        <apex:pageBlockSection title="Metric System" columns="2" rendered="{!Customer_s_Price_List__c.System_Of_Measurement__c == 'Metric System'}">                 
                            <apex:inputField value="{!Customer_s_Price_List__c.Wide_Metric__c}"/>
                            <apex:inputField value="{!Customer_s_Price_List__c.Long_Metric__c}"/>             
                    </apex:pageBlockSection>
                               
            </apex:actionRegion>            
        </apex:pageBlock>
    </apex:form>      
</apex:page>
Hello everione,

Maybe someone has experience working with some advanced code. I'm working in a project to allow the user select option filtered by the previous selected pick, everything from the same object, but this list must be shown in a different object. This field must be shown dynamically, as drop dow list, and filtered by the previous selection.
Object Product: Contain all records that I need to show in my new app
Fields - Product Type, Product Name, and Max Wide
New app
After pick Product Type, Product name is going to show just the product name filtered by Product, then this product has different width, so this Max Wide is going to show the wide on this Product Name.
 
Untitled
I'm working now in an special project, and I would like to use visual flow to build this app, so in one part of this project, there is a requirement of show a look up option, as drop down list, to bring a full list of items filtered by family, from Product Object

​Has somebody done this before?, Any Example???
I wrote a trigger that updates 4 fields into account that are related... our customization makes that we have Billing and Shipping accounts, so the shipping account has a lookup field that relates this shipping account to the billing account, so that this trigger does is basically change this 4 fields in all these relate accounts automatically.
In general, this trigger is working well, but I'm receiving the error when there are 30 - 40 accounts associated with this Billing account. How can I fix this issue?
 
trigger AccountUpdateTerms on Account (before update, after update) {

    Map<Id, Account> acc = new Map<Id, Account>();
    
    acc = trigger.oldMap;
    
    for(account newacc : trigger.new){
    
        if(newacc.Credit_Hold__c != acc.get(newacc.Id).Credit_Hold__c || newacc.Payment_Terms__c != acc.get(newacc.Id).Payment_Terms__c ||
           newacc.Price_Level__c != acc.get(newacc.Id).Price_Level__c){
        
           List<Account> accupd = new List<Account>();
            
           accupd = [SELECT Id,Company_Code__c,Bill_To_Account__c,Credit_Hold__c,Payment_Terms__c FROM Account WHERE Bill_To_Account__c =: newacc.Id ]; 
        
           if(trigger.isBefore && accupd.size() >0){
           
               for(account upd : accupd){
                    
                   upd.ByPass_Validation_Rules__c= TRUE;
                
               }
                
               update accupd;
           
           }
           
           if(trigger.isAfter && accupd.size() >0){
           
               for(account upd : accupd){
                    upd.Company_Code__c = newacc.Company_Code__c;
                    upd.Credit_Hold__c = newacc.Credit_Hold__c;
                    upd.Payment_Terms__c = newacc.Payment_Terms__c;
                    upd.Price_Level__c= newacc.Price_Level__c;   
               }
                    
               update accupd;
           
           }
        
        }    
   
    }

}

 
Hello community,

This is a dilemma that I'm facing in my code because my research is taking me to resolve this problem using "hard code" which is a not good practice... so, I'm pulling information from the same custom object to build a conveyor belt using 2 layers, 1 layer on top and 1 layer on bottom, the issue is - not all materials are compatibles each other - and that I'm trying to do is after the top layer is selected, shown as bottom layer just the compatibles material with the top layer... In this case, I have 26 different material available on top, and for each top bottom, I have since 2 until 20 different materials on the bottom, at the end could be a bunch of different combinations following this rule.

As a good point, I tried to developed an SOQL, but there is no any constant that I can use in between those materials, obviously, the Top Layer is  SOQL but my problem starts when I try to filter the bottom layer using the top layer as a dependent field...

Any suggestion or idea will be welcoming...

User-added image
 
I'm trying to query all related record in a child list from opportunity object, but I've not achieved this:

Parent Object: Opportunity

Child Object: Opportunity_Product__c (Custom Object)
Fields: Product_Description1__c and Product_Dimension__c
Master-Detail(Opportunity): Opportunity__c

So far, I have:
Select Id, Name, 
(
Select Id, Opportunity__r.Opportunity__c, 
Opportunity__r.Product_Description1__c, 
Opportunity__r.Product_Dimesion__c 

from Opportunity_Product__c

from Opportunity where id =  '0061b000002DjSCAA0'

Any HELP, will appreciated... Thanks
I created a visualforce page that use account (standard object) as a realated field, in to the custom object Customer_s_Price_List__c, so that I want to do is dynamically show the name of the company in to the section header instead to show the ID (18 digits)...

Can somebody help me???

User-added image

My visualforce code below...
<apex:page cache="true" expires="600" standardController="Customer_s_Price_List__c" extensions="Plasma_controller_SFDC1" showHeader="false" tabStyle="account">
    <apex:sectionheader title="Customer Price -" subtitle="{!Customer_s_Price_List__c.Account__c}"/>
    <chatter:feedwithfollowers entityId="{!Customer_s_Price_List__c.Id}"/>  
    <apex:form >

THANKS in advance...
Hello everyone...

I'm trying to align in to the same row, two input fields contained in the same block, is this possible or am I wasting my time trying to achieve this point.

I've been tried using style= (margin, padding, position, etc...)... any idea???

User-added image

My Code
<apex:pageBlockSection columns="1" id="Fabric_Tape" >
          <apex:pageBlockSectionItem id="STD_Width"  rendered="{!IF(Customer_s_Price_List__c.Wide_Imperial__c<>TEXT(ProductMaxWidth),true,false)}">
          <apex:outputLabel value="Length (Yards)" style="position:absolute; margin-top: -9pt; margin-left: -60pt; "  />
                   <apex:selectList size="1" value="{!Customer_s_Price_List__c.Long_Imperial__c}" style="margin-top: -9pt; margin-left: 0pt; margin-right: -10pt;" rendered="{!IF(Customer_s_Price_List__c.Wide_Imperial__c<>TEXT(ProductMaxWidth),true,false)}">
                        <apex:selectOptions value="{!length_FT_Imp}" />
                   </apex:selectList>
</apex:pageBlockSectionItem>

 
Hello everyone...

I'm working now in a complex part of my developing app, which is a full custom code, so that I will try to do is:
- Compare 2 variable; 1 from a pick list field (Width), and the other one from a field (Max_Width)
- Get 3 types of result:
  * Width > Max_Width; pop up a message to avoid create the record "Please pick width less than Max_Width"
  * Width = Max_Width; show a section with two fields Long_Imperial(number) and Length_Units(picklist field)
  * Width < Max_Width; show a section with standard pick list length

I've developed this code below, but I have no idea how transfer data in between them... Can somebody show me some light or help me with this code?, I don't know, whether it is possible that I'm trying to do, or not...

Thanks in advance, any advice it will be welcome

----VISUALFORCE---
<apex:pageBlockSection title="Imperial System" columns="1" 
                                rendered="{!Customer_s_Price_List__c.System_Of_Measurement__c == 'Imperial System'
                                && ( Customer_s_Price_List__c.Product_Type__c == 'Fabric' || Customer_s_Price_List__c.Product_Type__c == 'Tape') }">
     <apex:pageBlockSectionItem >
        <apex:outputLabel >Width(inches)</apex:outputLabel>
        <apex:inputField value="{!Customer_s_Price_List__c.Wide_Imperial__c}"> 
           <apex:actionSupport event="onchange" reRender="check_width"/>
        </apex:inputField>                          
     </apex:pageBlockSectionItem> 
     
     <apex:outputPanel id="check_width">
        <apex:pageBlock rendered="{!Tape_Fabric}">
  
        </apex:pageBlock>
     </apex:outputPanel>
</apex:pageBlockSection>

--------APEX------------
<public boolean Compare_width{get;set;}
public decimal var_Max_Width {get; set;}

public PageReference Tape_Fabric(){
    var_Max_Width = cpl.Max_Width__c;
    
    //Convert String in Decimal
    String temp = var_width;
    Decimal var_width_dec = Decimal.valueOf(temp);
   
    if(var_width_dec > var_Max_Width ){
        ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR, 'Please select width '));
    }
    if(var_width_dec == var_Max_Width ){
        
    }
    if(var_width_dec < var_Max_Width ){
        List<SelectOption> options = new List<SelectOption>();
        var_width = cpl.Wide_Imperial__c;
        var_Max_Width = cpl.Max_Width__c;
        if(var_width <> null  || Test.isRunningtest() )
        {
            if((var_Product_Type =='Tape' || var_Product_Type =='Fabric') && (var_width =='1/4' || 
                                             var_width =='3/8' ) || Test.isRunningtest()){
                options.add(new SelectOption('18','18'));
                options.add(new SelectOption('3','3'));
                }
            if((var_Product_Type =='Tape' || var_Product_Type =='Fabric') && !(var_width =='1/4' || 
                                             var_width =='3/8' ) || Test.isRunningtest()){
                options.add(new SelectOption('36','36'));
                options.add(new SelectOption('3','3'));
                }
        }
        return option;
    }
}>

 
Hello everyone,

Can somebody give me a hand... I just createD this test code, but it is not giving me any code coverage, and no errors neither...

TRIGGER
trigger SelectRecordType on Case (before insert) { 
    for (case cs :Trigger.new){
        if(cs.Type == 'Billing Adjustment'){
            cs.RecordTypeId='012180000004KrD'; 
            }
        else if(cs.Type == 'RMA'){
                cs.RecordTypeId='01240000000IbO4';
            }
    }  
}

TEST
@isTest(seeAllData=True)
public class SelectRecordType_Test {
    static TestMethod void SelectRecordType(){
        case c = new case();
        string tp = c.Type;
        if(tp == 'Billing Adjustment'){
            c.RecordTypeId='012180000004KrD'; 
        } else if(tp == 'RMA'){
            c.RecordTypeId='01240000000IbO4';
        }
    }
}
I'm working to find the way how to hide 1 of the 3 values from my pick list field, based on 2 different previous value content... 

I have a field "length" (picklist  9, 18, 36), field "width" (picklist  1/4, 3/8, 1/2, 3/4, 1) and field "material" (x, y and z ). I would like to filter the field "length" based on Material_Field and Width_Field, so as described below:

User-added image

please put some code if it's possible. THANKS