• sravan alaparthi
  • NEWBIE
  • 25 Points
  • Member since 2012

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 3
    Questions
  • 12
    Replies

Hello Everyone,

 

i had used apex:param tag quite a lot by now,but so many times i noticed if name attribute is not specified it is not working properly.

 

So i guess it's like key for the value which we want to assignto a property of a controller. 

 

please do correct me if i am wrong...

 

Sravan Alaparthi.

 

 

Hi i have to assign a task on the account selected by the user,i am stuck in between any help would be great

 

Page:

 

<apex:page controller="PractiseController">
    <apex:form >
      <apex:pageBlock >
      <apex:pageBlockSection columns="1">
      <apex:selectList size="1" value="{!selectValue}" label="Related to" onclick="">
        <apex:selectOptions value="{!Options}"></apex:selectOptions>
      </apex:selectList>
      <apex:inputTextarea value="{!comments}" label="Comments" />
      <apex:commandButton value="Done" action="{!assignTask}"/>
      </apex:pageBlockSection>
      </apex:pageBlock>
    </apex:form>
</apex:page>

 Sravan Alaparthi

 

 

Controller:

public with sharing class PractiseController{

   public List<SelectOption> options=new List<Selectoption>();
    public Id selectValue { get;set; }
     public string comments { get;set; }
//method to generate account names as picklist   
public List<SelectOption> getOptions(){

for(Account account:[Select ID,Name from Account]){
options.add(new SelectOption(account.id,account.Name));}

return options;
}

//method to assign a task
public pageReference assignTask(){


Task lt=new Task();
lt.what=//assign selected account to task

lt.Description=comments;

pageReference pr=new pageReference('/'+selectvalue);
return pr;
}
}

 

Hi 

 

i need to delete a particular location selected by user...i got some thing wrong in my code can anyone help out please....

 

Custom Controller

 

public with sharing class Loca {

 


private String rID{get;set;}
Location__c[] ld=new List<Location__c>();
List<Location__c> lc=new List<Location__c>();


public PageReference doDelete(){
try{
String s='SELECT ID FROM Location__c WHERE ID='+rID;
String.escapeSingleQuotes(s);
ld=Database.Query(s);

Database.delete(ld);


PageReference pr=new PageReference('/apex/success');
return pr;

}catch(Exception e){
ApexPages.Message m=new ApexPages.Message(ApexPages.severity.ERROR,'Deletion was not successful');
ApexPages.addMessage(m);
PageReference pr=new PageReference('/apex/unsuccess');
return pr;
}

PageReference pr=new PageReference('/apex/success');
return pr;
}


public List<Location__c> getLocations(){

String s='SELECT NAME,Country__c,Phone__c,City__c,State_Province__c FROM Location__c';
lc=Database.Query(s);
return lc;

}
}

 

VisualForce Page:

 


<apex:page controller="Loca">
<apex:form >
<apex:pageBlock >
<apex:pageBlockTable value="{!Locations}" var="l">
<apex:column headerValue="Action">
<apex:commandLink action="{!doDelete}" value="Delete">
<apex:param value="l.id" assignTo="{!rID}"/>
</apex:commandLink>
</apex:column>
<apex:column headerValue="Name" value="{!l.name}"/>
<apex:column headerValue="Phone" value="{!l.Phone__c}"/>
<apex:column headerValue="Country" value="{!l.Country__c}"/>
</apex:pageBlockTable>

</apex:pageBlock>
</apex:form>
</apex:page>

 

Thanks in advance

Sravan Alaparthi.

 

Hello Everyone,

 

i had used apex:param tag quite a lot by now,but so many times i noticed if name attribute is not specified it is not working properly.

 

So i guess it's like key for the value which we want to assignto a property of a controller. 

 

please do correct me if i am wrong...

 

Sravan Alaparthi.

 

 

Hi i have to assign a task on the account selected by the user,i am stuck in between any help would be great

 

Page:

 

<apex:page controller="PractiseController">
    <apex:form >
      <apex:pageBlock >
      <apex:pageBlockSection columns="1">
      <apex:selectList size="1" value="{!selectValue}" label="Related to" onclick="">
        <apex:selectOptions value="{!Options}"></apex:selectOptions>
      </apex:selectList>
      <apex:inputTextarea value="{!comments}" label="Comments" />
      <apex:commandButton value="Done" action="{!assignTask}"/>
      </apex:pageBlockSection>
      </apex:pageBlock>
    </apex:form>
</apex:page>

 Sravan Alaparthi

 

 

Controller:

public with sharing class PractiseController{

   public List<SelectOption> options=new List<Selectoption>();
    public Id selectValue { get;set; }
     public string comments { get;set; }
//method to generate account names as picklist   
public List<SelectOption> getOptions(){

for(Account account:[Select ID,Name from Account]){
options.add(new SelectOption(account.id,account.Name));}

return options;
}

//method to assign a task
public pageReference assignTask(){


Task lt=new Task();
lt.what=//assign selected account to task

lt.Description=comments;

pageReference pr=new pageReference('/'+selectvalue);
return pr;
}
}

 

Hi, I designed a VF page with save and cancel buttons . On Clicking Save button, Cancel button also need to go into Saving mode, similar to Salesforce standard page.

 

My Requirement is :

 

On Clicking Save Button we should disble both Save & Cancel buttons and need to show saving text for both buttons

 

Thanks,

Ramana

  • November 12, 2012
  • Like
  • 0

Hi 

 

i need to delete a particular location selected by user...i got some thing wrong in my code can anyone help out please....

 

Custom Controller

 

public with sharing class Loca {

 


private String rID{get;set;}
Location__c[] ld=new List<Location__c>();
List<Location__c> lc=new List<Location__c>();


public PageReference doDelete(){
try{
String s='SELECT ID FROM Location__c WHERE ID='+rID;
String.escapeSingleQuotes(s);
ld=Database.Query(s);

Database.delete(ld);


PageReference pr=new PageReference('/apex/success');
return pr;

}catch(Exception e){
ApexPages.Message m=new ApexPages.Message(ApexPages.severity.ERROR,'Deletion was not successful');
ApexPages.addMessage(m);
PageReference pr=new PageReference('/apex/unsuccess');
return pr;
}

PageReference pr=new PageReference('/apex/success');
return pr;
}


public List<Location__c> getLocations(){

String s='SELECT NAME,Country__c,Phone__c,City__c,State_Province__c FROM Location__c';
lc=Database.Query(s);
return lc;

}
}

 

VisualForce Page:

 


<apex:page controller="Loca">
<apex:form >
<apex:pageBlock >
<apex:pageBlockTable value="{!Locations}" var="l">
<apex:column headerValue="Action">
<apex:commandLink action="{!doDelete}" value="Delete">
<apex:param value="l.id" assignTo="{!rID}"/>
</apex:commandLink>
</apex:column>
<apex:column headerValue="Name" value="{!l.name}"/>
<apex:column headerValue="Phone" value="{!l.Phone__c}"/>
<apex:column headerValue="Country" value="{!l.Country__c}"/>
</apex:pageBlockTable>

</apex:pageBlock>
</apex:form>
</apex:page>

 

Thanks in advance

Sravan Alaparthi.

 

Hi I am creating an email template with visual force.  When using the Apex:repeat is there any way to have it not display a value?

 

Here is what I have and it is showing everything related to that object.  However if the ECS__Product__r.Name = "Shipping" I want it to skip that line and not display it.

 

<apex:repeat value="{!relatedto.ECS__Order_Lines__r}" var="ol">
<tr>
<td>
  {!ol.ECS__Product__r.Name}<br/>
</td>
<td>
{!ol.ECS__Quantity__c}
</td>
<td>{!ol.body_end__c}</td>
<td>{!ol.Shaft_End__c}</td>

</tr>
 </apex:repeat>

 

Any thoughts?

 

Thanks!

  • November 09, 2012
  • Like
  • 0

Hi,

 

My scenario:

  I have a custom object A and opportunity has a look-up relationship with this object.

  For custom Object A : I have 4 fields: F1, F2, F3, F4.(Picklist)

 In opportunity object also I have 4 fields of same type(Picklist) with same list of values.

 

Requrirement:

 

 When user saves the record for opportunity object then based on record A selectd by user via look-up relation ship, all the values for F1, F2,F3,F4 for 'A' record should be auto saved /inserted for opportunity record.

 

Can any one tell me how to achieve this using trigger as we don't have this feature using workflow.

 

Any help will be appreciated.

 

With Regards,

Mayank Pant

 

Is there a VLOOKUP that can be used for picklist field choice retrieval.

 

How do you create a picklist field that is populated from data in another object.

 

For example, I have two custom objects. One called Main Form and another named Admin Form.

 

The Admin Form has a Name record named "Status" with a "Choices" field with the values Open and Closed.

 

On Main Form I have a custom field named Record Status that is a pick list. I want the Main Form Record Status field to display the values in the Admin Form document named Status with the values Open and Closed.

 

In other words, the values displayed in the picklist will be populated with Open and Closed. This was all the picklist variables can be stored in a single table object. The key is "Status" and the returned values are from the Choices field of the record.

 

Any ideas would be appreciated.

Just wondering if anyone may have any suggestions how to download these free videos from this link:

https://itunes.apple.com/in/podcast/administrators-sessions/id470277903

Due to slow connectivity i am unable to view them online.
Please let me know if theres any way i can download them
Thanks
N

Today we’re excited to announce the new Salesforce Developers Discussion Forums. We’ve listened to your feedback on how we can improve the forums.  With Chatter Answers, built on the Salesforce1 Platform, we were able to implement an entirely new experience, integrated with the rest of the Salesforce Developers site.  By the way, it’s also mobile-friendly.

We’ve migrated all the existing data, including user accounts. You can use the same Salesforce account you’ve always used to login right away.  You’ll also have a great new user profile page that will highlight your community activity.  Kudos have been replaced by “liking” a post instead and you’ll now be able to filter solved vs unsolved posts.

This is, of course, only the beginning  and because it’s built on the Salesforce1 Platform, we’re going to be able to bring you more features faster than ever before.  Be sure to share any feedback, ideas, or questions you have on this forum post.

Hats off to our development team who has been working tirelessly over the past few months to bring this new experience to our community. And thanks to each of you for helping to build one of the most vibrant and collaborative developer communities ever.