• mDizz_7
  • NEWBIE
  • 35 Points
  • Member since 2012
  • EnablePath

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 7
    Replies

So, I have a visualforce page on a Case page layout. I want the visualforce element to only display the information for the creation time of that case rather then everything in real time. Any ideas from the community on how to do this?

 

Thanks in advance

Hello everyone,

 

I'm building a VF page where I have custom object related to an Opportunity. I've got everything built but can not get the edits to to save from the VF page to the actual record. Code is below, any help would be much appriciated. 

 

<apex:page standardController="Opportunity" sidebar="false" >
<apex:form >
<apex:sectionHeader title="{!Opportunity.name}"/>
<apex:pageBlock mode="inlineEdit" title="Equipment">
<apex:pageMessages />
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!quicksave}"/>
<apex:commandButton value="Close" onClick="window.top.close();"/>
</apex:pageBlockButtons>
<apex:pageBlocktable value="{!Opportunity.Equipment__r}" var="equipment" >
<apex:column headerValue="Remove">
<apex:inputCheckbox value="{!equipment.Remove_Equipment__c}" />
</apex:column>
<apex:column headerValue="Reciever R#">
<apex:outputField value="{!equipment.Name}"/>
</apex:column>
<apex:column headerValue="Receiver S#">
<apex:outputField value="{!equipment.Receiver_S__c}"/>
</apex:column>
<apex:column headerValue="Receiver Model">
<apex:outputField value="{!equipment.Receiver_Model__c}"/>
</apex:column>
<apex:column headerValue="Programming">
<apex:outputField value="{!equipment.Programming__c}">
<apex:inlineEditSupport event="ondblclick"/>
</apex:outputField>
</apex:column>
<apex:column headerValue="Status">
<apex:outputText value="{!equipment.Statis__c}"/>
</apex:column>
</apex:pageBlocktable>
</apex:pageBlock>
<center>
<apex:commandButton action="{!quicksave}" value="Save"/>
<apex:commandButton onClick="window.top.close();" value="Close" />
</center>
</apex:form>
</apex:page>

I've built a custom uploader and I'm struggling to write a test method for it. I was hoping some wouldn't mind helping me out. See Code below.

 

public class Equipment_CSV_FileUploader
{

    public PageReference reset() {
        return null;
    }

    public string nameFile{get;set;}
    public Blob contentFile{get;set;}
    String[] filelines = new String[]{};
    List<Equipment__c> accstoupload;
    
    public Pagereference ReadFile()
    {
        nameFile=contentFile.toString();
        filelines = nameFile.split('\n');
        accstoupload = new List<Equipment__c>();
        for (Integer i=1;i<filelines.size();i++)
        {
            String[] inputvalues = new String[]{};
            inputvalues = filelines[i].split(',');
            
            Equipment__c a = new Equipment__c();
            a.Name = inputvalues[0];
            a.Receiver_S__c = inputvalues[1];       
            a.Receiver_Model__c = inputvalues[2];
            a.Opportunity__c = ApexPages.currentPage().getParameters().get('oppId');                                  
            
            accstoupload.add(a);         
        }
        try{
        insert accstoupload;
        }
        catch (Exception e)
        {
            ApexPages.Message errormsg = new ApexPages.Message(ApexPages.severity.ERROR,'An error has occured. Please check the template');
            ApexPages.addMessage(errormsg);
        }      
                      
        return null ;
    }
        public List<Equipment__c> getuploadedEquipment()
    {
        if (accstoupload!= NULL)
            if (accstoupload.size() > 0)
                return accstoupload;
            else
                return null;                    
        else
            return null;
    }            
}

 

 

This is what I have for a test method so far. I'm at 19% but I really have no idea what I'm doing

 

@istest
private class Equipment_CSV_FileUploader_TestMethod
{         
    static testmethod void Equipment_CSV_FileUploader_TestMethod()  
    {
        Equipment_CSV_FileUploader testcls = new Equipment_CSV_FileUploader();  
        testcls.ReadFile();
        testcls.reset();                    
    }    
}

 

Thanks in advance!

Hello everyone,

 

I'm currently searching for a solution to make a vfpage that a user can upload an excel file and have it automatically create new records in a custom object. Any advice would be much appreciated.

 

Thanks in advance for the help!

Hello everyone, I'm pretty new to developing and my org has just run accross a problem. We need to track history on product changes within the Opporunitiy. I know this is not supported nativly. My thought is that we can run a trigger and populate a list of changes. However I'm not sure where to start on this. Any references or advice would be helpful. Thanks in advance!

Hello All,

I'm getting a System.UnexpectedException: null error while trying to unlock or lock the records from a Queueable Apex job.
I would need someone's advise to resolve this error as soon as possible.

My scenario is as below:

I want to update a set of opportunities out of which a few of them are locked by the approval process.
So I want to unlock these opportunities, update a particular field in the opportunity and lock the record again via apex.
I have used the standard approval process.

Please advise.
 

So, I have a visualforce page on a Case page layout. I want the visualforce element to only display the information for the creation time of that case rather then everything in real time. Any ideas from the community on how to do this?

 

Thanks in advance

Hello everyone,

 

I'm building a VF page where I have custom object related to an Opportunity. I've got everything built but can not get the edits to to save from the VF page to the actual record. Code is below, any help would be much appriciated. 

 

<apex:page standardController="Opportunity" sidebar="false" >
<apex:form >
<apex:sectionHeader title="{!Opportunity.name}"/>
<apex:pageBlock mode="inlineEdit" title="Equipment">
<apex:pageMessages />
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!quicksave}"/>
<apex:commandButton value="Close" onClick="window.top.close();"/>
</apex:pageBlockButtons>
<apex:pageBlocktable value="{!Opportunity.Equipment__r}" var="equipment" >
<apex:column headerValue="Remove">
<apex:inputCheckbox value="{!equipment.Remove_Equipment__c}" />
</apex:column>
<apex:column headerValue="Reciever R#">
<apex:outputField value="{!equipment.Name}"/>
</apex:column>
<apex:column headerValue="Receiver S#">
<apex:outputField value="{!equipment.Receiver_S__c}"/>
</apex:column>
<apex:column headerValue="Receiver Model">
<apex:outputField value="{!equipment.Receiver_Model__c}"/>
</apex:column>
<apex:column headerValue="Programming">
<apex:outputField value="{!equipment.Programming__c}">
<apex:inlineEditSupport event="ondblclick"/>
</apex:outputField>
</apex:column>
<apex:column headerValue="Status">
<apex:outputText value="{!equipment.Statis__c}"/>
</apex:column>
</apex:pageBlocktable>
</apex:pageBlock>
<center>
<apex:commandButton action="{!quicksave}" value="Save"/>
<apex:commandButton onClick="window.top.close();" value="Close" />
</center>
</apex:form>
</apex:page>

Hello everyone,

 

I'm currently searching for a solution to make a vfpage that a user can upload an excel file and have it automatically create new records in a custom object. Any advice would be much appreciated.

 

Thanks in advance for the help!

We are developing a Rates managment system in Salesforce, in which Sales Reps can see and change the rates their customers will be charged for our services. As part of this there is the option to export a set of rates in Excel format. The rep would then discuss this with their customer and make any agreed changes to rates on the spreadsheet. We need then to get that data back into Salesforce from the spreadsheet.

 

Could we script Data Loader to import the data from a csv file uploaded from a visualforce page? If so, how? Or is there some other way? The whole process needs to be as simple as possible for the user. Preferably just: pick your file.and press the upload button.

 

Any pointers you can give would be much appreciated.

 

Thanks

 

Euan

 

Hello everyone, I'm pretty new to developing and my org has just run accross a problem. We need to track history on product changes within the Opporunitiy. I know this is not supported nativly. My thought is that we can run a trigger and populate a list of changes. However I'm not sure where to start on this. Any references or advice would be helpful. Thanks in advance!