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

  • Chatter
    Feed
  • 19
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 76
    Replies
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,

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;
            }
        }


 
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!
Hello,

Why is it that the same report contents show different number of records to different users ?

thanks for suggestions !
How to write a formula for adding one day if the selected date is sunday

Thanks in advance.
Hello,

I specified the date as "Next 3 weeks" but it shows me all the results with that date, Where am i going wrong ?

 
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
  • December 14, 2015
  • Like
  • 0
Hello,

I have a validation rule.

I want it only for certain profiles, 

How can i do it ?
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!
  • October 10, 2015
  • Like
  • 0
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
User-added image

Thanks alot
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 ))
User-added image
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.
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! :)
  • September 20, 2015
  • Like
  • 1
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.
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") 

)
 
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?
I have written the Code for Test Class"TestRestrictContactByName'.
@isTest
private class TestRestrictContactByName {
    @isTest static void testRestrictContacts(){
        Contact con1 = new Contact(FirstName='Htesh', LastName='khatri');
        Test.startTest();
        Database.SaveResult Result = Database.insert(con1,false);
        Test.stopTest();
        System.assert(!result.isSuccess());
        System.assert(result.getErrors().size()>0);
        System.assertEquals('The Last Name "'+con1.LastName+'" is not allowed for DML',result.getErrors()[0].getMessage());
 }
    After Running this test i am getting an error 'Challenge not yet complete... here's what's wrong:
The 'RestrictContactByName' class did not achieve 100% code coverage via your test methods' .

Please help me in solving this.
Hi ,

 I have DOB as Text Field, I want to given the validation for this text Field (DOB) ? 

My Sample Validation is : TEXT(SitEduTest__Academic_Year__c  < Today())  
            But it causing  Error: Incorrect parameter type for operator '<'. Expected Text, received Date.  How to achive this guide me .

Thanks
Maheshwar 
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
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.

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;
            }
        }


 
I keep getting: Challenge Not yet complete... here's what's wrong:
The validation rule does not reference the 'IsClosed' and 'CloseDate' fields correctly. Take a look at the requirements again.

When I test the formula it seems to work as the requirements indicate yet it does not pass the validation from trailhead. Here is the formula: AND( NOT(IsClosed) ,  CloseDate < TODAY() )
It is placed on the CloseDate field.
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!
I am trying to perform a basic step (this works when i write an apex class and then try to get the access token, but does not when i do the same from google chrome extensions)

Please see the details:
I am hitting the URL :


And i am giving these as headers:
grant_type: password
client_id: 3MVG9Y6d_Btp4xp6.aP2dpK_QvKPMy.wCLzvqeElabZryrMYgZfEyCCMVUg5fm.6SqUW5525mr3xgXNStu2IM
client_secret: 7269476387055204688
username: --------@gmail.com
password: --------
Accept: application/json

Still getting the error:
{
  "error": "unsupported_grant_type",
  "error_description": "grant type not supported"
}

I tried adding the Content-Type parameter as well, but does not work.
Kindly help!

Regards
Rajat
Hello,
In my org I have certain number of batch jobs.
I want a list of batch job.
Can I retrieve it through query or API?
I know its a very silly question. But if there is any way to fetch the all batch jobs please let me know.
I have an custom requirement thats why i want this.
Thank You.