• ShwetaS
  • NEWBIE
  • 50 Points
  • Member since 2010

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

Hey all,

 

I'm having a problem where I need to dynamically update a picklist through a web service from an ERP system to Salesforce, and so I've started working on it, using C#.  The list will change depending on business practices throughout and will be "pushed" from the ERP to Salesforce nightly. 

 

So I was able to create the picklist values through the Web Service, as well as Update the picklist values using the metadata API.  The problem I'm running into now is deleting the values WITHOUT deleting the entire picklist itself. 

 

I've tried using delete but that will get rid of the entire picklist, and I only want to get rid of a few values at a time.  Any thoughts or examples that might help out? 

I am working on a visualforce page customizing the quote page layout with the quote line items. I am adapting the script from the Creating Compount Views turtorial on the wiki.

 

I am recieving the following error message:

Error: Compile Error: Return value must be of type: LIST<Quote> at line 9 column 9  

 

Below is my controller code:

 

public class MyConsoleController {
    public MyConsoleController() {

   }
 
    public Quote selectedQuote { get; set; }  
     
    public Quote[] getQuote() {
        return [SELECT id, Name, QuoteNumber, Created_Date__c, quote.Opportunity.AccountId, Quote_Line_Item__c,
                    Grand_Total__c,BillingAddress__c, BillingAddress2__c FROM Quote where id = :ApexPages.currentPage().getParameters().get('id')];
    
    }


    public QuoteLineItem[] getQuoteLineItems() {
        return [SELECT Id, PriceBookEntry.name, Quote__r.Grand_Total__c, QuoteID, Quantity, Quote_Item_Number__c, TotalPrice, ListPrice FROM QuoteLineItem
        WHERE QuoteId = :ApexPages.currentPage().getParameters().get('Id') order by Quote_Item_Number__c Asc];}

}

My questions:

 

1. What am I doing wrong in this controller?

2. What needs to be changed?

 

Thank you

Hello,

 

I am running DataLoader through the command line and everything works with following messages however when I open the csv file I only see headers with no data rows?

 

4467 [extractAsset] INFO com.salesforce.dataloader.process.ProcessRunner  - Checking the data access object connection
4468 [extractAsset] INFO com.salesforce.dataloader.process.ProcessRunner  - Setting field types
9407 [extractAsset] INFO com.salesforce.dataloader.process.ProcessRunner  - Setting object reference types
23059 [extractAsset] INFO com.salesforce.dataloader.process.ProcessRunner  - Creating Map
23062 [extractAsset] INFO com.salesforce.dataloader.action.OperationInfo  - Instantiating operation ui action: extract
23063 [extractAsset] INFO com.salesforce.dataloader.controller.Controller  - executing operation: extract
23070 [extractAsset] DEBUG com.salesforce.dataloader.client.PartnerClient  - Beginning web service operation: query
25817 [extractAsset] INFO com.salesforce.dataloader.action.progress.NihilistProgressAdapter  - Processed 10 of 10 total records. Rate: 18000000 record
s per hour. Estimated time to complete: 0 minutes and 0 seconds.  There are 10 successes and 0 errors.
25830 [extractAsset] INFO com.salesforce.dataloader.action.progress.NihilistProgressAdapter  - The extract has fully completed.  There were 10 success
ful extracts and 0 errors.

 

<bean id="extractAsset"
      class="com.salesforce.dataloader.process.ProcessRunner"
      singleton="false">
  <description>Extract Asset from salesforce and saves info into a CSV file."</description>
    <property name="name" value="extractAsset"/>
    <property name="configOverrideMap">
        <map>
            <entry key="sfdc.debugMessages" value="false"/>
            <entry key="sfdc.debugMessagesFile" value="C:\dev\work\xxx\logs\sfdcSoapTrace.log"/>
            <entry key="sfdc.timeoutSecs" value="600"/>
            <entry key="sfdc.loadBatchSize" value="200"/>
            <entry key="sfdc.entity" value="Asset"/>
            <entry key="sfdc.extractionRequestSize" value="2000"/>
            <entry key="sfdc.extractionSOQL" value="Select a.UsageEndDate, a.SystemModstamp, a.Status, a.SerialNumber, a.Quantity, a.PurchaseDate, a.Product2Id, a.Price, a.Name, a.LastModifiedDate, a.LastModifiedById, a.IsDeleted, a.IsCompetitorProduct, a.InstallDate, a.Id, a.Description, a.CreatedDate, a.CreatedById, a.ContactId, a.AccountId From Asset a LIMIT 10"/>
            <entry key="process.operation" value="extract"/>
            <entry key="dataAccess.type" value="csvWrite"/>
            <entry key="dataAccess.name" value="C:\dev\work\xxx\data\assetData1.csv"/>
        </map>
    </property>
</bean>

 

I have the other properties in config.properties.

 

Thanks

Hi all

I have used a pageblocktable in my visualforce page and applied a scrollbar for that by using ouputpanel styleClass but this applies a scroll for the entire table where as i whant to freeze my table header and apply scroll for only the data part how can i do that.

here is my code:

<apex:page Controller="mycontroller">
<style>
.container
{
   overflow:auto;  
   height:50px;  
   align:bottom;
}
</style>
     <apex:form >
        <apex:pageBlock title="My Content" mode="edit">
           <apex:pageBlockSection title="My Content Section" columns="1"   > 
               <apex:outputPanel layout="block" styleClass="container"  >           
                <apex:pageBlockTable value="{!temp}" var="item" align="top" width="100%" columns="10" >
                    <apex:column value="{!item.password__c}" ></apex:column>
                    <apex:column value="{!item.password__c}"></apex:column>  
                    <apex:column value="{!item.password__c}"></apex:column> 
                    <apex:column value="{!item.password__c}"></apex:column> 
                    <apex:column value="{!item.password__c}"></apex:column> 
                    <apex:column value="{!item.password__c}"></apex:column>
                    <apex:column value="{!item.password__c}"></apex:column>                      
                </apex:pageBlockTable>
             </apex:outputPanel>           
            </apex:pageBlockSection>
         </apex:pageBlock>
    </apex:form>
</apex:page>

 

 

 

  • September 21, 2010
  • Like
  • 1

Hey all,

 

I'm having a problem where I need to dynamically update a picklist through a web service from an ERP system to Salesforce, and so I've started working on it, using C#.  The list will change depending on business practices throughout and will be "pushed" from the ERP to Salesforce nightly. 

 

So I was able to create the picklist values through the Web Service, as well as Update the picklist values using the metadata API.  The problem I'm running into now is deleting the values WITHOUT deleting the entire picklist itself. 

 

I've tried using delete but that will get rid of the entire picklist, and I only want to get rid of a few values at a time.  Any thoughts or examples that might help out? 

Hi All,

 

It seems that SalesForce recommends creating a separate test class to hold the test methods for a normal call. Is this considered best practise? How can you unit test private methods?

 

I've seen people storing a test methods inside the primary class so that they are bundled together. Presumably this will allow access to the private methods and keeps things looking tidier. However, I've noticed that doing this, my mock objects don't get torn down again afterwards. Would that be right?

 

TIA

 

 

I am working on a visualforce page customizing the quote page layout with the quote line items. I am adapting the script from the Creating Compount Views turtorial on the wiki.

 

I am recieving the following error message:

Error: Compile Error: Return value must be of type: LIST<Quote> at line 9 column 9  

 

Below is my controller code:

 

public class MyConsoleController {
    public MyConsoleController() {

   }
 
    public Quote selectedQuote { get; set; }  
     
    public Quote[] getQuote() {
        return [SELECT id, Name, QuoteNumber, Created_Date__c, quote.Opportunity.AccountId, Quote_Line_Item__c,
                    Grand_Total__c,BillingAddress__c, BillingAddress2__c FROM Quote where id = :ApexPages.currentPage().getParameters().get('id')];
    
    }


    public QuoteLineItem[] getQuoteLineItems() {
        return [SELECT Id, PriceBookEntry.name, Quote__r.Grand_Total__c, QuoteID, Quantity, Quote_Item_Number__c, TotalPrice, ListPrice FROM QuoteLineItem
        WHERE QuoteId = :ApexPages.currentPage().getParameters().get('Id') order by Quote_Item_Number__c Asc];}

}

My questions:

 

1. What am I doing wrong in this controller?

2. What needs to be changed?

 

Thank you

Hi all,

 

I am trying to create a trigger on a related case that would update a field on the parent case when the new related (child) case is created against the parent. I am not an expert at apex triggers but have modified some code. I have copied it below.

 

Can anybody help me complete the code for this to work.

 

Thanks

 

 

 

trigger UpdateParentCase on Case (after insert, after update){
Case relcase = Trigger.new[0];
Case ca = new Case();
for(Case c:[Select Id,  Attempted_Call__c from Case where
Id = :relcase.Parent limit 1]){
ca = c;
ca.Attempted_Call__c = true;
update ca;
}
}

Hi,

 

I have one custom owner field (i.e. a lookup to all users). Where some user can manually select the owner of the record. I have another custom status field. Now, i want to send an email alert to the custom owner field, whenever the custom status fields gets updated.

 

please provide the solution on this

 

Thanks

 

  • September 15, 2010
  • Like
  • 0

Hi,

 

I would like some help on sending email message. I'm relatively new to Apex and VF. Here is what I've done so far - I've created a custom button (called Mail) in a Lead page, which when clicked,  pops open a simple VisualForce form window to send an email. I have pasted below the Apex code for Email Message which I had modified based on documentation/forum:

 

 

public class SendEmailMessage {

    public String toEmail {get;set;}
    public String subject {get;set;}
    public String body {get;set;}
    
    
    private final Lead MyLead;
    public SendEmailMessage(ApexPages.StandardController controller)
    
   
    {
        this.MyLead=(Lead)controller.getRecord();
    } 
   
             
    public void sendEmail() {
        
        //create a mail object to send email 
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        
        String[] toaddress = (new String[]{toEmail});
        
        //email properties
        mail.setToAddresses(toaddress);
        mail.setSubject(subject);
        mail.setUseSignature(true);
        mail.setPlainTextBody(body); 
               
        // send the email
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
     }   
   }

 The VF code is below:

<apex:page standardcontroller="Lead" extensions="SendEmailMessage"> 

    <apex:pageBlock title="EMAIL TEST">
        <apex:form >
        <br />
            <apex:outputLabel value="To" for="To"/>:<br/>
            <apex:inputText value="{!toEmail}" id="email"/><br/><br/>
                        
            <apex:outputLabel value="Subject" for="Subject"/>:<br />     
            <apex:inputTextarea value="{!subject}" id="Subject" cols="80" /><br/><br/>
                        
            <apex:outputLabel value="Body" for="Body"/>:<br />     
            <apex:inputTextarea value="{!body}" id="Body" rows="10" cols="80"/><br/><br/>      
            <br /><br />
                        
            <apex:commandButton value="Send Email" action="{!sendEmail}"  />
            <apex:commandButton value="Cancel" action="{!cancel}"/> 
        
        </apex:form>
    </apex:pageBlock>
</apex:page>

I'm able to send an email when I click the Send Email button on the VF page. However here is the list of issues that I've come against :

 

1. After clicking the Send Email button, I'd like to close the popped up window. I've tried using 'onclick=window.close()'. But I'm not sure if this is the correct approach.

 

2. I'd like to populate the Subject field with the Description from the Lead page when I click on the custom button (Mail) of the particular Lead.

 

Hopefully, I've explained it properly. If anybody could guide me in the right direction, I'd appreciate it.

 

Thank you.

 

 

 

 

 

 

I'm a little stuck on how to send an email to a contact after an opportunity is created.

 

I'm able to send an email immediately with the code below but how can I get it to send a couple days later? I've attempted to set up a workflow for opportunity records but when I attempt to setup an Email Alert it does allow me to select the contact email as the recipient. Not sure how to work around this or if I'm doing something wrong.

 

Any help would be much appreciated.

 

   //Now send welcome email
  $emailID = $sObject->Email; // User email from Noo DB
  $singleEmail1 = new SingleEmailMessage();
  $singleEmail1->setToAddresses(array($emailID));
  $singleEmail1->setreplyTo("test@test.com");
  $singleEmail1->setSenderDisplayName("Test sender");
  $singleEmail1->setSaveAsActivity(true);
  $singleEmail1->setTargetObjectId($SalesForceContactID);
  $singleEmail1->setTemplateId('');
  $singleEmail1->setEmailPriority(EMAIL_PRIORITY_NORMAL);

 

Hi guys,

 

Kindly help me out... Im having problem converting the datetime value field in my time zone (GMT+08:00) Philippines Time (Asia/Manila) so that when datetime field is captured in email, the correct time settings will be displayed.

 

So far, here's what I've gone through:

1. Create a Formula text type field that will convert my datetime field.

    MID(TEXT( DueDate__c + _______ ), 12, 5)

 

    Problem is I dont know what value will be supplied in the blank field or the formula in converting time zone so that I may be able to get the exact date and time values same as what is displayed in SF.

 

Your help is really appreciated.

Thanks!!!

 

  • September 09, 2010
  • Like
  • 0

My batch run is going to late every time any one help me who use this cron job application.

or any ther solution i want to run code every 1 hour.

Batch schedule has only 10 limit so i can't use this.

Thanks in advance.
Bhup

I have seen many code samples here using binding.xxxxx - everytime I have tried this I get "The name binding does not exist in this context".

 

Sample code I am using (and I put Using System.data at top)

 

 Account account1 = new Account();
            Account account2 = new Account();
            // Set some fields on the account1 object. Name field is not set
            // so this record should fail as it is a required field.
          
            account1.BillingCity = "Wichita";
            account1.BillingCountry = "US";
            account1.BillingState = "KA";
            account1.BillingStreet = "4322 Haystack Boulevard";
            account1.BillingPostalCode = "87901";
            // Set some fields on the account2 object
            account2.Name = "Golden Straw";
            account2.BillingCity = "Oakland";
            account2.BillingCountry = "US";
            account2.BillingState = "CA";
            account2.BillingStreet = "666 Raiders Boulevard";
            account2.BillingPostalCode = "97502";
            // Create an array of SObjects to hold the accounts
            sObject[] accounts = new sObject[2];
            // Add the accounts to the SObject array
            accounts[0] = account1;
            accounts[1] = account2;
            // Invoke the create() call
            
          SaveResult[] saveResults = binding.create(accounts);

Hi,

 

I have recenlty installed CMSForce and was trying to add some DHTML component as PageItem.

The preview of pageItem works fine but as I save it the it changes every thing as text and the complete javascript and html part (ie. source) is shown as the source.

 

Also, is it possible to use static resource in pageItem. If yes, can you let me know how?

Can someone help me with this.

 

Cheers,

Pushpi.

This should be an easy one but it doesn't seem to be in the documentation:

 

When executing a hard delete with the bulk api dataloader command line, what is the right syntax?

 

<entry key="process.operation" value="hard delete"/> - this throws an error. As does 'Hard Delete' and 'harddelete.'  So I'm not quite sure what to put.  Regular 'delete' works just fine.

 

Thanks!

Hi,

I am new to this salesforce. com.

 

Please tel me the steps to create a button on contact page (Next to Request update button).

By clicking that button it wil redirect to another one page that contains some fields..

 

Thanks in advance

 

Rgds

Jaffer

  • July 17, 2010
  • Like
  • 0