• Rajiv Bhatt 16
  • NEWBIE
  • 158 Points
  • Member since 2015
  • Technical Consultant
  • APTTUS


  • Chatter
    Feed
  • 4
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 0
    Questions
  • 61
    Replies
Dear All,

I am creating a visualforce page which opens when we click on a 'Custom' button (/apex/CaseDetail?CaseId={!Case.Id}) placed on Case detail page. I am not able to pass the Account Name of the record into this custom page. 

Below mentioned is the code - I am sure there is some issue with the code..

<apex:page showHeader="false" sidebar="false" standardController="Case">
  <apex:form >
    <apex:pageBlock title="Case Details" mode="maindetail">
    
    <apex:pageBlockButtons location="top">
            <apex:CommandButton value="Print" onclick="javascript:window.print(); return false"/>
            <apex:CommandButton value="Close" onclick="window.close(); return false;"/>
    </apex:pageBlockButtons>
    
    <apex:pageBlockSection id="CaseSumary" columns="3" title="Case Summary" collapsible="true">
          
          <apex:pageBlockSectionItem >
          <apex:outputPanel >
                   <apex:outputLabel value="Account Name:" for="account"/>
                   <apex:outputField id="type" value="{!Case.AccountId}"/>
          </apex:outputPanel> 
          </apex:pageBlockSectionItem>
                                          
     </apex:pageBlockSection>
      
    </apex:pageBlock>
  </apex:form>
</apex:page>


And here is the screenshot of visual force page. You can see that I am not able to get value of the account record.

User-added image

Thanks,
Manpreet Singh
There are a list in my page, whose records is coming from object, quering by apex class. 
How can I batch remove records from this list?
 
Is there a way to access the configured Country and State picklists (Setup > Data Management > State and Country Picklists) via the API?
 
Can this be done ?

Every time I erase a field name by taking out the whole XML that defins the field like

<fields> <fullName>Comments__c</fullName> <description>add your comments about this object here</description> <inlineHelpText>This field contains comments made about this object</inlineHelpText> <label>Comments</label> <length>32000</length> <type>LongTextArea</type> <visibleLines>30</visibleLines> </fields>

and save to the server , nothing happens and my local copy get refreshed with the orignial schema. 

I thought about developing my own code using the MetaDataAPI but looks like del function is not supported ?

https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/sforce_api_objects_customfield.htm

Jay



Jay
I have a problem with Working with Custom Lightning Components in Admin Trail - Intermediate.
I cannot install unmanaged package ContactsToday which is needed to finish Chellenge - https://login.salesforce.com/packaging/installPackage.apexp?p0=04tj0000001mMYj
I receive message: This app is taking a long time to install. ​You will receive an email after the installation has completed.
I am a sfdc developer want to work on integration.....Plz sugges a book or documentaion or links . Which is use full for all kind of integrations, and integration arctecture, best ways and methods.
 
Hello,

I am new at reviewing Apex triggers and Apex Classes. I am trying to edit two Apex Triggers on the Application and am having trouble figuring out how to do so. I logged into my Sandbox since I read a few discussions about having to edit Apex Triggers via Sandbox and deply, however, it seems like a bit much when all I need to do is add one condition to the trigger. Is someone able to assist me with this today? Am I able to edit the trigger in production at all?
What are the steps to take to help me in this process?

I greatly appreciate the help.
there are 3 radio buttons in vf page asia,europe and america. if we click on the radio button then the partucular data of that radio button has to refresh.
  • April 28, 2015
  • Like
  • 0
Hi,

We are querying the chatters created date. Its working perfectly. But if the comments posted yesterday it is showing as "Yesterday" or "18hrs ago" like in FB, but it should the exact date and time instead of that.

Thanks,
Vetri
Dear All,

I am creating a visualforce page which opens when we click on a 'Custom' button (/apex/CaseDetail?CaseId={!Case.Id}) placed on Case detail page. I am not able to pass the Account Name of the record into this custom page. 

Below mentioned is the code - I am sure there is some issue with the code..

<apex:page showHeader="false" sidebar="false" standardController="Case">
  <apex:form >
    <apex:pageBlock title="Case Details" mode="maindetail">
    
    <apex:pageBlockButtons location="top">
            <apex:CommandButton value="Print" onclick="javascript:window.print(); return false"/>
            <apex:CommandButton value="Close" onclick="window.close(); return false;"/>
    </apex:pageBlockButtons>
    
    <apex:pageBlockSection id="CaseSumary" columns="3" title="Case Summary" collapsible="true">
          
          <apex:pageBlockSectionItem >
          <apex:outputPanel >
                   <apex:outputLabel value="Account Name:" for="account"/>
                   <apex:outputField id="type" value="{!Case.AccountId}"/>
          </apex:outputPanel> 
          </apex:pageBlockSectionItem>
                                          
     </apex:pageBlockSection>
      
    </apex:pageBlock>
  </apex:form>
</apex:page>


And here is the screenshot of visual force page. You can see that I am not able to get value of the account record.

User-added image

Thanks,
Manpreet Singh
hi,
i  have 4 fields (agreement,driver,period,sales) in my custom object.in db it will save like followingUser-added image 
i want to show in visual force page like following
User-added image
please help me how can fill sales based on period values. any links is there please send me

 
Is it possible to have this trigger only for specified profiles?


trigger EventDelete on Event (before delete)

    {

     if (Trigger.isDelete) {

           for (Event sb : Trigger.old)

      {

             sb.addError('Cannot delete an Event');

      }

     }}
Dear all,
I have 2 custom fields on the Contract object. 
Contract Status and Contract Validity

I need to ensure that everytime the Contract record is edited and saved, the Contract Status and Contract Validity fields are updated in the corresponding custom fields on the Account Object. 
I need trigger and test class!!
Thanks 
I'm working in our sandbox currently on this method:
public PageReference proceed(){
        DEALER = true;
        if((vin != null && vin != '')){
            if(vin.containswhitespace()){
                ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Your VIN # entry contains a blank space, which may happen during copy and pasting from a different source, please check entry and try again.'));
                return null;
                }
            qry = 'SELECT ID, Vin_Number__c, Insurer__r.Name, Contract_Status__c, Vehicle_Make__c, Vehicle_Model__c, Vehicle_Year__c, Name, Benefits_Options__c, Batch__r.Product_Group_Name__c, Policy_Type__c, Contract_Number__c, Term__c, Class__c, Effective_Date__c, Expiration_Date__c FROM MG_Contract_Holder__c WHERE (Vin_Number__c =:vin) AND Batch__r.Product_Group__r.Service_Contract__c = false';    
            searchCreate();
        if(contractList.size() > 0){
            CONS = true;
            searchHistory();
            RETURNDEALER = false;
            return page.CM_WebClaimStep1;
            }
        else{
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'No contract found matching the information you entered, check entry and try again.'));
            return null;    
            }
            }
        else{
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.ERROR,'Please make sure the VIN Number field is filled in before searching.'));
            return null;
            }
            return null;
            }

public void searchCreate(){
        contractList = new List<ContractWrapper>();
            for(MG_Contract_Holder__c c : database.query(qry)){
                    if(c.Insurer__r.Name == 'NSD'){
                        NSD = true;
                        }
                    contractList.add(new contractWrapper(c));
                    }
                }
And I keep getting this error message when I execute the search: Collection size 2,327 exceeds maximum size of 1,000
I know from looking at other people's posts who have dealt with this error message is that it means I'm trying to populate a list on a VF page with more than 1,000 rows, except the thing is in this case I'm not trying to do that at all.  The sandbox I'm working in at the moment is only a partial data one and there is literally only one record which should be returned for this query based on the criteria.  And the whole process that this is contained in is working fine in production, I was only testing out an unrelated change which we'll be pushing out soon but I keep running up against this.  Does anyone have any thoughts on what may be causing this?
the code bellow:
SFRestRequest *request = [SFRestRequest requestWithMethod:SFRestMethodPOST path:@"
/services/apexrest/MyRestApi/MyFavorite" queryParams:nil];
    request.endpoint = @"/services/apexrest/MyRestApi/MyFavorite";
    [[SFRestAPI sharedInstance] sendRESTRequest:request failBlock:^(NSError *e){
        NSLog(@"error: %@", e);
    } completeBlock:^(id success){
        NSLog(@"success: %@", success);
    }];
the response print in the console:
​success: (null)

anyone can tell me why?? thenks
 
Is this possible?

from the trigger:

//call out to the class
returnStateAbbreviations f = new returnStateAbbreviations();
f.returnStateAbbreviations(stateName);

//attempt to return from class
 public with sharing class returnStateAbbreviations 
{  
    public string returnState(string stateName)
    { 
        String abbr;
        String stateAbbr;
        
        if(stateName=='Alabama')
        {
            stateAbbr = 'AL';            
        } //
// etc
        abbr = stateAbbr;
        return abbr;        
    }  

}

how would I then receive abbr back at the trigger?
Hello,

I have like to hide the owner email address in salesforce, when i have to send the email via email template in salesforce. it come likes

<noreply@.com>  salesforce owneremail id display here. but i have like this type <noreply@.com> not come in salesforce owner id. What we can do...
There are a list in my page, whose records is coming from object, quering by apex class. 
How can I batch remove records from this list?
 
Hello there! I have a requirement to clear just a subset of an object's fields. I thought I could use the fieldset and define a StandardController Extension class to work with the fieldset and clear the fields. The only other option I can think of is obj.fieldName = null; for the 50-odd fields that I have. 

Is this possible? Please let me know how. Thanks!
 
I have a custom object called Questions. This object has a lookup to itself because a question can have additional questions which depend on their parent question. We need to insert 200+ at a time so I wrote an apex class that simply inserts the collection given to it:

global with sharing class QuestionRestController{
   global class RequestBody {
       global List<Question__c> questions;
   }

    @HttpPost   
    global static List<Question__c> createBulk(QuestionRestController.RequestBody req) {
        insert req.questions;
        return req.questions;
    }
}

I get this error: System.DmlException: Insert failed. First exception on row 94; first error: INVALID_FIELD, Foreign key external ID: 966.0 not found for field MyExtId__c in entity Question__c no matter what I try.

I figured I could sort the questions before sending the request so that the parent questions are always inserted first but I still get the errors. I've added debug statements so I could verify the order of the questions prior to inserting and they are ordered correctly. I've also tried to insert each question by itself:

for (Question__c question: req.questions) {
    insert question;
}

But then I get a System.LimitException because I'm sending 200+ questions.

So what is the proper way to insert a list of custom objects which have a lookup to itself when the parent and child are both being inserted with the same request?

Thanks
Can this be done ?

Every time I erase a field name by taking out the whole XML that defins the field like

<fields> <fullName>Comments__c</fullName> <description>add your comments about this object here</description> <inlineHelpText>This field contains comments made about this object</inlineHelpText> <label>Comments</label> <length>32000</length> <type>LongTextArea</type> <visibleLines>30</visibleLines> </fields>

and save to the server , nothing happens and my local copy get refreshed with the orignial schema. 

I thought about developing my own code using the MetaDataAPI but looks like del function is not supported ?

https://developer.salesforce.com/docs/atlas.en-us.api_tooling.meta/api_tooling/sforce_api_objects_customfield.htm

Jay



Jay