• JP Blonshine
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 2
    Replies

Hey All -

 

I am not really sure where to begin on this. I have two long text fields: CF and CV. They both reside in Test_Data__c a child object of Test__c. 

Example:

CF = '0.1:0.2:0.3:etc.....'

CV = '0.0:0.4:0.2:etc...'

 

As you can see, each value is seperated by a colon. For each CV there is a CF. So the end goal here is to create a record that contains the Integer of CF2 and CV2 and relate it to the original Test__c master record.

 

To be more specific, I need to create a list of records from the two long text areas in each original record. I know that I will need to loop it, use the split function and convert, but I am just not sure where to start.

 

Thank you in advance for any direction you can provide.

 

JP

 

All -

 

So I have my data coming through correctly, and now I am trying to figure out displaying the X and Y axis correctly. With the following code, I am getting two lines. What I want is for the values to make one line. Channel Flow is the X-Axis and Channel Volume is the Y-Axis.

public with sharing class TestResultGraphConroller {

	
	public TestResultGraphConroller(ApexPages.StandardController stdController){
	}
	
	public String getTestResult(){
        return getTestResult(null);
    }
    
    public String getTestResult(List<Id> ids){
        
        GoogleViz gv = new GoogleViz();
                
        gv.cols = new list<GoogleViz.col> { 
            new GoogleViz.Col('col1','Channel Volume','number'),
            new GoogleViz.Col('Col2','Channel Flow','number')
        };
                
        string query = 'SELECT Id, Channel_Volume__c, Channel_Flow__c, Name FROM Trial_Data__c';
        
        // The unit testing path.
        if(ids != null && ids.size() > 0){
            query += ' AND Id IN :ids';
        }        
        
        query += ' ORDER BY Id ASC';
        
        decimal numTestResults = 0.01;                   
        for(Trial_Data__c td : Database.query(query)){  
            GoogleViz.row r = new GoogleViz.row();
            r.cells.add ( new GoogleViz.cell( td.Channel_Volume__c));
            r.cells.add ( new GoogleViz.cell( td.Channel_Flow__c));
                            
            gv.addRow( r );
            
            numTestResults++;
            }

        return gv.toJsonString();
    }  

 I am so close....but yet so far.

 

Regards,

 

JP

Greetings All!!

 

I have been working on a Google Visualization and am working on creating a graph with several plot points. The error I am getting is: Content cannot be displayed: Too many script statements: 200001

 

I am working with plotting out 2305 records into a line graph.

 

1) Is this possible?

 

2) If so how can I avoid the limitation?

 

Here is the Code:

public with sharing class TestResultGraphConroller {

	
	public TestResultGraphConroller(ApexPages.StandardController stdController){
	}
	
	public String getTestResult(){
        return getTestResult(null);
    }
    
    public String getTestResult(List<Id> ids){
        
        GoogleViz gv = new GoogleViz();
                
        gv.cols = new list<GoogleViz.col> { 
            new GoogleViz.Col('col1','Channel Flow','number'),
            new GoogleViz.Col('col2','Channel Volume','number'),
            new GoogleViz.Col('col3','Test','string')
        };
                
        Decimal numTestResult = 0.01;
        string query = 'SELECT Id, Channel_Flow__c, Channel_Volume__c, Test__c FROM Trial_Data__c WHERE Channel_Volume__c > 0' ;
                         
        // The unit testing path.
        if(ids != null && ids.size() > 0){
            query += ' AND Id IN :ids';
        }
        
        query += ' ORDER BY Name ASC'; 
                       
        for(Trial_Data__c td : Database.query(query)){  
            GoogleViz.row r = new GoogleViz.row();
            r.cells.add ( new GoogleViz.cell( numTestResult ) );
            r.cells.add ( new GoogleViz.cell( td.Channel_Volume__c ) );
            r.cells.add ( new GoogleViz.cell( td.Channel_Flow__c ) );
            r.cells.add ( new GoogleViz.cell( td.Test__c ) );
                
            gv.addRow( r );
            numTestResult ++;
        }

        return gv.toJsonString();
    } 

 Thank you for any help you can provide!!

 

JP

I need a pice of code to drop into a button. I am struggling to correctly build this. I need to put a button on a custom object that will clone the record it is on and all the detail records in a related list.

 

Can someone please assist me.

 

Example:

Patient__c related list Patient Records__c

 

It is a template that I would like to use over and over.

 

Thank you for any help you can provide

Greetings All!!

 

I have been working on a Google Visualization and am working on creating a graph with several plot points. The error I am getting is: Content cannot be displayed: Too many script statements: 200001

 

I am working with plotting out 2305 records into a line graph.

 

1) Is this possible?

 

2) If so how can I avoid the limitation?

 

Here is the Code:

public with sharing class TestResultGraphConroller {

	
	public TestResultGraphConroller(ApexPages.StandardController stdController){
	}
	
	public String getTestResult(){
        return getTestResult(null);
    }
    
    public String getTestResult(List<Id> ids){
        
        GoogleViz gv = new GoogleViz();
                
        gv.cols = new list<GoogleViz.col> { 
            new GoogleViz.Col('col1','Channel Flow','number'),
            new GoogleViz.Col('col2','Channel Volume','number'),
            new GoogleViz.Col('col3','Test','string')
        };
                
        Decimal numTestResult = 0.01;
        string query = 'SELECT Id, Channel_Flow__c, Channel_Volume__c, Test__c FROM Trial_Data__c WHERE Channel_Volume__c > 0' ;
                         
        // The unit testing path.
        if(ids != null && ids.size() > 0){
            query += ' AND Id IN :ids';
        }
        
        query += ' ORDER BY Name ASC'; 
                       
        for(Trial_Data__c td : Database.query(query)){  
            GoogleViz.row r = new GoogleViz.row();
            r.cells.add ( new GoogleViz.cell( numTestResult ) );
            r.cells.add ( new GoogleViz.cell( td.Channel_Volume__c ) );
            r.cells.add ( new GoogleViz.cell( td.Channel_Flow__c ) );
            r.cells.add ( new GoogleViz.cell( td.Test__c ) );
                
            gv.addRow( r );
            numTestResult ++;
        }

        return gv.toJsonString();
    } 

 Thank you for any help you can provide!!

 

JP