• alibzafar
  • NEWBIE
  • 173 Points
  • Member since 2011


  • Chatter
    Feed
  • 6
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 44
    Replies
I have related list under account object for suppose an account record has 5 related recored on a object, can  i get thosed related list in account field?


User-added image
As shown in the above image, this is a related list on Account object, so i need a field on account object and show all the related list names in the field 

for example : 

Account_field1__c =  Contarct name 1 , contract name 2 , contract name 3 ........ contract name 6 .
Account_field1__c =  619754.1STD ,619744STD,619733STD,619730STD,617208.6STD.



is this possible ?
Hi All,
I have a VF page witn drop-down field "Selection" (value1 - 'All'; value2 - 'Partial') and a list of objects. For each object there is a checkbox. If value1 - 'All' is selected in drop-down - all of checboxes should be checked in list. If value2 - 'Partial' is selected in drop-down - than I need to select at least one checkbox.
How can I do this?
Thanks!
 

Hi!
I cannot build this with workflow, so I will need a trigger built to do the following:

Create a task record on the Case object when a Case record is created with Record Type and Account Name is not Null

I have a trigger that fires when an opportunity is updated, as part of that I need to call our API with some detail from the opportunity.

As per many suggestions on the web I've created a class that contains a @future method to make the callout.

I'm trying to catch an exception that gets thrown in the @future method, but the test method isn't seeing it.

The class under test looks like this:

public with sharing class WDAPIInterface {
    public WDAPIInterface() {

    }

    @future(callout=true) public static void send(String endpoint, String method, String body)  {
        HttpRequest req = new HttpRequest();
        req.setEndpoint(endpoint);
        req.setMethod(method);
        req.setBody(body);

        Http http = new Http();
        HttpResponse response = http.send(req);

        if(response.getStatusCode() != 201) {
            System.debug('Unexpected response from web service, expecte response status status 201 but got ' + response.getStatusCode());
            throw new WDAPIException('Unexpected response from web service, expecte response status status 201 but got ' + response.getStatusCode());
        }
    }
}

here's the unit test:

@isTest static void test_exception_is_thrown_on_unexpected_response() {
        try {
            WDHttpCalloutMock mockResponse = new WDHttpCalloutMock(500, 'Complete', '', null);
            WDAPIInterface.send('https://example.com', 'POST', '{}');
        } catch (WDAPIException ex) {
            return;
        }

        System.assert(false, 'Expected WDAPIException to be thrown, but it wasnt');
    }
Now, I've read that the way to test @future methods is to surround the call with Test.startTest() & Test.endTest(), however when I do that I get another error:

METHOD RESULT 
test_exception_is_thrown_on_unexpected_response : Skip

 MESSAGE 
Methods defined as TestMethod do not support Web service callouts, test skipped
So the question is, how do I unit test a @future method that makes an callout?

I have a group of custom activity fields, however I cant find them in either Task or Event, so I am wondering if they are stored some where else?
If i try to query on Force.com explorer:

SELECT  id, custom_field__c FROM EVENT
or
SELECT  id, custom_field__c FROM TASK

No such column on entity task or event
So, the requirement is to create a record on a custom object, from Opportunity.  However, we do not want it to be a related record/list.

1)  I assume, since the resulting record is not related to the Opportunity, I can't just use a hacked URL button to build the record?
2)  I believe I'll have to use JavaScript (unless there's another option) to build the record?  I thought about trying to fire a class from a button click to do this, but I'm just not sure how far to go.
3)  If I do need to use JavaScript, can I have the new record open in a not-saved status, and more importantly, return to the Opportunity after save, or have I just made the entire script overly complex?

Thank you.
Hi

I have 3 fields
Base_Line_Hrs__c,Base_line_Billing_Rate_In_SOW_Currency__c these fields are 'Number format'.
FX_Rate_to_USD__c this field 'Formula(Number)' in this field i written formula like this

IF(
ISBLANK( FX_Rate_to_USD__c ),
Base_line_Billing_Rate_In_SOW_Currency__c * Base_Line_Hrs__c,
Base_line_Billing_Rate_In_SOW_Currency__c * Base_Line_Hrs__c * FX_Rate_to_USD__c
)

But it's not working, I need like this

if the FX rate is blank it multiplies only the Currency and Hrs..
else if FX rate is not blank, then it multiplies Currency, Hrs & FX rate ..

Thanks in adv.
I need to upload activities into CRM. But when I upload using dataloader,how would I disable task reminders?

When I create tasks and login to CRM, I get reminder pop up window on my screen. But I donot want to receive any reminders for the tasks records I upload.

I have thousands of records and I hate to see all the reminder pop up windows.

Is there any way we can disable for just that particular upload? I would like to enable it for all other direct entries through page layout.
I am trying to use a button with onclick javascript to pass today's date into an existing date field, but I get the error message "12/23/2013 is not a valid value for the type xsd:date".  What is the correct way to pass today's date?  My code is below.

{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} /*call the ajax connection*/
{!REQUIRESCRIPT("/soap/ajax/29.0/apex.js")}

var currentDate= new Date();
var month = currentDate.getMonth() + 1;
var day = currentDate.getDate();
var year = currentDate.getFullYear();
var today = (month + "/" + day + "/" + year);

var requestFetchInstall= new sforce.SObject("P4_Contract__c"); /*Initialize a new
sobject to work with, this would need to be changed whatever custom object */
requestFetchInstall.Id = "{!P4_Contract__c.Id}"; /* set var to the record id we are working on */
requestFetchInstall.Fetch_Install_Requested__c =(today); /*set a custom field, you would have to rename it to yours, to the value desired, or any field you choose */
result = sforce.connection.update([requestFetchInstall]); /* update the record we initalized with the id *


window.location.reload(); /* reload the page */

May be you people will smile at me..but i am not able to do this programme

 

<apex:page controller="testdisplay">
<apex:form >
<apex:pageBlock >
<apex:pageBlockSection title="test" >
<apex:outputText value="{!display}" />
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

 

 

public class testdisplay
{

public String display { get; set; }

public static string display()
{
return ('Hi viewers');
}
}

 

 

 

 

I am not getting the output as Hi viewers watz wrong with this programme

Hello, is it possible to remove the 'Reset password' button from the user layout?

 

I want override this button or remove him and create an other.

 

Thanks for the responses.

Hi,

 

I have a Trigger on Insert  which populates a field of Opportunity with Date.today().Time Zone of User and Company is CST.

In Test class assertion is written to check whether the field's value is Date.today() or not.

But the test class fails only for some time around 11:00 to 11:30 AM IST.

I have also put debug statement in test class and trigger to view the Date.today() and then I run the test class.But it shows wired behaviour .In test class Date.today() appears as date of the logged in user but in trigger around 11:00 to 11:25 AM IST  Date.today() is diplayed as the very next Day i.e. if it is 28 th Nov in CST then in trigger it displays 29 th Nov .The same test class works fine rest of the day.

 

Can someone help me.It creates issue since I cannot deploy changes to production in this time span.

When the chatter desktop is created there should be log out option which is not available in chatter desktop.

I think this is necessary for security purpose!

HI, If error occurs when inserting records from data loader to salesforce org. It will be inserting records partially or stops inserting.If it stops inserting, agian we will strat inserting records from starting. Thanks in advance...

it sounds so simple, get a list of similar items and allow the user to edit one field, then click save and return to where you came from. I just do not understand enough to make this happen, can some one take a look? When i hit save i get the page back but no updates have happened 

 

VF page 

 

<apex:page standardController="ERP_Data__c" extensions="opportunityList2Con">

    <apex:form >
        <apex:pageBlock title="{!erp.Chain__c}" >
            <apex:pageMessages />
            <apex:pageBlockButtons >
              <apex:commandButton value="Save" action="{!mysave}"/>
            </apex:pageBlockButtons>
            <apex:pageBlockTable value="{!Opportunities}" var="o" >
                
                <apex:column value="{!o.Account__c}"/>
                
                <apex:column value="{!o.id}"/>
                
                <apex:column value="{!o.Acct_RT_Name__c}"/>
              
                <apex:column headerValue="Program">
                
                    <apex:inputField value="{!o.Program__c}"/>
                    
                </apex:column>
                
            </apex:pageBlockTable>      
        </apex:pageBlock>
    </apex:form>
    
</apex:page>

 and the controler

 

public class opportunityList2Con {
public opportunityList2Con(ApexPages.StandardController controller) {}

erp_data__c erp;
public erp_data__c geterp() {
if (erp == null){                      
erp = [SELECT Chain__c FROM ERP_Data__c WHERE 
    id = :ApexPages.currentPage().getParameters().get('id')];
      }
   return erp;

}

String myTestString = ApexPages.currentPage().getParameters().get('name') ;

// ApexPages.StandardSetController must be instantiated
// for standard list controllers
public ApexPages.StandardSetController seterp {
     get {
        if(seterp == null) {
           return new ApexPages.StandardSetController(
                     Database.getQueryLocator(
                [SELECT name, Account__c ,Acct_RT_Name__c, Chain__c, 
                        Id, Program__c, RecordTypeId    
                 FROM ERP_Data__c  
                 WHERE Chain__c = :myTestString limit 25 ]));
        }
        return seterp;
    }
   set;
 }
 
 
 
 
// Initialize seterp and return a list of records
public list<ERP_Data__c> getOpportunities()  
{
return (list<ERP_Data__c>) seterp.getRecords();
}
public PageReference mysave(){

    seterp.save();  //call the save method on your set controller
    //controller.save();  add this if you want to save your original ERP_Data__c record         
    //as well
    
    
return null;

}
}

 Most of this code I have picked up and modified from other people projects so my understanding  on why some things are here is low. Once i get it working i will spend the time to clean up the naming spacing and comments , thanks in advance!

Hi

 

I have no Apex training but have managed to piece this trigger together with help from these boards! Now i have my trigger in place I need to update all my leads to use it. However I get the  System.LimitException: Too many SOQL queries: 101 error when mass-updating leads.

 

I understand the concept that I'm calling too many SOQL queiers. Anyone willing to help re-code this trigger to bring teh SOQL out of the for loop?

 

trigger updateCCLookupField on Lead (before insert, before update) {

List<Lead> leads = new List<Lead>();

  for (Lead l : Trigger.new)
  { 
  Try
  {
     Campaign_Codes__c AssociatedCC = [SELECT Id FROM Campaign_Codes__c WHERE CodeOnCC__c= :l.Campaign_Code__c];
    l.CC_Lookup__c = AssociatedCC.Id;
  }
  Catch(Exception e)
  {
  l.CC_Lookup__c = null;
  } 
  }
}

hi group,

 

                 In E-Mail to Case what are the mandatory values to be passed . And can any one explain to me in detail about E-mail to Case, In the sense where to be used and why ...

       

     Thanks for giving reply in (advance)

                    Thanks and Regards

                            Varma