- Vinoth Vijaya Basker
- SMARTIE
- 683 Points
- Member since 2015
-
ChatterFeed
-
22Best Answers
-
0Likes Received
-
0Likes Given
-
1Questions
-
83Replies
Testing class for the simpliest of codes
Hey guys, I've got a very simple trigger:
I wrote a test class for it:
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
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
- Jan Kopejtko 2
- January 29, 2020
- Like
- 0
- Continue reading or reply
Can I remove the standard tabs in a Dev Org?
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!
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!
- Eser Ekici
- January 25, 2020
- Like
- 0
- Continue reading or reply
custom controller of visualforce page
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>
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>
- chandu kumar
- December 22, 2015
- Like
- 0
- Continue reading or reply
Chatter post on case record
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
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
- lakshman.matti
- December 18, 2015
- Like
- 0
- Continue reading or reply
Cross Object Trigger to make a filed Mandatory
Hello,
im fairy new to triggers and im having some issues creating a trigger that will make a field mandatory. I tried to do this with a basic Validation rule however i beleive this exceeds salesforce point and click capabilities.
Case:
Im trying to create a validation rule where a user would be required to fill out the "Distributor_Name__c" name on the quotes object if "silver" is slected from the "Proofpoint_Advantage_Program_Level__c" field on the accounts object.
"Distributor_Name__c" is a lookup field that looks up accounts and "Proofpoint_Advantage_Program_Level__c" is a picklist.
i have tried creating a cross object validation rule however on the quotes object account fields do not show up. Is this possible? if not would this be done via trigger? This is what i attempted however iv had little success. Any help would be appreciated.
trigger Requiredistyfield on Quotes (Before insert,before update) {
for (account quoteloop: Trigger.New){
if (quoteinloop.Proofpoint_Advantage_Program_Level__c== 'silver'l)
accountinloop.Distributor_Name__c!=NULL;
}
}
- Sunny Sohail
- December 18, 2015
- Like
- 0
- Continue reading or reply
Trigger to update a related record?
Hello
We have a custom object Individual Email Sends and I'm trying to write a trigger that updates a text field (Emails__c) on the related Account (lookup field).
So every time a new Individual Email is sent, it would then add the name of this email to the Email__c field, without deleting the previous data in it.
I know I'll need to create a List of all the Individual Email Sends, with after insert and after update.
Then a List of related Accounts that need to be updated, but how do I find the related Accounts for it?
Thanks!
We have a custom object Individual Email Sends and I'm trying to write a trigger that updates a text field (Emails__c) on the related Account (lookup field).
So every time a new Individual Email is sent, it would then add the name of this email to the Email__c field, without deleting the previous data in it.
I know I'll need to create a List of all the Individual Email Sends, with after insert and after update.
Then a List of related Accounts that need to be updated, but how do I find the related Accounts for it?
Thanks!
- SF Admin.HRG
- December 17, 2015
- Like
- 0
- Continue reading or reply
Reports showing different results to different uses
Hello,
Why is it that the same report contents show different number of records to different users ?
thanks for suggestions !
Why is it that the same report contents show different number of records to different users ?
thanks for suggestions !
- Ab
- December 16, 2015
- Like
- 0
- Continue reading or reply
Date field Adding by 1 day if sunday
How to write a formula for adding one day if the selected date is sunday
Thanks in advance.
Thanks in advance.
- karthikeya 2
- December 14, 2015
- Like
- 0
- Continue reading or reply
Report | Date | Next 3 weeks | dont work ?
Hello,
I specified the date as "Next 3 weeks" but it shows me all the results with that date, Where am i going wrong ?
I specified the date as "Next 3 weeks" but it shows me all the results with that date, Where am i going wrong ?
- Ab
- December 14, 2015
- Like
- 0
- Continue reading or reply
Getting this Error: Field Name does not exist. Check spelling.
Hi,
I have taken the formula field to pull contact name from other custom object..........but it's showing the error Field Name does not exist. Check spelling.
contact is parent
custom object is Child
Lookup field is Practitioner_Name__c
I have given like dis: Practitioner_Name__r.Name
But error is coming.....Pls help me out.
Adv Thnx
Siv
I have taken the formula field to pull contact name from other custom object..........but it's showing the error Field Name does not exist. Check spelling.
contact is parent
custom object is Child
Lookup field is Practitioner_Name__c
I have given like dis: Practitioner_Name__r.Name
But error is coming.....Pls help me out.
Adv Thnx
Siv
- VSK98
- December 14, 2015
- Like
- 0
- Continue reading or reply
Validation rule for specific profiles
Hello,
I have a validation rule.
I want it only for certain profiles,
How can i do it ?
I have a validation rule.
I want it only for certain profiles,
How can i do it ?
- Ab
- October 19, 2015
- Like
- 0
- Continue reading or reply
New to Salesforce---Need help with some fundamentals!
Hi All,
I am new to Salesforce. Just started learning. I have few basic questions as below. It would be great to learn things from you.
1) How to write a validation rule on Opportunity object to make sure that Description is not empty. If the description is empty it should throw an error.
2) Created one formula field called "Auto Complete" of type checkbox. How to make this field to true when the opportunity stage = 'Closed Won'.
3) Created one custom field called "Is Closed" of type checkbox. How to create a workflow rule to make this field to true when the opportunity stage = 'Closed Won'.
4) There are two custom fields - "DOB" and "Age", how to populate the "Age" value automatically when the DOB is selected?
Thank you!
I am new to Salesforce. Just started learning. I have few basic questions as below. It would be great to learn things from you.
1) How to write a validation rule on Opportunity object to make sure that Description is not empty. If the description is empty it should throw an error.
2) Created one formula field called "Auto Complete" of type checkbox. How to make this field to true when the opportunity stage = 'Closed Won'.
3) Created one custom field called "Is Closed" of type checkbox. How to create a workflow rule to make this field to true when the opportunity stage = 'Closed Won'.
4) There are two custom fields - "DOB" and "Age", how to populate the "Age" value automatically when the DOB is selected?
Thank you!
- Mia P
- October 10, 2015
- Like
- 0
- Continue reading or reply
Get the record type of Case
Hi all,
I need to check the record type we selected when we create the case. As an example please check below screenshot.
i need to capture which record type user has created (i need to capture that in Triger.Insert
Thanks alot
I need to check the record type we selected when we create the case. As an example please check below screenshot.
i need to capture which record type user has created (i need to capture that in Triger.Insert
Thanks alot
- Thathula
- September 23, 2015
- Like
- 0
- Continue reading or reply
Making a field mandatory for certain opportunity stages
I am trying to build a Validation Rule that if our opportunity stage is Closed Won, Closed Lost, No Decision, that the custom resolution feilds we created for resolution need to be filled out. I read some old forms and I was told to use a formula like this, but it does not seem to be working. Is there something I am doing wrong?
Thanks in advance
AND (
TEXT(StageName) = "Closed Won,Closed Lost,No Decision",
ISBLANK( Resolution_Date__c ))
Thanks in advance
AND (
TEXT(StageName) = "Closed Won,Closed Lost,No Decision",
ISBLANK( Resolution_Date__c ))
- Vinnie Brezinsky
- September 23, 2015
- Like
- 0
- Continue reading or reply
Trigger firing 3x when should only fire once
This is the code firing multiple times when the oppty stage is changed to closed won. At the same time the oppty is marked closed one, I have potentially two WFRs firing. One WFR checks a date field. If that date field is blank, then it auto populates it with a calculated date. The second WFR fires if the date field changes and just copies that date adding one day to it.
Those two WFRs firing makes the trigger fire 2 more times. What can be changed int eh trigger to make it only fire once when the oppty is changed to closed won the first time. Seems there needs tob e an ISCHANGED clause but I do not know how to add that.
- Leonard Silon
- September 22, 2015
- Like
- 0
- Continue reading or reply
Adding records to Queue
I am trying to figure out how Queue works, so I created a new queue in Leads but now I can't figure out how exact can a record be manually added to the queue list. Any help is appreciated thank you! :)
- jkc
- September 20, 2015
- Like
- 1
- Continue reading or reply
Edit record from VF page with custom controller
Currently I need your expert help to solve one requirement. Hopefully you will help me.
Requirement
One VF page which will show a list of User(Manage User) data. And user will able to update Active field from that list. Means user can uncheck Active field and save so that User will be inactive in database.
My Implementation
I have created a custom controller to fetch specific set of user data. Please find below apex code
public class ReportController{
public List<User> reportRecord{
get{
return [SELECT Name,Username,Country_Code_AZ__c,LastLoginDate,Datediffcalc__c,IsActive FROM User WHERE Datediffcalc__c > 90 and IsActive=true order by Country_Code_AZ__c];
}
set;
}
public PageReference QuickSave(){
return null;
}
}
Also created a VF page where Active field is editable, please find below page code
<apex:page controller="ReportController">
<apex:form >
<apex:pageBlock title="Users List">
<apex:commandButton value="Inactive User" action="{!Quicksave}"/>
<apex:pageBlockTable value="{!reportRecord}" var="val">
<apex:column headerValue="Name" value="{!val.Name}"/>
<apex:column headerValue="Username" value="{!val.Username}"/>
<apex:column headerValue="Country Code" value="{!val.Country_Code_AZ__c}"/>
<apex:column headerValue="LastLoginDate" value="{!val.LastLoginDate}"/>
<apex:column headerValue="Days Since Last Login" value="{!val.Datediffcalc__c}"/>
<apex:column headerValue="Active">
<apex:inputField value="{!val.IsActive }"/>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
<apex:commandButton value="Inactive User" action="{Quicksave}"/>
</apex:form>
</apex:page>
Problem Statement
Actually I am unable to write edit code under PageReference QuickSave() so that when user unchecked that flag and click on save , the updated value will be saved.
Please help me on the above situation or if you have any doc or video which implement same, please forward to me.
Requirement
One VF page which will show a list of User(Manage User) data. And user will able to update Active field from that list. Means user can uncheck Active field and save so that User will be inactive in database.
My Implementation
I have created a custom controller to fetch specific set of user data. Please find below apex code
public class ReportController{
public List<User> reportRecord{
get{
return [SELECT Name,Username,Country_Code_AZ__c,LastLoginDate,Datediffcalc__c,IsActive FROM User WHERE Datediffcalc__c > 90 and IsActive=true order by Country_Code_AZ__c];
}
set;
}
public PageReference QuickSave(){
return null;
}
}
Also created a VF page where Active field is editable, please find below page code
<apex:page controller="ReportController">
<apex:form >
<apex:pageBlock title="Users List">
<apex:commandButton value="Inactive User" action="{!Quicksave}"/>
<apex:pageBlockTable value="{!reportRecord}" var="val">
<apex:column headerValue="Name" value="{!val.Name}"/>
<apex:column headerValue="Username" value="{!val.Username}"/>
<apex:column headerValue="Country Code" value="{!val.Country_Code_AZ__c}"/>
<apex:column headerValue="LastLoginDate" value="{!val.LastLoginDate}"/>
<apex:column headerValue="Days Since Last Login" value="{!val.Datediffcalc__c}"/>
<apex:column headerValue="Active">
<apex:inputField value="{!val.IsActive }"/>
</apex:column>
</apex:pageBlockTable>
</apex:pageBlock>
<apex:commandButton value="Inactive User" action="{Quicksave}"/>
</apex:form>
</apex:page>
Problem Statement
Actually I am unable to write edit code under PageReference QuickSave() so that when user unchecked that flag and click on save , the updated value will be saved.
Please help me on the above situation or if you have any doc or video which implement same, please forward to me.
- Avik Datta
- September 18, 2015
- Like
- 0
- Continue reading or reply
Validation rule : If a user logging with salerep profile , in Opportunity , stage picklist he should be unable to select a value called Needs Analysis.
Hi ALL ,
If a user logging with salerep profile , in Opportunity , stage picklist he should be unable to select a value called Needs Analysis.
please correct my rule :
AND
( $Profile.Name = "Sales Profile" &&
Not(
ISPICKVAL(StageName, "Needs Analysis")
)
)
If a user logging with salerep profile , in Opportunity , stage picklist he should be unable to select a value called Needs Analysis.
please correct my rule :
AND
( $Profile.Name = "Sales Profile" &&
Not(
ISPICKVAL(StageName, "Needs Analysis")
)
)
- Salesforce seekar
- September 16, 2015
- Like
- 0
- Continue reading or reply
Apex class tests failing on picklist state and country
I have several apex class tests that are failing because we switched our state and country address fields to picklists. I tried to correct it in the code but am still getting the same error:
System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, There's a problem with this country, even though it may appear correct. Please select a country from the list of valid countries.: [BillingCountry]
Stack Trace: Class.Z_PaymentMethodCaptureControllerTest.createTestAccount: line 276, column 1 Class.Z_PaymentMethodCaptureControllerTest.testAppendMessages: line 185, column 1
When creating the account as part of the test, I code it to input United States, a value in our picklist field for BillingCountry.
Tried to research answers but am coming up dry. Any help out there?
System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, There's a problem with this country, even though it may appear correct. Please select a country from the list of valid countries.: [BillingCountry]
Stack Trace: Class.Z_PaymentMethodCaptureControllerTest.createTestAccount: line 276, column 1 Class.Z_PaymentMethodCaptureControllerTest.testAppendMessages: line 185, column 1
When creating the account as part of the test, I code it to input United States, a value in our picklist field for BillingCountry.
Tried to research answers but am coming up dry. Any help out there?
- James Merson
- September 15, 2015
- Like
- 0
- Continue reading or reply
How to find Scheduled Date of Scheduled actions of Process
Hi All,
For time based workflow actions, we can monitor using Monitoring window of Time based workflow actions. Through Scheduled Date column, we can know when(Date/Time) action will be executed.
For Scheduled Actions of Process, I would like to know the Scheduled Date of scheduled actions.
In Flows, I could only see the Paused Date. Please help me to find the way to know Scheduled date of Scheduled actions of Process.
Thanks,
Vinoth
For time based workflow actions, we can monitor using Monitoring window of Time based workflow actions. Through Scheduled Date column, we can know when(Date/Time) action will be executed.
For Scheduled Actions of Process, I would like to know the Scheduled Date of scheduled actions.
In Flows, I could only see the Paused Date. Please help me to find the way to know Scheduled date of Scheduled actions of Process.
Thanks,
Vinoth
- Vinoth Vijaya Basker
- June 01, 2016
- Like
- 0
- Continue reading or reply
how to run all test class to find code coverage
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
- Somasundaram Subramanian
- July 17, 2023
- Like
- 0
- Continue reading or reply
Issue while converting date in yyyy-mm-dd Format
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
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
- smriti sharan19
- October 31, 2020
- Like
- 0
- Continue reading or reply
Testing class for the simpliest of codes
Hey guys, I've got a very simple trigger:
I wrote a test class for it:
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
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
- Jan Kopejtko 2
- January 29, 2020
- Like
- 0
- Continue reading or reply
Can I remove the standard tabs in a Dev Org?
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!
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!
- Eser Ekici
- January 25, 2020
- Like
- 0
- Continue reading or reply
How do I add a Welcome Message in the Homepage/Sidebar in Lightning?
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'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.
- Eser Ekici
- January 25, 2020
- Like
- 0
- Continue reading or reply
custom controller of visualforce page
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>
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>
- chandu kumar
- December 22, 2015
- Like
- 0
- Continue reading or reply
Chatter post on case record
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
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
- lakshman.matti
- December 18, 2015
- Like
- 0
- Continue reading or reply
Associate pick list values to specific record types
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 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.
- Ab
- December 18, 2015
- Like
- 0
- Continue reading or reply
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.
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;
}
}
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;
}
}
- sdjagdja wdguqwe
- December 18, 2015
- Like
- 0
- Continue reading or reply
how to display the fields at a equi distant from their labels
example
name: {!.v.name}
address:{v.address}
phone:{v.phone}
output:
name: bob
address: California
Phone: 852-895-7854
Please tell me your suggestions
name: {!.v.name}
address:{v.address}
phone:{v.phone}
output:
name: bob
address: California
Phone: 852-895-7854
Please tell me your suggestions
- Abhilash M
- December 18, 2015
- Like
- 0
- Continue reading or reply
- Chinnodu
- December 18, 2015
- Like
- 0
- Continue reading or reply