• Sfdc11
  • NEWBIE
  • 25 Points
  • Member since 2011

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 37
    Questions
  • 34
    Replies

Hi

  

      Please help me in writting a trigger for moving billing address to shipping address for both insert and update events

 

 thanks

 naren.

I've 7+ years of strong experience in salesforce development&administration..I've done DEV 401 certification..Currently Im looking for parttime/ful time salesforce administrator job (work from home option)..

Please reach me at 225-223-0861 for any job openings on this..

Thanks..
  • January 09, 2017
  • Like
  • 0

Hi ,

I need to have Regex to accpet either of format 

(45)3456-3456 (or)

+4564564523434 ->size can be more than 10 digit but with + sign

 

Please Help out..

  • December 11, 2013
  • Like
  • 0

Hi,

 

How to get the subquery output of activityhistory in a list & display in VF page.

 

[Select Id,caseNumber,(SELECT id,ActivityDate,Subject,Status,Description from ActivityHistories) from Case where Id=:caseId

 

Help me out..

 

Thanks in Advance!!

  • December 04, 2013
  • Like
  • 0

<apex:pageBlockTable value="{!listRec}" var="s" >

<apex:column headerValue="field1" >
<apex:inputField value="{!s.field1}" id="id1st"  />
</apex:column>

 

---------

</apex:pageblocktable>

 

how to calculate sum of input field in pgblk table???

 

help me out pls..

  • October 04, 2013
  • Like
  • 0

 

 

Can we add a parameter in the Force.com site URL...

 

Help me out pls If anybody worked on this..

  • September 20, 2013
  • Like
  • 0
Im gettin the folowing error when I abt to save the below test class for webservice class.
Method does not exist or incorrect signature: Test.setMock(Type, DMDMockHttpResponseGenerator) at line 5 column 8
 
@isTest
private class DMDCalloutClassTest {
     @isTest static void testDMDCallout() {
    
       Test.setMock(HttpCalloutMock.class,new DMDMockHttpResponseGenerator());
       
        HttpResponse res = Dmd_HttpCallTest.getCountryInfo();
       //HttpResponse res;
        String contentType = res.getHeader('Content-Type');
        System.assert(contentType == 'application/soap+xml; charset=utf-8');
        String actualValue = res.getBody();
        String expectedValue = '<birId>15625017</birId>';
        System.assertEquals(actualValue, expectedValue);
        System.assertEquals(200, res.getStatusCode());
    }
}
 
 
 
@isTest
global class DMDMockHttpResponseGenerator implements HttpCalloutMock {
       
        global HTTPResponse respond(HTTPRequest req) {
        System.assertEquals('https://webservice/loc', req.getEndpoint());
        System.assertEquals('GET', req.getMethod());
       
        // Create a fake response
        HttpResponse res = new HttpResponse();
        res.setHeader('Content-Type','application/soap+xml; charset=utf-8');
        res.setBody('<birId>15625017</birId>');
        res.setStatusCode(200);
        return res;
    }
}
 
Please help me out!! 
  • September 11, 2013
  • Like
  • 0

Hi,

 

 I need to validate Email address in salesforce is correct (domain etc) or not.

 

How to implement in salesforce something like this 

https://appexchange.salesforce.com/listingDetail?listingId=a0N300000019uHOEAY

 

http://verify-email.org/

 

Any Idea Pls???

  • September 02, 2013
  • Like
  • 0

im not getting the value in controller for the checkbox selection...

 

pls help me out!!!!!!!!

 

  • August 28, 2013
  • Like
  • 0

Hi,

 

Using wrapper class im retriving Account and case details.

I want to disply like this in VF page ,

 

if i use pageblocktable,im getting all data in row from wrapperList..

 

 

  • August 27, 2013
  • Like
  • 0

anybody got solution for hide Std button through Homepage for Service console??

Pls help me out..For me same code not working/hiding for Console Application.

Hi,

 

How to get the loggined User fields in Javascript.can I write SOQL query through connection.js in Homepage components??????

 

eg,$user.email ,but when I tried to alert its not showing..

var userId={!$user.email};
alert('user'+userId);

 

Pls Help me out.......

Hi,

 

Im opening New Tab in service console on click of button -invoking below VF page... New Tab/page is not opening sometimes...Sometimes working ..Y sometimes not working in IE & FireFox...

 

pls help me out....

 

code:


<apex:page standardController="case">
<script type="text/javascript" src="/js/functions.js"></script>
<script src="/soap/ajax/26.0/connection.js"></script>
<script src="/soap/ajax/26.0/apex.js"></script>
<apex:includeScript value="/support/console/26.0/integration.js"/>
<apex:form >
<apex:pageBlock >
</apex:pageBlock>
</apex:form>
<script>
   window.onload = loadfns;
    function loadfns()
    {
    
var caseIds="{!$Request.newid}";
 var sId='{!$Api.Session_ID}';
sforce.connection.sessionId=sId;  
var result;
var queryString;
var accresult;
var accquerystring;
 try{
queryString="Select Id,CaseNumber,AccountId,Type from case Where Id='"+caseIds+"'";
result=sforce.connection.query(queryString);
var resultRecords = result.getArray("records");
var caseAccountId=resultRecords[0].AccountId;
var caseRecId=resultRecords[0].Id;
var caseType=resultRecords[0].Type;
var caseName=resultRecords[0].CaseNumber;

 if (sforce.console.isInConsole()){

sforce.console.openPrimaryTab(null,'/'+caseRecId, true, ''+caseName);
if(caseType=="Information Request" && caseAccountId!=null){

 
 sforce.console.openPrimaryTab(null, '/apex/VFpage?scontrolCaching=1&Id='+caseAccountId, true, 'Lead Tab');
   }
 }
else{
window.location.href='/'+caseRecId;
}
}
catch(e){alert('Exception'+e);}    
                       
      }
</script>

</apex:page>


Hi,

 

External System sending response as Attachment to Salesforce(Wsdl to Apex).

 

Since response as attachment,Im not able to get/read  it in salesforce and store into custom obj..Is this possible????

 Sending response as text file which has XML data.

 

Anybody worked on this kinda req???

Error:

 

common.apex.runtime.impl.ExecutionException: Web service callout failed: Failed to get next element"|0x7ae90bbb
 
Help me out...

Hi All,

 

I need to open a Vf page in a new tab on click of save a Case.

 

If I use SaveURL for Vf page,it redirects to vf page after save on same window itself but not on new tab..

 

Is this possible??? Help me out on this...

 

 

 

 

Hi,

 

I'm retriving all the objects picklistvalues(options) through Describe(Dynamic Apex) Result.

Im getting governor limits for the -Number of picklist Describes:101.. Since in the for loop its exceeding more than 100 ,but I need to retrive for all objests in a Org.

 

is this possible through Batch Apex?? What is other workaround?

 

Please help me out..

Hi,

 

I've created Entitlement Process for the case and given success and violation actions like field update,task creation and Emil alert. In that field update/task creation is working but the email alert(milestone) is not triggering at all.

 

Anybody help me out...

 

Thanks,

 

Hi,

 

How to  open a new tab with Visualforce page through Apex trigger?

 

Pls help me out..

  • April 11, 2013
  • Like
  • 0

Based on RecordtypeId,im redirecting to VF page or standard pg layout.

 

 one field value is based on recordytrpe.

but in In visualforce page, that field value not displaying for the recordtype given in VF page URL,instead that profiles default record type options are displaying...

(/apex/vfpage?recordtype=012D0000000KBFG&id=..)

 

How?

 

Help me out...

  • April 10, 2013
  • Like
  • 0
Hi,

I've List button attached VF page on 'Sys' Object .This Vf page has input fields of 'Comp' Object and I need to populated

selected 'Sys' obj records tot amt into one of 'Comp' obj input field while loading...

In controller I got the tot amt of selected 'Sys' obj record..

So How to populate one obj amt value from apex controller to  VF page input field???

   public Comp__c comp{get;set;}

   public SYS__c sys{get;set;}
    List<FTS__c> arrySys=new List<FTS__c>();

 public Sysextn(ApexPages.StandardSetController controller) {
    arrySys= (List<Sys__c>) controller.getSelected();
      
        -----
         ----} some code 
   
    TotAmt=TotAmt+SYS__c.Total__Amt__c;
 System.debug('TotAmt******'+TotAmt); --> getting Amt of selected SYS record.
     comp.amt__c=TotAmt; --> Getting null pointer exception..
                     
}

<apex:page standardcontroller="Sys__c" extensions="Sysextn" recordsetvar="ft">

<apex:pageBlockSection columns="2" >
<apex:inputField value="{!comp.name}" /> 
<apex:inputField value="{!comp.amt__c}" /> -> how to assign Totamt into this...

 

  • March 20, 2013
  • Like
  • 0

When I click on command button,I want one pgblcksection to be refreshed but it's not working if the page has required="true". It should be filled only before I click save only..How to resolve???

 

<apex:page standardController="Account">
<apex:form >
<apex:pageblock >
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
<apex:commandButton action="{!cancel}" value="Cancel"/>
</apex:pageBlockButtons>
<apex:pageBlockSection columns="2" >
<apex:inputField value="{!account.phone}" required="true"/>

</apex:pageBlockSection>

<apex:pageBlockSection >
<apex:inputField value="{!account.name}"/>
<apex:inputField value="{!account.type}"/>

</apex:pageBlockSection>

<apex:commandButton value="test" reRender="results" immediate="true"/>
<apex:outputPanel id="results">
<apex:pageBlockSection >{!(account.Name+account.type)}</apex:pageBlockSection>
</apex:outputPanel>
</apex:pageblock>
</apex:form>
</apex:page>

  • March 19, 2013
  • Like
  • 0

<apex:pageBlockTable value="{!listRec}" var="s" >

<apex:column headerValue="field1" >
<apex:inputField value="{!s.field1}" id="id1st"  />
</apex:column>

 

---------

</apex:pageblocktable>

 

how to calculate sum of input field in pgblk table???

 

help me out pls..

  • October 04, 2013
  • Like
  • 0

 

 

Can we add a parameter in the Force.com site URL...

 

Help me out pls If anybody worked on this..

  • September 20, 2013
  • Like
  • 0

Hi,

 

 I need to validate Email address in salesforce is correct (domain etc) or not.

 

How to implement in salesforce something like this 

https://appexchange.salesforce.com/listingDetail?listingId=a0N300000019uHOEAY

 

http://verify-email.org/

 

Any Idea Pls???

  • September 02, 2013
  • Like
  • 0

im not getting the value in controller for the checkbox selection...

 

pls help me out!!!!!!!!

 

  • August 28, 2013
  • Like
  • 0

Hi,

 

Using wrapper class im retriving Account and case details.

I want to disply like this in VF page ,

 

if i use pageblocktable,im getting all data in row from wrapperList..

 

 

  • August 27, 2013
  • Like
  • 0

Hi,

 

How to get the loggined User fields in Javascript.can I write SOQL query through connection.js in Homepage components??????

 

eg,$user.email ,but when I tried to alert its not showing..

var userId={!$user.email};
alert('user'+userId);

 

Pls Help me out.......

Hi All,

 

I need to open a Vf page in a new tab on click of save a Case.

 

If I use SaveURL for Vf page,it redirects to vf page after save on same window itself but not on new tab..

 

Is this possible??? Help me out on this...

 

 

 

 

Hi,

 

I'm retriving all the objects picklistvalues(options) through Describe(Dynamic Apex) Result.

Im getting governor limits for the -Number of picklist Describes:101.. Since in the for loop its exceeding more than 100 ,but I need to retrive for all objests in a Org.

 

is this possible through Batch Apex?? What is other workaround?

 

Please help me out..

Based on RecordtypeId,im redirecting to VF page or standard pg layout.

 

 one field value is based on recordytrpe.

but in In visualforce page, that field value not displaying for the recordtype given in VF page URL,instead that profiles default record type options are displaying...

(/apex/vfpage?recordtype=012D0000000KBFG&id=..)

 

How?

 

Help me out...

  • April 10, 2013
  • Like
  • 0

When I click on command button,I want one pgblcksection to be refreshed but it's not working if the page has required="true". It should be filled only before I click save only..How to resolve???

 

<apex:page standardController="Account">
<apex:form >
<apex:pageblock >
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
<apex:commandButton action="{!cancel}" value="Cancel"/>
</apex:pageBlockButtons>
<apex:pageBlockSection columns="2" >
<apex:inputField value="{!account.phone}" required="true"/>

</apex:pageBlockSection>

<apex:pageBlockSection >
<apex:inputField value="{!account.name}"/>
<apex:inputField value="{!account.type}"/>

</apex:pageBlockSection>

<apex:commandButton value="test" reRender="results" immediate="true"/>
<apex:outputPanel id="results">
<apex:pageBlockSection >{!(account.Name+account.type)}</apex:pageBlockSection>
</apex:outputPanel>
</apex:pageblock>
</apex:form>
</apex:page>

  • March 19, 2013
  • Like
  • 0

   List<obj> arry=new List<obj>();
    List<objc> sel=new List<obj>();   

 

public vfpg(ApexPages.StandardSetController controller) {
    arry = (List<obj>) controller.getSelected();
        sel=[select Id,Total_General_Amount__c,Name from FTS__c where Id IN :obj];

        System.debug('arr size'+sel.size()); // returning size correctly


        System.debug('first rec'+sel[0]); // Getting Error here - List Index out of bounds exception.

 

 

  • March 18, 2013
  • Like
  • 0

Hi Guys, i  have succeeded in hiding the "save&new" and "check spelling" buttons in the case edit page by adding a home page component(HTML). However, now we switch to use service cloud console. As there is no home tab available by default in cloud console, we created the Home Web tab by following the steps given in http://success.salesforce.com/ideaView?c=09a30000000D9xoAAC&id=08730000000Xp3uAAC.  As a result, our custom home page component would not function at all as there is no sidebars any more in the web tab of Home page. Does anyone have ideas on this issue or have any other ways to hide the standard buttons?  Thanks in advance~

  • November 24, 2011
  • Like
  • 0

Hi,

Can any one help to this scenario.

 

Page Code:-

<apex:page controller="xyzcon" >
<script>
    function addElement(value)
        {
        //alert(value);
            var ni = document.getElementById('myDiv');
            var numi = document.getElementById('theValue');
            var num = (document.getElementById('theValue').value -1)+ 2;
            numi.value = num;
            var newdiv = document.createElement('div');
            var divIdName = 'my'+num+'Div';
            newdiv.setAttribute('id',divIdName);
            newdiv.type='Button';
        
   <!-- If conditions that helps to add a control dynamically based on field types -->
        if(value=='STRING')
        {
            newdiv.innerHTML = 'Name:<input type="+value+" Name="DVF__STRING" />';
        }
        if(value=='EMAIL')
        {
            newdiv.innerHTML = 'Email:<input type="+value+" Name="DVF__EMAIL" />';
        }
        if(value=='PHONE')
        {
            newdiv.innerHTML = 'Phone:<input type="+value+" Name="DVF__PHONE"/>';
        }
        if(value=='PICKLIST')
        {
            newdiv.innerHTML = 'Location:<select type="+value+" Name="DVF__PICKLIST"><option value="Hyderabad">Hyderabad<option value="Banglore">Banglore<option value="Chennai">Chennai';
        }
        if(value=='TEXTAREA')
        {
            newdiv.innerHTML = 'About You:<textarea rows="5" cols="20" Name="DVF__TEXTAREA"/>';
        }
        if(value=='BOOLEAN')
        {
            newdiv.innerHTML = 'CheckBox:<input type="Checkbox" Name="DVF__BOOLEAN"/>';
        }
        if(value=='DATE')
        {
            newdiv.innerHTML = 'Date:<input type="text" Name="DVF__DATE"/>';
        }
         ni.appendChild(newdiv);
     }
     
  <!-- function that helps to get the form elements -->
 
     function getfieldvalues(oForm)
     {  
      str = oForm.name;
        for (i = 0; i < oForm.length; i++)
        {
            str += oForm.elements[i].name+ " -- "+ oForm.elements[i].value + "\n";
        }
        alert(str);
     }

</script>
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockSection >
                <apex:pageBlockTable value="{!Data}" var="Fvalues">
                    <apex:column headervalue=" Field Names ">
                        <a href="javascript&colon;;" onclick="addElement('{!Fvalues}')">{!Fvalues}</a>
                    </apex:column>
                </apex:pageBlockTable>
             </apex:pageBlockSection>
        </apex:pageBlock>
        <input type="hidden" value="0" id="theValue" />
    <div id="myDiv"> </div>
    <input type="button" value="Submit" onclick="getfieldvalues(this.form)"/>
   </apex:form>
</apex:page>

 

 

Controller Code:-

public class xyzcon
{
    List<Schema.DisplayType> fieldtypelst= new List<Schema.DisplayType>();

        public List<Schema.DisplayType> getData()
        {
                Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();
                Schema.SObjectType systemObjectType = gd.get('E__C') ;
                Schema.DescribeSObjectResult r = systemObjectType.getDescribe();
                Map<String, Schema.SObjectField> M = r.fields.getMap();
                Set<String> fieldNames = M.keySet();               
                    for(String fieldName : fieldNames)
                    {
                            Schema.SObjectField field = M.get(fieldName);                                                    
                            Schema.DescribeFieldResult fieldDesc = field.getDescribe();
                            if(fieldDesc.iscustom())
                            fieldtypelst.add(fieldDesc.getType());  
                    }
               return fieldtypelst;
        }
}

 

 

How can i pass  'str' value from JavaScript method to apex Controller.

 

 

Can u please suggest me.

 

 

Thanks & Regards;

Ramya

I have a custom ojbect (Internal_Request__c) for which I am building a custom "new record" page.  Following the typical pattern of first making the user select a Record Type, I created a simple "select record type" page that gives the user a list of record types.  After submitting that page, the user is directed to the full form page with the selected Record Type ID on the query string.   Ideally, based on the new feature in version 20.0, I would like that form to be aware of the record type so that the select lists are filtered accordingly.  I can't seem to get it work though.  The page loads but the default RecordType is selected, not the one that was passed on the querystring from the previous page.

 

The parameter name on the query string is "rType"

 

Here is my controller for the second page:

 

public with sharing class CreateIRFormController {
	
    public Internal_Request__c ir {get;set;}
    
    public String rType {get; set;}
    
    public CreateIRFormController() {
        rType = ApexPages.currentPage().getParameters().get('rType');
        ir = new Internal_Request__c(recordtypeid = (ID)rType, subject__c = 'test pre-pop');
    }

    public PageReference save() {
        insert ir;
        ApexPages.StandardController sc = new ApexPages.StandardController(ir);
        return sc.edit();
    }
}

 

 

And the associated VF page:

 

<apex:page controller="CreateIRFormController">
	<apex:form >
	    <apex:pageBlock >
	        <apex:pageBlockSection >
		        <apex:inputField value="{!ir.RecordType}" />
		        <apex:inputField value="{!ir.Type__c}"  />
		        <apex:inputField value="{!ir.Account__c}"  />
		        <apex:inputField value="{!ir.Opportunity__c}"  />
		        <apex:inputField value="{!ir.Issue_Date__c}"  />
		        <apex:inputField value="{!ir.Number_of_Copies__c}"  />
		        <apex:inputField value="{!ir.Request_Due_Date_Time__c}"  />
		        <apex:inputField value="{!ir.Subject__c}"  />
		        <apex:inputField value="{!ir.Description__c}"  />
	        </apex:pageBlockSection>
	        
	       <apex:pageBlockSection >
	            <apex:inputHidden value="{!rType}" />            
	            <apex:commandButton value="Create" action="{!save}" />
	        </apex:pageBlockSection>
	
	    </apex:pageBlock>    
	</apex:form>
</apex:page>

 Note: the subject__c is correctly pre-populated by the constructor, but the record type does not work.

 

 

I tried a second version of the controller constructor, but it results in the following error message (which doesn't really make sense to me):

There were custom validation error(s) encountered while saving the affected record(s). The first validation error encountered was "Record Type ID: value not of required type: [RecordType (Name:PS Data Center, Id:012Q00000004SJfIAM)]".

 

    public CreateIRFormController() {
        rType = ApexPages.currentPage().getParameters().get('rType');
        RecordType rt = [select id,name from RecordType where id = :rType];
        ir = new Internal_Request__c(recordtype = rt);
    }

 

 

This feels like a common thing people would want to do, so I'm hoping I'm just missing something.  Any help is appreciated.

 

-Cory

  • November 08, 2010
  • Like
  • 0