• praveen sone
  • NEWBIE
  • 59 Points
  • Member since 2014
  • SSDA

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 27
    Replies
Hello,

for a profile, I have a black tab on tob calles "XYZ interne", i am wondering why ?
 
  • September 16, 2016
  • Like
  • 0
Just a warning - If you have try to display a Visualforce page that contains a pick list field with global picklist values or "strict" picklist values AND the value assigned to the field is NOT on the strict list, your page will throw an "An internal server error has occurred." Be careful what you type. 

"Forewarned is forearmed."
Hello,

for a profile, I have a black tab on tob calles "XYZ interne", i am wondering why ?
 
  • September 16, 2016
  • Like
  • 0
I need to write an apex trigger that takes information from some of Opportunity fields and uses them to generate a value for a custom field.
For example, say I have a custom field called "All Opportunity Members." When I create a new opportunity or any time it is edited, the trigger should fire and (using apex code i would write) and populate the Area Code field with the Opportunity Contact Role Members and the Opportunity team members.

The problem is that the triggers I write don't seem to fire correctly. I just start to learn how to write a little code but I am struggling. How can I make a trigger that fires correctly when a record is created or edited?
 
Already I have a controller for the task as below:
public class ContactListController {
    public List<Contact> ContactList {
        get {
            If(Contact.Account.Name != Null) {
                If(ContactList == Null) {
                    ContactList = [SELECT Name, Account.Name, Phone, Email, MailingCity, MailingState, MailingPostalCode FROM Contact WHERE Account.Name != Null 
                                      ORDER BY Account.Name ASC]; 
                } 
            }
            return ContactList;
        }
           set;
    } 
}

the page for this controller is:
<apex:page controller="ContactListController"> <apex:form > <apex:pageBlock > List Of Contacts with Accounts: <apex:pageBlockTable value="{!ContactList}" var="contact" cellpadding="0" cellspacing="0" width="50%"> <apex:column value="{!contact.Account.Name}" onclick="ascending" ondblclick="descending"/> <apex:column value="{!contact.Name}"/> <apex:column value="{!contact.Phone}"/> <apex:column value="{!contact.Email}"/> <apex:column value="{!contact.MailingCity}"/> <apex:column value="{!contact.MailingPostalCode}"/> <apex:column value="{!contact.MailingState}"/> </apex:pageBlockTable> </apex:pageBlock> </apex:form> </apex:page>


But now i want to dynamic query to the  if I click the mouse to the column of each in the table it's give the ascending order and then I click the double click it's give the descending order for the table data.

thank you 
Mohan Raj
hi this is koti 
 i will  get this type of "Argument must be an object that implements Database.Batchable " in shedule apex program 
 how to solve this error pls give me the answer
Hi I am trying to do is write a validation rule for a custom object where users can pass in a from and to date. Now I am trying to make sure that they can't put another record between those 2 dates i.e. from and to dates
for example:
record1: from: 23 dec 2015 to: 24 dec 2015 fine
record2: from: 24 dec 2015 to: 25 dec 2015 Error
record3: from: 1 dec 2015 to: 23 dec 2015 Error
record4: from: 1 dec 2015 to: 11 dec 2015 fine
  • September 16, 2016
  • Like
  • 0
Hi, everybody! I wand to create a button on visualforce page "Send Manual Reminder". When user clicks on it page must redirect to page on which he will see email template, change it, if he need, and send email to someone. Please, tell me some way how can i do this. Thank you a lot.
And can I able to write a same concept in the inner class.
I'm having an issue completing the approval process challenge even though I am pretty confident I have it all correct.

It's telling me "Challenge Not yet complete... here's what's wrong: 
The process did not set the correct Type value on submitting for approval"

But I do have it setting to pending, as you can see here
User-added image

What can I do? I need to get this complete to access additional training(vetforce)
I'm Getting the following message when I execute an auto launch flow from a button.  I immediately try it again and it works.  this is consistent everytime I open the Opportunity Page and press the button the first time.

Any Ideas, apparentlyl I can't open a case with support for this due to my subscription.

Rod



An error occurred at element Create_Order (FlowRecordCreate).
UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support: 1524999548-229980 (346687398)
I am getting this message : Challenge Not yet complete... here's what's wrong: 
All the expected custom fields for the Trail__c object could not be found. But I don't find any mistake. Can anyone please help
 
Hi,
I have completed the challenge,i got Compass of Wisdom badge, but the Cloak of Adventure badge hasn't appeared and no information about the sweatshirt.

What do I need to do?

Thanks
Anil.B

There is problem with my  developer org. A code which is just a copy paste of the code provided in trailhead: Quick start Apex: Add a method to the class. (https://developer.salesforce.com/trailhead/project/quickstart-apex/quickstart-apex-2) is not getting saved.

However we tried this code in my friends org, it got saved and she got the points.User-added image
Need test class for the following trigger with atleast 75 code coverage 

The below trigger  : Opportunity has a field where the associated  contact name should be populated (after lead conversion to acc,contact,opp)
trigger ContactNameUpdate on Lead (after update) 
{
  for(Lead l : System.Trigger.new) 
  {
    
   if(l.IsConverted && l.ConvertedOpportunityId != null) 
   { 
       
    Opportunity opp = [SELECT Id,Contact__c FROM Opportunity WHERE Id =: l.ConvertedOpportunityId];
    If(opp.Contact__c == null)
    { 
     opp.Contact__c = l.ConvertedContactId;
     update opp;
    }
   }
    
     
      
  }
Please give me the test class to cover 75 of code coverage to migration.......Very Critical
Please give me the test class to cover 75 of code coverage to migration.......Very Critical
HELP!
I am getting the below error when I try to check my challenge:
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Update failed. First exception on row 0 with id 0016100000PUJDEAA5; first error: CANNOT_EXECUTE_FLOW_TRIGGER, The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 301610000005A3l. Contact your administrator for help.: []

How do I fix this?
Hi I'm stuck up in writing the test classes for the following triggers to achieve code coverage while deployment 

What would be the test class for the following trigger 

trigger 1

trigger checktheLeadCheckBox on Contact (after update) 
{
  for(Contact c : Trigger.New)
  {
    List<Lead> li = [select Id, Customer_of_PubKCyber__c,Email,Customer_of_PubKLaw__c from Lead where Email =: c.Email AND IsConverted =: false]; 
    for(Lead l : li)
    {
     If(l.Id != null)
     {
      
      
       l.Customer_of_PubKCyber__c=c.Customer_of_PubKCyber__c;
       l.Customer_of_PubKLaw__c = c.Customer_of_PubKLaw__c;
       update l;
     }
    }
  }
}

Trigger 2

trigger updatecontactcheckbox on Opportunity (after insert, after update) 
{    
    for(Opportunity o : Trigger.New)
    {
  
     if( o.Contact__c != null)                 
     {      
       Contact c = [select Id, Customer_of_PubKCyber__c,Email,Customer_of_PubKLaw__c from Contact where Id =: o.Contact__c ]; 
       
if((o.Subscription_Start_Date__c <= System.Today()) && (o.Subscription_End_Date__c >= System.Today()) && (o.Product_Name__c == 'PubKCyber Newsletter'))
    {
         c.Customer_of_PubKCyber__c = True;
        
    }
    else if(o.Product_Name__c == 'PubKCyber Newsletter')
         { 
           c .Customer_of_PubKCyber__c = false;
           
         }
          
if((o.Subscription_Start_Date__c <= System.Today()) && (o.Subscription_End_Date__c >= System.Today()) && (o.Product_Name__c == 'PubKLaw Newsletter'))
        { 
          c.Customer_of_PubKLaw__c= True;
         
        }
       else if(o.Product_Name__c == 'PubKLaw Newsletter')
         { 
           c.Customer_of_PubKLaw__c = false;            
         }
       update c; 
      }   
     }  
  }
Could anyone tell me how to add Trailhead Badge on LinkedIn. I missed it when completed the Badge. Is that functionality available now?
  • January 30, 2016
  • Like
  • 0
Hi,

I have written a test class for this rest callouts but its not covering 100% code coverage. Can someone please help me

It throws me error when I run the test class 
Class.AnimalLocator.getAnimalNameById: line 16, column 1 Class.AnimalLocatorTest.testcallout: line 7, column 1

Apex class 

public class AnimalLocator {

public static string getAnimalNameById (integer i)
{
    string a;
    Http ht = new Http();
        HttpRequest request = new HttpRequest();
        request.setEndpoint('https://th-apex-http-callout.herokuapp.com/animals/' + i);
        request.setMethod('GET');
        HttpResponse response = ht.send(request);
        // If the request is successful, parse the JSON response.
    if (response.getStatusCode() == 200) 
    {
            Map<String, Object> result = (Map<String, Object>)JSON.deserializeUntyped(response.getBody());
             Map<string,object> cc = (Map<string,object>) result.get('animals');
        a = (string)cc.get('name');
    }
    return a;
  }
}


Test class

@isTest
public class AnimalLocatorTest 
{
@isTest static void testcallout()
{
      Test.setMock(HttpCalloutMock.class, new AnimalLocatorMock()); 
    string response = AnimalLocator.getAnimalNameById (2); 
String expectedValue = '{"animal":{"id":2,"name":"bear","eats","berries, campers, adam seligman","says":"yum yum"}}'; 
system.assertEquals('eats', response);
   
   }
}

@isTest
global class AnimalLocatorMock implements HttpCalloutMock 
{
global HTTPResponse respond(HTTPRequest request) 
{
        // Create a fake response
         HttpResponse response = new HttpResponse(); 
     response.setHeader('Content-Type', 'application/json');
    response.setBody('{"animal":{"i":2,"name":"bear","eats":"berries, campers, adam seligman","says":"yum yum"}}'); 
        response.setStatusCode(200);
        return response;
}
}
 
  • January 29, 2016
  • Like
  • 0