• Vinoth Vijaya Basker
  • SMARTIE
  • 683 Points
  • Member since 2015

  • Chatter
    Feed
  • 22
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 83
    Replies
i want to find out test code coverage apex class so that i ask my devloper to increase the code coverage, how do i find , pls suggest
I am trying to convert date in yyyy-mm-dd format but I am getting result in yyyy-dd-mm format.

Initial Value of DateField: 
datetimeinquiry=2019-06-11 00:00:00

Tried newInstance
    convertToStr = DateTime.newInstance(datetimeinquiry.year(),datetimeinquiry.month(),datetimeinquiry.day()+1).format('yyyy-MM-dd'); 
Result:2019-06-11

Tried formatGMT:
    system.debug('formatGMT: '+datetimeinquiry.formatGMT('yyyy-MM-dd'));
Result:2019-06-11
Hey guys, I've got a very simple trigger:
 
trigger TF on Account (before update, before insert) {
    for (Account a: trigger.New) {
        a.TestField__c = 'test';
    }

}

I wrote a test class for it:
 
@isTest
public class TFTest {
    @isTest static void testName() {
       Account cat = new Account();
        cat.Name = 'cat';
        insert cat;
        System.assertEquals('test', cat.TestField__c);
       }

}
When I run the test, I get an error:
 
Error Message	System.AssertException: Assertion Failed: Expected: test, Actual: null
Stack Trace	Class.TFTest.testName: line 7, column 1

I have two questions:
1) What am I doing wrong?
2) How come my trigger does not need to be tested and works already? I added an Account record already and the field gets populated.

Have a nice day


 
Hi,

I'm trying to create a truly bespoke Org for a project and would like to customise the look of my homepage.

When I click the pencil icon on the navigation bar, I can shuffle all the apps/items but there is no option to remove them.

I'm trying to reduce the clutter in my nav bar.

Is there anyway to do this?

Thanks!
Hi All,

I'm really struggling to find out how to add a welcome message on the homepage / sidebar in Lightning. 

Previously I could do this in SF Classic:
Setup > Customize > Home > Homepage Components > Edit Messages and Alerts 

I'm using the Trailhead sandbox environment for a work project. 

Any support would be massively appreciated. 
I am getting an error while i am creating custom controller visualforce page  with account fields. getting error " Mycustom Compile Error: Method does not exist or incorrect signature: [System.PageReference].get(String) at line 5 column 184" 
my programme is

public class Mycustom {
public Account acc;
public Mycustom()
{
acc=[select id,name,phone,industry,website,rating,billingcity,description,fax,shippingcity,annualrevenue,billingcountry,shippingcountry from account where id=:apexpages.currentpage().get('id')];
}
public account getaccount()
{
return acc;
}
public pagereference savemethod()
{
update acc;
pagereference pageref=new apexpages.standardcontroller(acc).view();
return pageref;
}
}


and my controller page is

<apex:page controller="Mycustom" tabstyle="Account">
<apex:form >
<apex:pageblock title="account detail">
<apex:pageblocksection> title="account details1">
<apex:inputfield value="{account.Name}"/>
<apex:inputfield value="{account.phone}"/>
<apex:inputfield value="{account.industry}"/>
<apex:inputfield value="{account.rating}"/>
<apex:inputfield value="{account.website}"/>
</apex:pageblocksection>
<apex:pageblockSection title="account deatail2">
<apex:inputfield value="{account.billingcity}"/>
<apex:inputfield value="{account.billingcountry}"/>
<apex:inputfield value="{account.description}"/>
<apex:inputfield value="{account.fax}"/>
<apex:inputfield value="{account.shippingcity}"/>
<apex:inputfield value="{account.shippingcountry}"/>
<apex:inputfield value="{account.annualrevenue}"/>
</apex:pageblockSection>
</apex:pageblock>
</apex:form>
</apex:page>
Hi Everyone,

i have scenario . can you suggest me how to write trigger.
scenario is i have a standard object case. i have created a custom field which is of type checkbox.
i have created a record. on the record detail page we can post some comments using @mention xyz user.

when some one is posted comments using @mention username(owner of the record), i want to make that checkbox true.
what is relationship between case and casefeed.
can some one tel me how to write trigger for this.

Thanks
Lakshman
Hello,

I have a Picklist with 10 values already exsisting.

I want to add new 4 values which should only be available for specifu record type on the same object.
I have created same fields for Customer and oppertunity object.When i create a new record for customer that fields values should update in Oppertunity also.For this i have written a trigger between these two objectwith the event after insert, But i am getting error.
Please correct the below code if it is wrong.
trigger updateField on Contact (after insert) {
 Set<Id> Ids= new Set<Id>();
    for (Contact contact : Trigger.new)
    {
    Ids.add(customer.Id);   
    }
  List<Contact> contactList = new List<Contact>([Select Id,SMETS_Meter_version__c,Meter_Status__c  FromContact where Id in :Ids]);    
       for(Contact temp : contactList )
       {
       Oppertunities oppor = new  Oppertunities();
       oppor.SMETS_Meter_version__c = temp.SMETS_Meter_version__c;
       oppor.Meter_Status__c = temp.Meter_Status__c;
       insert oppor;
       }
     }
example
 name: {!.v.name}
address:{v.address}
phone:{v.phone}

output:

name:        bob
address​​​​​:    California
Phone:      ​852-895-7854

Please tell me your suggestions​
HI,

What happen we have mentioned @istest(seeall=false ).

Regards,
viswa.