• Avi646
  • NEWBIE
  • 62 Points
  • Member since 2011

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 45
    Replies

Hi Salesforce,

 

I'd like to be able to determine the datatype of a field name dynamic when user Passes  the field Name. i.e., when user selects AccountNumber then we need to get the data type as Text, and when he again selects IsPartner on Account object then we need to get CheckBox as data type.

 

I think we can achive this with Describe Fields on the object and then match the name listed with a Map of the DescribeFieldResults.

 

As i am new to coding can any one give me the approch for this scenario with a sample code.

 

Thank you.

Dear sir,
As we know  from the information board, the version Summer 11 has released. http://success.salesforce.com/ideaView?id=08730000000YNjCAAW&c=09a30000000D9xoAAC
That means our company could use all the new feature of API 22.0. But when we try to use the Dynamic Visualforce Component, it occurs an issue. "Error: Unknown component apex:dynamicComponent in ....". As the introudce said, API 22.0 should have include the new feature. http://blogs.developerforce.com/developer-relations/2011/05/dynamic-visualforce-components-in-summer-11.html.  I found we could not use <Apex:flow ...> and other new features in VisualForce page.
Would you please tell us what is the matter and why we could not use Dynamic Visualforce Component in production server and sandbox.

i want to create a method (via PUT) of the Apex REST web service  to receive a list of string and also the code to invoke it from java.

  • December 06, 2011
  • Like
  • 0
partnerConnection = Connector.newConnection(config);
partnerConnection.login(USERNAME, PASSWORD);
System.out.println("SessionId: " + config.getSessionId());	
			
MyWebServiceBindingStub Stub = new WyndhamMyWebServiceBindingStub();
			
MyWebServiceServiceLocator objMyWebServiceLocator=new MyWebServiceServiceLocator();
Stub=(MyWebServiceBindingStub)new MyWebServiceServiceLocator().getMyWebService();
			
SessionHeader_element sh = new SessionHeader_element();
sh.setSessionId(config.getSessionId());

Stub.setHeader(objMyWebServiceLocator.getServiceName().getNamespaceURI(),"SessionHeader",  sh);
Stub.callAction();

 the code for the my java client looks like this but when I am executing the code am always getting No serializer found for class com.sforce.soap.partner.SessionHeader_element in registry org.apache.axis.encoding.TypeMappingDelegate@96cf11

 

Can somebody help me out, where actually m doing wrong.

  • August 11, 2011
  • Like
  • 0

I there any call to get field level security from profile. tried retrieve() call but it doesnt help much.

Can salesforce partner wsdl be used to make API calls from one org to other?

I am unable to checkboxes from a wrapper class to visualforce page. I am getting unknown property error everytime.

 

Here is the Visual Force Page

 

 

<apex:page controller="chkBox">
 <apex:form >
<apex:pageBlock >
  <apex:pageBlockTable value="{!getVal}" var="p" >
  <apex:repeat value="{!p.box}" var="a">
    
    <apex:column >
    <apex:inputCheckbox value="{!a}"/>
    </apex:column>
    
   </apex:repeat>
   </apex:pageBlockTable>
   <apex:pageBlockButtons > <apex:commandButton action="{!save}" value="Save"/></apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:page>

 The Controller

 

public class chkBox {
list<wrapbox>  wrp= new list<wrapbox>();
    public PageReference save() {
    String test = ApexPages.currentPage().getParameters().get('test');
    system.debug('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'+test);
        return null;
    }


    public  list<wrapbox> getGetVal() {
     system.debug('::::::::::::::::::::::::::::::'+wrp);
    wrapbox mywrp = new wrapbox();
    for(integer i =0;i <10; i++){
    mywrp = new wrapbox();
    for(integer j =0;j <10; j++){
    mywrp.box.add(true);
    }
    wrp.add(mywrp);
    }
        return wrp;
    }

}

 

 

The Wrapper Class:

 

 

public class wrapBox{
public List<Boolean> box{get;set;} 
public wrapBox(){
box = new List<Boolean>();
}
}
public class wrapBox{public List<Boolean> box{get;set;} 
public wrapBox(){box = new List<Boolean>();}}

 

Please suggest how to show the Boolean list from wrapper class to the visual force. I am expecting a table of checkboxes.

 

 

  • February 08, 2011
  • Like
  • 0

HI,

I am trying to convert a lead to Account , Opportunity , Contact .
But i am getting Error as :


ConvertLead failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, System.DmlException: Update failed. First exception on row 0 with id 00QK0000002q7ZnMAI; first error: CANNOT_UPDATE_CONVERTED_LEAD, cannot reference converted lead: [] 

 

trigger LeadConvert on Lead (after insert)
{
for(Lead myLead: Trigger.new)
{
Database.LeadConvert lc = new database.LeadConvert();
lc.setLeadId(myLead.id);

LeadStatus convertStatus = [SELECT Id, MasterLabel FROM LeadStatus WHERE IsConverted=true LIMIT 1];
lc.setConvertedStatus(convertStatus.MasterLabel);
Database.LeadConvertResult lcr = Database.convertLead(lc);
System.assert(lcr.isSuccess());
}
}

Greetings all

 

Im looking for some assistance with formatting issues related to a DataTable if you review this link:

http://postimage.org/image/lczirvrf5/

 

You will see that the rows seem to be extending out to the right and not underneath the current row. The only way Ive been able to display each row below is to create a new DataTable underneath the current one which seems to be the wrong way to go. Can someone offer a suggestion as to how to display row after row of data? We have a check box and a basic text string which we are using to capture followups with clients.

 

Thanks

Ian

 

<apex:pageBlockSection title="1) Access Performance (check only boxes that apply to this visit)" columns="1" >
<apex:dataTable value="{!sitevisit}" var="sitevisit" columns="2" columnswidth="40%,60%" align="CENTER" cellpadding="3" border="1" bgcolor="#A9D0F5">
<apex:column headerValue="Confirmed">
<apex:inputCheckbox value="{!sitevisit.Checklist_1a__c}"/>
</apex:column>
<apex:column headerValue="Requirement">
<apex:outputField value="{!sitevisit.X1a__c}"/ >
</apex:column>
<apex:column >
<apex:inputCheckbox value="{!sitevisit.Checklist_1a__c}"/>
</apex:column>
<apex:column >
<apex:outputField value="{!sitevisit.X1a__c}"/ >
</apex:column>
</apex:datatable>

</apex:pageBlockSection>

Hi All,

 

As shown below the  execution of the process order is right  r not?if not so Please do the changes and let me know.

 

Validation

Apex class

Triggers

Workflows

 

Thanks

What are the integration options available for integrating SFDC with on-premise application like Oracle EBS? Is Dell boomi integration an option for such kind of integration? Additionally if someone can point to some good documentation around such on-demand to on-premise integration, it would be great!!!

  • December 19, 2011
  • Like
  • 0

Hello,

 

I'm very green with the whole coding/custom building thing, but I've managed a few feats that encourage me to try some more.  What I'm trying to do is create a button on an opportunity page that when clicked, will send me (specifically me) either a task or an email.  The body of the task/email can simply give the project number of the given opportunity.  I'm just trying to make it easier for my construction leads to tell me when a job can be invoiced.  (the obvious phone call is just not working...)

 

Does anyone know how to do this?  BTW, we only have Salesforce Professional.

 

Thank you,

 

Val

  • December 13, 2011
  • Like
  • 0

i want to create a method (via PUT) of the Apex REST web service  to receive a list of string and also the code to invoke it from java.

  • December 06, 2011
  • Like
  • 0

Can chatter profile image be updated using the API?

  • November 04, 2011
  • Like
  • 0

Hi,

 

I am having a scenario where i am deleting a record in object A, it should delete int ObjectB too. so i have the triggers written to delete the records.

 

When i write the test class i get the following error

 

System.DmlException: Delete failed. First exception on row 0 with id 00UM0000001ItxKMAS; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, delete_app: execution of AfterDelete caused by: System.NullPointerException: Attempt to de-reference a null object Trigger.delete_app: line 8, column 1: []

 

Here are the triggers

 

trigger delete_app on Event (after delete) {
	List<Id> ev = new List<Id>();
	 List<Event> eventlist = new List<Event>();
	 List<Appointment__c> appoint = new List<Appointment__c>();
	 if (CApp_static.firstRunAppointment==false)
	 {
	 	CApp_static.firstRunAppointment=true;
	  for(Event e:Trigger.new)
    {
      
      ev.add(e.id);
      
    } 
    
    appoint=[select id from Appointment__c where eventid__c in :ev];
    if (appoint.size()>0)
    {
    delete appoint;
    }
	 }

}

 

trigger delete_event on Appointment__c (after delete) {
	
	List<Id> ev = new List<Id>();
	 List<Event> eventlist = new List<Event>();
	 List<Appointment__c> appoint = new List<Appointment__c>();
	 if (CApp_static.firstRunAppointment==false)
	 {
	 	CApp_static.firstRunAppointment=true;
	  for(Appointment__c e:Trigger.new)
    {
      
      ev.add(e.id);
      
    } 
 
    eventlist=[select id from Event where appointment_ID__c in :ev];
       if(eventlist.size()>0)
       {
    delete eventlist;
       }
	 }

}

 Here is the test class

 

public with sharing class TestCreateEvent_Create_App {
	static testMethod void CreateEvent_Create_App() 
    {
		Contact a = new Contact();
		
	 	a.FirstName = 'TestFirst Name';
        a.LastName='Test Last Name';
        a.MailingStreet='Test billing Street';
        a.MailingCity='Test Billing City';
        a.MailingState='Test Billing State';
        a.MailingCountry='Test Billing country';
        a.MailingPostalCode ='Test PostCode';
        insert a;
        
          
	
		String strstartdatetime='2011-12-25 10:00:00';
		String strenddatetime='2011-12-25 10:00:00';
		
		Event e= new Event();
		e.WhoId=a.id;
		e.subject  ='Test Event'  ;
		e.StartDateTime=datetime.valueof(strstartdatetime);
		e.EndDateTime=datetime.valueof(strenddatetime);
		e.Appointment_Type__c='Call';
		e.Status__c='Tentative';
		e.Create_Appointment__c=true;
		
		insert e;
		
		 strstartdatetime='2011-12-28 10:00:00';
		 strenddatetime='2011-12-28 10:00:00';
		
		Appointment__c ap= new Appointment__c();
		ap.subject__c= 'Test App';
		ap.client__c=a.id;
		ap.name='Test Name';
		ap.StartDateTime__c=datetime.valueof(strstartdatetime);
		ap.EndDateTime__c=datetime.valueof(strenddatetime);
		ap.Appointment_Type__c='Call';
		ap.Status__c='Confirmed';
		insert ap;
		
		
		List <event> even= new List<event>();
		even=[select id,Appointment_Type__c,subject,StartDateTime,EndDateTime from Event where id=:e.id];
		even[0].subject='Test Event update'	;
		update even;
		
		even=[select id,Appointment_Type__c,subject,StartDateTime,EndDateTime from Event where id=:e.id];
		if (even.size()>0)
		{
			delete even;
		}
		
		List <Appointment__c> apList= new List<Appointment__c>();
		apList=[select id,name,subject__c,Appointment_Type__c,EndDateTime__c,StartDateTime__c from Appointment__c where id=:ap.id];
		apList[0].Subject__c='Test App update';
		update apList;
		
		delete apList;
		
		
		
		
		}
}

 Any ideas where i am going wrong?

  • October 31, 2011
  • Like
  • 0
Can we call batch apex class which implements Database.Batchable. on button click(custom button) or visual force tab?

 

  • September 05, 2011
  • Like
  • 0

 

I want multiple orgs to be able to copy my apex code from my org, so I expected the Enterprise  to be best placed for this, but could also use the Partner wsdl and the query method to query ApexClass object.

 

But when I try to import the wsdl I get errors

 

The faultPartnerSoapSforceCom sobjectPartnerSoapSforceCom class are made, but not partnerSoapSforceCom



 

Error: partnerSoapSforceCom


Error: unexpected token: 'delete' at 670:51

 

 

trigger updateaccountstatus on Opportunity (after update)
 {   
    for (Opportunity o : Trigger.new)
    {
    Opportunity opp =[select ID,Name, StageName,AccountId  from Opportunity where ID =:o.id];
        if (Trigger.isUpdate)
        {         
          account acct=[select ID,Name,Status__c from account where  id =:opp.AccountId];
           if(opp.StageName=='Suspend')
           {
          
           acct.Status__c='Suspend';
            update acct;  
                            
           }       
        }
      
    }
    
 }

 I want to fire the above trigger only once. 

Got to know that by using static variables we can fire trigger only once but how to implement in my above code.

  • September 02, 2011
  • Like
  • 0

Trying to create a trigger to prevent new child records being inserted if the field Event Status on it's parent is one of three values. Starting with just one of the values to keep it simple. Here's what I have so far.

 

trigger CSProductBeforeSave on CS_Product__c (before insert) 
{

    for (CS_Product__c q: trigger.new)
    
        IF(q.Customer_Support__c.Event_Status__c == 'Open Complaint') 
        
            {
            q.addError('Cannot add records to PECs with Open Complaints status');
           
           }
}

 

 

ErrorError: Compile Error: Invalid foreign key relationship: CS_Product__c.Customer_Support__c at line 6 column 12

 

CS_Product__c is a child to Customer_Support__c.

 

Any guidance would be appreciated!.

 

Rick

 


  • September 01, 2011
  • Like
  • 0

Is it possible to read the metadata of a report in Apex. I'm interested in being able to get the fields and conditions that have been assigned to a report programitcally.

 

Thanks,

Phillip