• MikeGill
  • SMARTIE
  • 699 Points
  • Member since 2010
  • Salesforce MVP
  • Salesforce Weekly


  • Chatter
    Feed
  • 26
    Best Answers
  • 0
    Likes Received
  • 3
    Likes Given
  • 63
    Questions
  • 231
    Replies
Hi,
I would like to convert Date to String in  DD-MM-YYYY format  in my controller Class

I can easily convert it using format method if it is DateTime but not Date.

If I use the corresponding Date functions I'm not getting the format directly
For Eg:
date todayDate = system.today();
Now if I use todayDate.day()  I get 4 not 04.
So again I need to convert this into DD format.

Is there any easy approach to convert Date to String in DD-MM-YYYY format?
Many thanks in advance!!


Hi All,

 

Is there any ways to remove standard buttons on bottom of the detail page / layout ?. I want to show the standard buttons at the top of the detail page only.  Any help is appreciated.

 

 

Thanks in advance,

SK

Hi All,

 

I remember reading somewhere that as a best practice one should avoid creating multiple triggers on the same object and instead should have a single trigger invoking a class or classes. What is the reason for this? We currently have about 5 triggers on some objects and this could probably increase, it seems to be more organized to have a different trigger (with a descriptive name) for specific operations. Can anyone advise on this ? 

 

Thanks

 

 

 

Hi,

Is there a way to use the PermissionsModifyAllData field from the Profile object in Apex? I can see in the schema that it is included in the Profile object. However, when i try to use that field, it says that the field name is incorrect, check spelling. It appears to me that all the Permission-fields in the profile don't have the name the schema tells me.

Any suggestions?

Thanks in advance!

Br, Marco

Hi All

 

I am new to Cloud Development, and I would like to design a Mobile App for the iPhone, iPad, Android and Blackberry  environments using the Force.com platform. 

 

Could Force. com users direct me to the most appropriate starting point ?

 

Thank you, in advance.

 

  • May 10, 2012
  • Like
  • 0

We have a post sales group that coordinates delivery of our product, and we have a custom object  that is a master detail to the opportunity to collect data on the details of this process.

 

My question is: how would you go about adding the post sales groups to these opportunities? We don't want to give them permissions until the opportunities are closed. However, they need to have read/write access to edit the scheduling of products. We also only want them to have access to the opportunities in the region in which they are assigned, so we don't want to grant them general opportunity access.

 

I'm having a hard time wrapping my head around the profile settings we should use. I am leaning towards using sales teams and having the sales guys set up the default sales teams, then train them to manually add the default team when the opp is closed won. Ideally, I would like that to be automated, but seeing as I know nothing about apex triggers or anything of that sort (yet), I was looking for a simpler way.

 

Any suggestions would be greatly appreciated!

  • April 02, 2012
  • Like
  • 0

hi,

Is it not possible to filter the picklist value,Bcoz when i tried to filter it with the picklist value it gave me the following error:

 

Error: Picklist value does not exist

 

 

Regards,

Gaurav Gulanjkar

Hi, we are using the Products object and the standard functionality is that you can put a value in the "Unit Price" field and the a figure in the "Quantity" field and this will auto calculate the revenue value of the product for you! This is currently set to 2 decimal places, (£0.00), so if you need to enter a "Unit Price" that = 3 decimal places (£0.000) then this will automatically round the final figure Up/Down and this can drastically distort the final Revenue value of the Opportunity... Is there a way of increasing the decimal places on the "Unit Price" field, which is a standard field to 3 or more decimal places? Many thanks Ian

Hello Force.com Development community

I am trying to create a trigger that will assign a Date (Redemption_Cutoff_Date__c) from one of my custom objects: Funds__c to the custom field: Redemption_Cutoff_Date__c on the CASE object.  The Trigger compiles without errors, however it is not work where the Redemption Cutoff Date from the Fund object is assigned to the CASE.Redemption_Cutoff_Date__c field.

 

Can someone please let me know where I am going wrong here:

 

trigger UpdateRedemptionCutoffDateonCASE on Case (before update) {

for(Case c: Trigger.new){


if(c.isRedemption__c = true && c.RecordTypeId == '012M00000004MTS'){


List<Funds__c> fund = new List<Funds__c>();
List<Case> cs = new List<Case>();

fund = [Select Funds__c.Id, Redemption_Cutoff_Date__c from Funds__c f
where Funds__c.Id = :c.Fund__c];


if(fund.size()>1){
fund[0].Redemption_Cutoff_Date__c = cs[0].Redemption_Cutoff_Date__c;
}
}
}
}

 

 

 

   Hi guys,

 

                  I am entry level salesforce devoloper plese clear my problem

 

                  ex: i have written a trigger on contact for when the account 

 

                    is changed all the contacts will change. it is working .

 

                  But this time can i write a trigger on contact when the contact

 

               is changed the related account will change. but not all contacts of account . please give a sample code.

 

 

    Thank  you in advance! 

Hello,

Getting this:
Challenge not yet complete... here's what's wrong: 
The component does not implement the 'appHostable' interface. That interface is required to add the component to Salesforce1.


My component looks like this
 
<aura:component implements="force:appHostable">
	<h1 class="headline">Hello Trailhead</h1>
</aura:component>

 
Hello All

Q. Anyone know of PDF parsing framework/library/solution which handles different data types including variable lenght text areas (e.g. keeps formatting and line breaks) 

We are currently using this one running on Heroku:

http://www.pdfparser.org/documentation

Issue: Line breaks are removed as a result of parsing.

Thanks

I am creating a talend job using a UE sandbox and getting API not enabled

 

Exception in component tSalesforceBulkExec_1
[AsyncApiException  exceptionCode='FeatureNotEnabled'
 exceptionMessage='Async API not enabled'
]

 Any ideas?

I am trying to remove the hover over link (in blue) and just display the output i.e. the name not the id

 

   <tr>
                 <td id="label">
                    Sales Rep
                 </td>
                <td id="REP">
                    <apex:outputField value="{!Opportunity.OwnerId}"/>
                 </td>
            </tr>

 

Using outputText displays the Id, which I don't want.

 

I'm wondering two options here

 

1. Some kind of inline style override - ???

 

2. Use workflow rule to copy the value

 

Any help, really appreciated.

Hi All,

 

I'm using jquery to toggle a logo static resource - all works fine, but as soon as I add renderas="PDF" the logo does not load...

 

    <script src="{!URLFOR($Resource.jquery)}" type="text/javascript"></script>
        
    </head>
    <body>
      <table width="100%" border="0" class="addressheader">
        

        
        
                         <tr>
                      <td>
                          <img src='' Height="51" Width="204" title="logo" id='divisionImage' /> 
                        
                        <input type='hidden' id='divisionCode' value='UK' />  
                       
                            <br/>
                            <br/>
                        
                                <script>
          $(document).ready(function() {
            // The minute the page loads, perform this action.
            // get the value used to determine which image to display
            whichCode = $('#divisionCode').val();
          
            if(whichCode == 'IE') $('#divisionImage').attr('src','{!URLFOR($Resource.WRLogo)}');
            else $('#divisionImage').attr('src','{!URLFOR($Resource.WRLogo)}');
  
            });
        </script>

 

Any ideas?

 

Thanks

Hi All,

 

I am trying to migrate some custom salutation values using the migration tool.

 

this works

 

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>Lead.Industry</members>
        <name>CustomField</name>
    </types>
    <version>23.0</version>
</Package>

 but this doesn't

 

<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>Lead.Salutation</members>
        <name>CustomField</name>
    </types>
    <version>23.0</version>
</Package>

 

Any ideas?

Frustrated more than stuck. I want to add more exception handling, but end up just leaving out as I can never get full coverage on the code

 

How can I test try catch exceptions like the example below. Seems impossible to get coverage on the exception part of the try catch.

 

 

public with sharing class OpportunityTriggerHandler {
	
	/**
	*	@client			XYZ.
	*	@description	Basic account category update from opportunity to assist with writing classes
	*/
	    
    public OpportunityTriggerHandler(){}
    
    public void OnAfterUpdate(Opportunity[] oldOpp, Opportunity[] updatedOpp, Map<ID, Opportunity> oppMap){
    	
        Set<Id> accIds = new Set<Id>();
        Map<Id, String> catMap = new Map<Id, String>();
        
        for (Opportunity opp:[select Id,  OwnerId, AccountId, Category__c from Opportunity where Id in: oppMap.keySet()]){
        	accIds.add(opp.AccountId);
        	catMap.put(opp.AccountId, opp.Category__c);
        }
        
         List<Account> accToUpdate = new List<Account>();
    	  
    	  for (Account acc:[select Id, Display__c, Broadcast__c, Projector__c from Account where Id in: accIds]){
    	  	
    	  		String oppCat = catMap.get(acc.Id);
    	  	
    	  		
    	  		if (!acc.Projector__c &&  oppCat == 'Projector'){
    	  			acc.Projector__c = true;
    	  		}
    	  		
    	  		if (!acc.Display__c &&  oppCat == 'Display'){
    	  			acc.Display__c = true;
    	  		}
    	  		
    	  	accToUpdate.add(acc);
    	  }
    	  
		try{
    	  	update accToUpdate;
		}
		
		catch (Exception e){
			// Can't test this part
		}
       
     
    	
    }
    
   

}

 

Test class

@isTest
private class TestOpportunity {
	
	
	public static List<Account> accs;
	public static List<Opportunity> opps;
	public static List<Opportunity> oppsToTest;
	
	// Create static test data
	
	public static void init(){
		TestUtil testUtil = new TestUtil();
    	testUtil.createTestUsers(); 
       	testUtil.createTestAccounts();
    	testUtil.createTestOpps();
    	
    	accs = testUtil.accs;
    	opps = testUtil.opps;
	}

	// Test Projector
    static testMethod void myUnitTest_Projector() {
    	
    	init();
    	test.startTest();

    	oppsToTest = new List<Opportunity>();
   	
    	for (Opportunity opp:opps){
    		opp.Category__c = 'Projector';
    		System.assertEquals(opp.Account.Projector__c, false);
    		oppsToTest.add(opp);
    	}
	
    	update oppsToTest;

		// Requery updated account records to assert
		List<Account> accounts = [select Projector__c from Account where Id =: oppsToTest[0].AccountId];
		
		System.assertEquals(accounts[0].Projector__c, true);
		    		
    	test.stopTest();
        
        
    }
    
    // Test Display
     static testMethod void myUnitTest_Display() {
    	
    	init();
    	test.startTest();

    	oppsToTest = new List<Opportunity>();
   	
    	for (Opportunity opp:opps){
    		opp.Category__c = 'Display';
    		System.assertEquals(opp.Account.Display__c, false);
    		oppsToTest.add(opp);
    	}
	
    	update oppsToTest;

		// Requery updated account records to assert
		List<Account> accounts = [select Display__c from Account where Id =: oppsToTest[0].AccountId];
		
		System.assertEquals(accounts[0].Display__c, true);
		    		
    	test.stopTest();
        
        
    }
    
    // Test Exception
    
         static testMethod void myUnitTest_Exception() {
    	
    	// Force exception - how do I force an exception to be thrown
    	init();
    	test.startTest();
    	
    	oppsToTest = new List<Opportunity>();
   	
    	for (Opportunity opp:opps){
    		opp.Category__c = 'Display';
    		System.assertEquals(opp.Account.Display__c, false);
    		oppsToTest.add(opp);
    	}
	
    	update oppsToTest;
			
		    		
    	test.stopTest();
        
        
    }
    
    
    
}

 

Thanks

Is this possible

 

Mimic the standard clone button with a onclick javascript custom button 

 

I know I can do with with controller extension, but trying to avoid having to create the page using visualforce e.t.c

 

Thanks

I am trying to perform a "not equal" on two date fields (formula derived)

 

select Id, MasterContract_Start_Date__c, Current_Contract_Start_Date__c
from Asset
where MasterContract_Start_Date__c != Current_Contract_Start_Date__c

I'm getting MALFORM query unexpected token when executing the above query using SoqlXplorer.

 

Compare to today works fine

 

select Id, MasterContract_Start_Date__c, Current_Contract_Start_Date__c
from Asset
where MasterContract_Start_Date__c != today

 What am I doing wrong, I should be able to do this I would have thought?

 

 

I have create a custom APEX process which clones a custom record when certain values are saved.

 

My issue -  For users where fields are read-only, these fields are not getting cloned. When system administrators clone records, the values are cloned correctly.

 

It's very strange - clone code snippit 

 

if (createClone){
	Vacancy__c clonedVac = updatedVacancies[0].clone(false,true );
		//clonedVac.Credit__c = null;
		clonedVac.Status__c = 'New Call';
		// @BUGFIX @date 1/11/10 @by MG
		clonedVac.Vacancy_Proof__c =   updatedVacancies[0].Vacancy_Proof__c;
		clonedVac.On_Rerun__c = true;
		clonedVac.Action__c = null;
		insert clonedVac;
		createClone = false;
				
				
			}

 

Any pointers welcome - thanks

Hi All,

 

Strange one. I have a query string which I am filtering using a formula field, this works correct if I just execute the query. If I try and execute the query string using Execute anonymous I don't get any results back from the query.

 

String qs = 'select Id, Subject, Description, Legacy_History_Id__c, Legacy_Id__c  from Task where Legacy_Id__c = \'218bc9a3bOFEP\'';

List<Task> results = Database.query(qs);
System.debug('Results size = '+results.size());

 

I'm expecting results size to be 1.

 

Any ideas.

 

Cheers,

 

Mike

Getting the following error when trying to add project into IDE

 

Unable to fetch organisation details for 'mike.db@cloudava.com'

 

INVALID_TYPE: Cannot use ApexComponent in this organisation!

 

Any ideas?

I have implemented a custom controller / visualforce page for updating contacts records.

 

The fields are displayed fine, save method fails to update contact record.

 

if I switch back to normal fields, everything works fine.

 

Anyone experienced this?

I am trying to output a custom picklist in a visualforce page

 

This works fine - but I'm lost to how to make it display as a drop-down

 

<apex:page controller="sampleCon">
    <apex:form >
        <apex:selectList value="{!countries}" multiselect="true">
            <apex:selectOptions value="{!items}"/>
        </apex:selectList><p/>

        <apex:commandButton value="Test" action="{!test}" rerender="out" status="status"/>
    </apex:form>

    <apex:outputPanel id="out">
        <apex:actionstatus id="status" startText="testing...">
            <apex:facet name="stop">
                <apex:outputPanel >
                    <p>You have selected:</p>
                    <apex:dataList value="{!countries}" var="c">{!c}</apex:dataList>
                </apex:outputPanel>
            </apex:facet>
        </apex:actionstatus>
    </apex:outputPanel>
</apex:page>

 

Please can someone point me in the right direction - thanks

Hi,

 

The online help seems to suggest that only standard objects are support for visualforce EMAIL templates.

 

<messaging:emailTemplate recipientType="Contact"
    relatedToType="Vacancy__c"
    subject="Test"
   
    replyTo="support@acme.com">

    <messaging:htmlEmailBody >
        <html>
            <body>

            <p>Dear {!Vacancy__c.Name},</p>
       
            </body>
        </html>
    </messaging:htmlEmailBody>
</messaging:emailTemplate>

Going to switch to full HTML if this is not supported.

 

Thanks 

 

Error when using image stored in salesforce. Error "The reference to entity "oid" must end with the ';' delimter"

 

Code with image served from sfdc:

 

	#container { width:830px; height:600px; margin:0 auto; background:#FFF url( https://c.cs12.content.force.com/servlet/servlet.ImageServer?id=015V00000004lAW&oid=00DV00000000Olc&lastMod=1312875334000) bottom left no-repeat; position:relative; }

 

I'm not a CSS expert - but it seems to be related to the additional url parameters passed in. 

 

Any suggestions?

 

Thx

 

What's the best way to ensure I see every new community message?

RSS feed?

Shame there isn't an app for the boards too.

Usual story trigger working fine, test class working to 86%. But can't seem to get the last part.

 

Here is the class (called by before insert trigger on opportunity).

 

The trigger is updating the type field on the account from 'Lead Acct' to 'Opportunity Acct'

 

 System.assertEquals(opp.Account.Type, 'Opportunity Acct') - this should equal, I could be late and something obvious, but I can't spot it.

 

Any help  appreciated 

 

public with sharing class OpportunityTriggerHandler {
	
		/**
		*	@author			Mike Gill
		*	@date			28/07/11
		*	@description	Update account type based on certain criteria
		*/

     
     public OpportunityTriggerHandler(){}
	
	//TODO: Add user custom persmission check
	
	 public void OnBeforeInsert(Opportunity[] newOpps){
	 	
		List<Account> accs = new List<Account>();
		
		for (Opportunity opp:newOpps){
			
			if (opp.Type == 'Lead Acct'){
				accs.add( new Account (id=opp.AccountId, Type = 'Opportunity Acct' ));
			}
			
		}
		
		update accs;  
     }
     
}

 

And here is the test class

 

@isTest
private class TestOpportunityTriggerHandler {
	
	/**
	*	@author			Mike Gill
	*	@date			28/07/11
	*	@description	Test Scenarios for Opportunity Trigger Handler
	*  	TODO: 			
	*/
	
	static List<Account> accounts;
	static List<Opportunity> opps;
	static List<Contact> contacts;
	
	static {
			
			// Empty Lists	
			accounts = new List<Account>();
    		opps = new List<Opportunity>();
    		contacts = new List<Contact>();
		
			// Fetch profile id
     		Profile p = [select id from Profile where name = 'Standard User'];
     		
     		// Create user for tetsing
     		User u = new User ( alias = 'testme', email = 'testme@noemail.com', emailencodingkey = 'UTF-8', lastname = 'test',languagelocalekey = 'en_US', 
     		localesidkey = 'en_US', profileid = p.Id, country = 'United Kingdom', timezonesidkey = 'Europe/London', username = 'testme@noemail.com');
     		insert u;
     		
     		// Add  Accounts to the list to be inserted	
     		for (Integer i = 0; i<1; i++){
     			Account a = new Account(
     			Name = 'Test' + i,
     			Type = 'Lead Acct',
     			BillingState = 'CA',
     			Industry = 'Business Services',
     			OwnerId = u.Id
     			);
     			accounts.add(a);
     		}
     		
     			insert accounts;
     	
     		
     		// Add Contacts to the list to be inserted
     		for (Account a: accounts){
     			
     			Contact c = new Contact();
     			c.FirstName = 'Test First';
     			c.LastName = 'Test Last';
     			c.LeadSource = 'Call In';
     			c.AccountId = a.Id;
     			contacts.add(c);
     			
     		}
     		
     		insert contacts;
     	
     		// Add Opps
     		for (Account a: accounts){
     			
     			
     			
     			Opportunity o = new Opportunity();
     			o.Name = 'Test Opp';
     			o.AccountId = a.Id;
     			o.CloseDate = Date.today();
     			o.StageName = '1-Qualified Prospect';
     			opps.add(o);
     			
     		}
  	
		
	}
	
    static testMethod void myUnitTest_CreateOpp() {
    	
    /**
    * @description	Test related account type is set to Opportunity Acct on create of opportunity
    */
    
    		test.startTest();
       	
       		// Check account type is Lead Acct before insert
       		for (Account acc:accounts){
       			System.assertEquals(acc.Type, 'Lead Acct');
       		}	
     	
     		
     		// Insert opps
     		insert opps;
     		
     		
     		// Check records
     		System.debug(Logginglevel.ERROR, 'EB/DEBUG TEST: Number of accounts created is'+ accounts.size() + ' id=' + accounts[0].Id);
     		System.debug(Logginglevel.ERROR, 'EB/DEBUG TEST: Number of contacts created is ' + contacts.size() + ' id=' + contacts[0].Id);
     		System.debug(Logginglevel.ERROR, 'EB/DEBUG TEST: Number of opps created is ' + opps.size() + ' id='+ opps[0].Id);

   		
   			// Query for newly inserted opps
     		List<Opportunity> o = [select Id, Account.Type  from Opportunity where Id in: opps];
   			
   			for (Opportunity opp:o){
   				System.assertEquals(opp.Account.Type, 'Opportunity Acct');
   			
   			}
       		
       		       	
       		// End test
       		test.stopTest();
       		
    }
  
}

 

 

 

I am testing out oauth recipe using dotcloud.com (love the simplicity of this service and have used it for testing other stuff ok)

 

Here is what I am trying to setup and test:

http://developer.force.com/cookbook/recipe/interact-with-the-forcecom-rest-api-from-php

 

After creating the files and push the code to dotcloud. Testing redirects me to sf login page where I can login, then grant access, after which I am redirected to blank page....

 

The url is this of the page is this

 

https://32468be0.dotcloud.com/oauth_callback.php?code=aPrxVyeZrusRBnfyxIlvdJRvh04y2Hlhz6jTOjs8wDq8H0G8ROEo96YfrsUYdUNnYhX.lF6bFQ%3D%3D

 

I'm not a PHP expert, after looking at oauth_callback.php source I believe it's missing some parameters.

 

    . "&redirect_uri=" . urlencode(REDIRECT_URI);

 . "&grant_type=authorization_code"
    . "&client_id=" . CLIENT_ID
    . "&client_secret=" . CLIENT_SECRET

 

Anyone experienced this?

 

I guess the next thing I will try will be running on a local webserver (e.g. my OSX), but would rather get working on the dotcloud service.

 

Is it possible to have a formula which shows if the account owner is active or not on the account page?

 

Should be possible without coding??

 

Thanks

 

Hello,

Getting this:
Challenge not yet complete... here's what's wrong: 
The component does not implement the 'appHostable' interface. That interface is required to add the component to Salesforce1.


My component looks like this
 
<aura:component implements="force:appHostable">
	<h1 class="headline">Hello Trailhead</h1>
</aura:component>

 
Hi
I'm using salesforce REST API for web app
creating orders for an Account.
I can create the order just fine(without products)

My problem is,
add a product to the order when creating
and
Updating an existing order.

Does anyone have the correct json POST / PATCH for that ?
using v20 API and PHP btw.

I'm currently trying to create a trigger that runs whenever an Opportunity is created or updated. The trigger needs to check all the other Opportunities related to the Account of the Opportunity being updated. It should check to see if any of the Opportunities have a StageName equal to 'Closed Won - One Time' or 'Closed Won - Recurring' and if so, it should update the account Type to 'Customer'. If none of the Opportunities are closed won, the Account Type should be 'Prospect'.

This is the code I have but I'm not sure if I'm querying the right things: 

trigger updateAccountIfOppCustomer on Opportunity (after insert, after update) {
    List<Account> accts = new List<Account>();
    List<Opportunity> opps = new List<Opportunity>(); 
    
    for (Opportunity opp : Trigger.new) {
        accts = [SELECT Id, Name, Type FROM Account WHERE Id =: opp.AccountId LIMIT 1]; 
        opps = [SELECT Id, AccountId, StageName, Account.Type FROM Opportunity WHERE AccountId =: opp.AccountId];
    }

    for (Account a : accts) {
        for (Opportunity o : opps) {
            if (o.StageName == 'Closed Won - One Time' || o.StageName == 'Closed Won - Recurring' || o.StageName == 'Customer Reseller') {
                if (a == null) {
                    a = new Account(Id = o.AccountId, name='TestingName');
                }
                a.Type = 'Customer'; 
            } else {
                a.Type = 'Prospect';
            }
        }
    }
    update accts;
}
Any help is much appreciated.

Cheers
  • August 12, 2014
  • Like
  • 0
An Account has  few checkbox fields. When these fields checked Then the contact record Text box field should update with some values. Is this possible with Formulae or else trigger.

Ex: Account fields     AiroSteel , BeuroCost , DuerTest , AspiriCraft are check box fields..

Contact has a Checkbox field. AVailable Prod  should be updates based on Checkbox to true.


IF Acct_’AiroSteel’ = TRUE, {AS}
IF Acct_’BeuroCost’ = TRUE, {BC}
IF Acct_’DuerTest’ = TRUE, {DT}
IF Acct_’AspiriCraft’ = TRUE, {AC}
  • August 11, 2014
  • Like
  • 0
Hi,
I would like to convert Date to String in  DD-MM-YYYY format  in my controller Class

I can easily convert it using format method if it is DateTime but not Date.

If I use the corresponding Date functions I'm not getting the format directly
For Eg:
date todayDate = system.today();
Now if I use todayDate.day()  I get 4 not 04.
So again I need to convert this into DD format.

Is there any easy approach to convert Date to String in DD-MM-YYYY format?
Many thanks in advance!!


Narrative:
As a registered user
I want to proved feedback to the site
So that I can get the fixes and features that matter to me

Acceptance Criteria: (presented as Scenarios)

Scenario 1: Opening the feedback form
Given I am on any page in the site
  And I want to give feedback
When I click the "Submit Feedback"
Then a form opens in a floating window
  And I can enter my feedback in a text field

Scenario 2: Filling out the feedback form
Given I have opened the feedback form
  And I want to give feedback
When I enter my feedback in the provided text field
  And I click "Submit"
Then the window closes
  And a confirmation appears with the text:
Your feedback has been successfully submitted.

Thank you for leaving feedback.  Your contribution is valued and appreciated.

  And I can click an "OK" button to close the confirmation
Negative Case:
  If I click the "Cancel" button instead of the Submit button
    Then the feedback window closes and nothing is retained

Scenario 3: Receiving feedback
Given I am a site admin
  And I want to review feedback provided to the site
When I open salesforce and view a "feedback" object
Then I can see a list of all feedback that has been provided

Note: A determination needs to be made as to the best way to support the feedback object.  Is there a standard salesforce object we can use or do we need a custom one?
  • August 04, 2014
  • Like
  • 0
Hi,
   I want to check if a record is modified before executing any operation on record in before update trigger. 


Regards,
Ketan
I missed the salesforce maintenance exam for winter release. I did my dev 401 certification last december. What will happen ? Is that fine to take the next exams?
Please see the below code:

Rebate_Amount__c object having - 92255 rows and suppose to insert 92255 rows on gross profit, but it is inserting more than 1 laks rows

global class RebateGPBatch implements Database.Batchable<SObject>
{

    global Database.QueryLocator start(Database.BatchableContext bc)

  {
       string query = '';
       query += ' select Opportunity_Name__r.id  from Rebate_Amount__c ';
    
       if(Test.isRunningTest())
       {
          query  = ' select id from Rebate_Amount__c  ';
          query += ' where company__c = \'SDS\' ';
          query += ' limit 20';
       }

       return Database.getQueryLocator(query);
  }

  global void execute(Database.BatchableContext bc, List<SObject> scope)
  {

     List<Id> optyWithQuoteSet = new List<Id>();
    
  
      for (sObject obj :scope)
      {
         Rebate_Amount__c   op = (Rebate_Amount__c)obj;
          
         optyWithQuoteSet.add(op.Opportunity_Name__r.id);
      }


    
list<Shipped__c>  listSch =[select cost__c,Material__c  ,Opportunity2__c
                                                  from Shipped__c
                                                     where Quote__c!=null and Opportunity2__r.StageName='S' and Opportunity2__c = :optyWithQuoteSet];

map<string,Shipped__c> mapShipped= new map<string,Shipped__c>();

for(Shipped__c sch : listSch)
{
mapShipped.put(sch.Material__c + sch.Opportunity2__c,sch);
}

  //GP insert - start
   List<Gross_Profit__c> GPList = new List<Gross_Profit__c>();

Rebate_Amount__c object having - 92255 rows and suppose to insert 92255 rows on gross profit, but it is inserting more than 1 laks rows

List<Rebate_Amount__c> Gp_data = [Select Material__c,Quote_Number__c,Company_Code__c,Rebate_by_Amount__c,Item_Number__c,Active_Flag__c,Net_Sales_Amount__c from Rebate_Amount__c where Opportunity_Name__r.id=:optyWithQuoteSet];


for(Rebate_Amount__c oli : Gp_data)
{

   Gross_Profit__c  gp= new Gross_Profit__c();
   gp.Quote_No__c= oli.Quote_Number__c;
   gp.Company__c=oli.Company_Code__c;
   gp.Item_Number__c = oli.Item_Number__c;
   gp.Rebate__c = oli.Rebate_by_Amount__c;
   gp.Active_Flag__c = oli.Active_Flag__c;
   gp.Net_Sales__c = oli.Net_Sales_Amount__c;
   string keyMap_Cost=oli.Material__c + oli.Quote_Number__c;

   if (mapShipped.containskey(keyMap_Cost))
    {
    gp.Cost__c = mapShipped.get(keyMap_Cost).cost__c;
    }
    GPList.add(gp);
     }
   if(GPList.size()>0)
   {
      system.debug('GP Insert section ');
   insert GPList;
   }


   // GP insert - end

}

   global void finish(Database.BatchableContext bc)
  {

    }



}
I didn't copied all of the code of the trigger only the line that's doesn't get updated .. the task is created with all the data except WhoID.
In the debug maptoContact.get(t.WhatId) returns the Id of the wanted contact..

what is wrong here ?

trigger Task_BeforeInsertUpdateDelete on Task (before delete, before insert, before update)
{

trigger Task_BeforeInsertUpdateDelete on Task (before delete, before insert, before update)

{

 

    for(Task t : Trigger.new)

    {
           t.WhoId = maptoContact.get(t.WhatId);

    }
}

 

I need help with creating a trigger to create a Rollup Summary on the Accounts object from the Contracts object.  The field from the Contract that I need to rollup onto the Account screen is called Active_Contract_Count__c.

Could someone please help?
Hi community,

I have a button on which I want to open a model popup after processing a business logic. While processing I want to show processing image. On this model pop-up, I want show output of business process.

Please help.


We're looking for a CRM developer to help develop and maintain our Salesforce instance and integrations for our Sales and Product Marketing teams. We make really cool stuff in a collaborative and extremely fast paced environment. In partnership with the Salesforce architect, this individual will be responsible for technical development within Nest’s SFDC ecosystem, which includes integrations into Nest internal systems and many other SaaS applications. 

The job is located in Palo Alto, CA.

If you're interested in learning more, click here (https://nest.com/careers/crm-administrator--developer/onsXYfwu).

Thanks!
William
To participate in the final pitch for the summer of hacks, you need to register your team on challenge post

http://sohlondon.challengepost.com/

You also need to email your github accout name (or all your teams Github account names) to summerofhacks@bemyapp.com.  If you do not have a Github account, you can create one for free at https://github.com/

Installing Git

You can install Git from http://git-scm.com/ or if you prefer a GUI tool you can use Github for windows (https://windows.github.com/) / mac (https://mac.github.com/) or you can use MavensMate.com or Force.com IDE.


Getting your app data out of your Salesforce org (metadata)

As part of the challenge you need to regularly submit your code and all the metadata (metadata is generated when you click to create objects and other things in the Org).

To get your metadata, you can download it with tools like MavensMate.com or the Force.com IDE.  If you are not using either of those you can the Force.com CLI (command line interface).  For details of getting your metadata with the Force.com CLI, follow this detailed guide (http://www.scribd.com/doc/233908496/Force-com-CLI-Submitting-Metadata).

Completing the Git Challege

Once you have the metadata and code in the same folder then you are ready for your git challenge.  First of all, add the private repository given to you by BeMyApp and pull down the contents of that repository (if using a GUI tool you do the same actions below, these are the command line actions).
 
git clone <address given to you by bemyapp> path/to/your/metadata-and-code>
git pull origin master

Now you are ready to add all your App code and metadata.  The easiest way is to use the fullstop to say add everything

git add .

You can check you have added everything using the git status command.  If there are untracked files, then add those files using their filename

Now create a commit of everything you have added

git commit -m "git challenge X"

Then you send all the code & metadata in that commit to the repository that BeMyApp gave to you.

git push origin master

Now get on with bulding your app.

For the next git challenge it is even easier

git add .
git commit -m "
git challenge X"
git push origin master


If you have any questions then ask the evangelist - John & Christophe.  There is also a more detailed Git workshop at http://jr0cket.co.uk/git-workshop/

Thank you