• SrikanthKuruva
  • NEWBIE
  • 358 Points
  • Member since 2011

  • Chatter
    Feed
  • 13
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 193
    Replies
So I'm on the Contact form, Case related list.  I click 'New' and get this in the URL:

/500/e?retURL=%2F0031a00000CYVQu&def_contact_id=0031a00000CYVQu&def_account_id=0011a00000EfLlb

So I'm thinking this ought to be easy to do.  I did it for the Account, a URL hack to create a new case.  It looked like this:

/500/e?def_account_id={!Account.Id}&retURL={!Account.Id}


But my setup to do it from the Contact form is just not working - Salesforce says there is no Account reference so I can't do this:

/500/e?retURL={!Contact.Id}&def_contact_id={!Contact.Id}&def_account_id={!Contact.AccountId  }}

or any variation of that.  Any thoughts?  I want to pass over both the account and contact defaults.

Appreciate any assistance.
 
Overriding NEW button of record detail page of custom OBJECT, no VF page found
I am trying to override standard SF page with a VF page for a custom object. For NEW button of the record detail page of a custom object, I want to replace that. But, no visualforce page is there to select from (image shown). The VF is associated with an apex class of custom controller. 
I am totally new to Visualforce and never coded HTML before. I am 2 challenges away (out of 9) to finish this and just can't figure out why I am still gettin this error message.
Here is the challenge:

User-added image
I believe I covered the highlighted items but don't have a clue about the ones circled with red.
I am under the impression that <apex:pageBlockTable value="{! Account }" var="a"> is a repeater as it keeps creating lines of Accounts,
as shown here:

User-added image
Below is my code:

<!-- Start -->

<apex:page standardController="Account" recordSetVar="accounts">
    <apex:form >
    <apex:pageBlock title="Accounts List">
        
        <!-- Accounts List -->
        <apex:pageBlockTable value="{! Account }" var="a">
            <apex:column value="{! a.Name }"/>
            
        </apex:pageBlockTable>
        
    </apex:pageBlock>
  </apex:form>
</apex:page>

<!-- End -->

Any help explaining how to fix the error and complete the remaining tasks will be greatly appreciated.
 

 
I have an VisualForce page set up like this:
<apex:actionPoller interval="5" reRender="panel" action="{!getPanelRecords}"/>

<apex:outputPanel id="panel">
    <button onClick = "btnClick(this,'blue');" value="Change me blue"/>
    <button onClick = "btnClick(this,'red');" value="Change me red"/>
</apex:outputPanel>

<script>
    function btnClick(element, color) {
        this.attr('color', color);
    }
</script>

When I click the button, it will change color, But due to the panel getting rerendered, it will not persist between refreshes.

I was thinking of using the actionPoller onComplete event to get a list of id's and set the colors accordingly, but I'm not sure if there's an easier/better way to achieve this.

Can anybody recommend how to store the changed CSS on multiple elements between refreshes?
Hi, to all I am new in the extension controller here I try implement the function on the sorting to my visual force page but the sorting and pagination is not working together here(I already done the pagination only using the standard controller). So I check the developer console on my apex class it's provide the error on followingly in the image
User-added image
So I don't know how to clear this error so please help me to done this task.and my apex class is followingly,
public class AccountListViewController{
public List<Account> AccountsortList {get; set;}
public String SortingExpression = 'name';
public String DirectionOfSort = 'ASC';
public Integer NoOfRecords {get; set;}
public Integer Size{get; set;}

    public AccountListViewController(ApexPages.StandardSetController controller) {
        AccountsortList = new List<Account>();
        ApexPages.StandardSetController ssc = new ApexPages.StandardSetController(AccountsortList);
        
    }
    
    /*public Integer pageNumber {
        get {
        return ssc.getpageNumber();
        }
        set;
    }*/
    public String ExpressionSort {
        get {
            return SortingExpression;
        }
        set {
            If(value == SortingExpression) {
                DirectionOfSort = (DirectionOfSort == 'ASC')? 'DESC' : 'ASC';
            }
            else {
                DirectionOfSort = 'ASC';
                SortingExpression = value;
            }
        }
    
    }
    
    public String getDirectionOfSort() {
        If(SortingExpression == Null || SortingExpression == '') {
            return 'DESC';
        }
        else {
            return DirectionOfSort;
        }
    }
    
    public void setDirectionOfSort(String value) {
        DirectionOfSort = value;
    }
    
    public List<Account>getAccounts() {
        return AccountsortList;
    }
    
     public PageReference ViewData() {
        String FullSortExpression = SortingExpression + ' ' + DirectionOfSort;
        system.debug('SortingExpression:::::'+SortingExpression);
        system.debug(DirectionOfSort);
        
       String Queryitem = ' SELECT Id, Name, Phone, BillingState, Type, Owner.Name, Website FROM Account WHERE Account.Name != Null ORDER BY ' + FullSortExpression +' Limit 10';
       system.debug(Queryitem);
       
        AccountsortList = DataBase.query(Queryitem);
        system.debug(AccountsortList);
        return Null;
    }
}

For answer's thanks in advance.Thanks Mohan. 
Hi I am trying to fetch multiple objects and their records with the Task to display on VF pages. I know I can achive this using SOSL but we provide managed packages for the users so I cannot go with SOSL as it needs maintanence. I tried using SOQL but can only query one object at a time the query is Dynamic SOQL. Instead can I write the Dynamic SOQL query in For loop to achive this. Suggestions please. thanks 

Hi, Please let me know that can we use Enterprise WSDL file for 2 way connection with .net appilcation OR I need give Custom WSDl file , Now with enterprise WSDl other system getting all data from salesforce objects shall I proceed with this OR  now I need to make connection in both way
Hi Experts,

I am a really newbee with this Apex and SOQLs. 

How would I do this?

I would like to compare so I can get filtered results:

Logic would look like this:

query1: SELECT Id, Parent_ObjectA__c FROM Child_ObjectA__c 
query2: SELECT Id, Parent_ObjectA__c FROM Child_ObjectB__c

I would like to grab the IDs of Child Records, from two different Child Objects, that looks up on the same Parent  Record.

How would I do this?

I appreciate any help you can give me.

Thanks !

FYI: I am really dumb with APEX so if you can have additional remarks, I would really appreciate it.
Since I have gotten great assistance previously, thought I'd request more assistance with yet another validation rule. I get no syntax errors and the validtion rules fires but only when all fields referenced are null.
Here is what the business wants:
If there is nothing in the DB Manufacturer field, and the sub type is EBR/EFR Needs Office Review then
• EITHER Boiler Type OR Furnace Type needs to be input
• Both of the following fields need to be supplied:
MFG Year
Fuel Type

This is what I have created:
DB_Manufacturer__c  = ""  && ISPICKVAL(Sub_Type__c, 'EBR/EFR Needs Office Review') && ISPICKVAL(Boiler_Type__c, '') && ISPICKVAL(Furnace_Type__c, '') && (ISBLANK(MFG_Year__c) || ISPICKVAL(Fuel_Type__c, '') || ISBLANK( Manufacturer__c ))

Once I select a Boiler Type and no other fields, the validation rules no longer fires. There has to be something with my grouping or AND's and Or's.
Any assistance is appreciated.
Hi All,

I have recently started working as a salesforce developer and I have a new requirement. My company uses two salesforce orgs for two different kinds of businesses. And now they require to display data on a custom object in one org to be displayed in another org.
For example, We have two orgs org1 and org2 and the requirement is to diplay the data on cusotm object in org1 to be displayed in org2. Can anyone suggest how this can be achieved?
Hi All,

I am currently working on a Apex class, That's perform different functionalities.

Like pagination, search by keyword, and selecting the records and sending some of the data to second page. And in second page have some input text fields that were not a object fileds inturn they are individual fields which will autopopulate with default values when redirected from first page. Now here i need to enter the data for some input fields and on button click it will calculate the rest of the inpit fileds based on the data provided. Fot this calculation and passing the data i am writing a javascript junction. Here i am coming up with  a problem.

The problem is-
the values that were calculated in page using javascript were not passing to controller. Please can anyone help me on how to acomplish this task..
Here i have a pageblock table records that needs to be passed to controller.

Thank You.
I'm looking for a Trigger to do the following:

On Create Opportunity
Loop through Account Contacts (That's Contacts, NOT Contact Roles)
  If Contact.UserRole__c (a custom field on the contact object) = 'Billing'
      Store Contact ID in Opportunity.Billing_Contact__c (a custom lookup field on the Opportunity object)
  Else
      If Contact.UserRole__c (a custom field on the contact object) = 'Shipping'
          Store Contact ID in Opportunity.Shipping_Contact__c (a custom lookup field on the Opportunity object)
      Else
          ignore and go to next Account Contact

Thanks in advance!!  This is such a great Developer Community!  I'm not a developer but I can usually "modify" code if someone can get me started.
Map<Id,String> userEmail = new Map<Id, String>{};
    List<User> userList = [SELECT Id, Email FROM User WHERE IsActive = TRUE];
    Map<Id, String> acctMap = new Map<Id, String>{};
    List<Account> acctList = [SELECT Id, Tech_Rep_Mgr__c FROM Account];
    for(User u : userList){
        userEmail.put(u.Id, u.Email);
    }
    for(Account a : acctList){
        acctMap.put(a.Id, a.Tech_Rep_Mgr__c);
    }
I'm working with the LiveAgent custom routing pilot and you have to implement a LiveAgent.LiveChatRouter.  This class runs in the background when a new chat is ready to be routed.  Since i'm in the vast minority working with this API, i suppose it is most like when you create a rest endpoint in apex.  I'm not seeing any traces for this class in the developer console, and believe it isn't running at all.  I do see see traces when my rest endpoint classes run, so i'm thinking it is an issue with this API.  

Does anyone else have suggestions on how to debug this class?  I should expect to see it in the console, right?

Hi All,

 

When I am viewing the case detail view , I am able to see mini layouts of all the related fields such as owner, account , contact.

 

But mini layout is nt showing up for Asset field.

 

Any help would be appreciated.

 

Thanks in Advance.

 

Regards

Palak Agarwal