• palak agarwal
  • NEWBIE
  • 0 Points
  • Member since 2011

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

Hi all,

 

I have created two visualforce tabs for contact, each showing records of two diferent record types i.e Contact and Job Seeker, using enhanced list.

I want add list view buttons such as new Contact and new job seeker on visualforce page, according to the recordtype.

Is it possible to do so. Please help me its urgent.

 

With Regards,

Palak Agarwal

Hi all,

 

I am trying to fetch all the fields on contact,  which belong to a particular Layout, through apex code.  So far I am not able to find solution to this problem. Please , if anyone knows how to do it, reply. Its urgent.

 

with Regards

Palak agarwal

Hi all,

 

I am trying to read inputField value from visualforce page to apex controller.

 

Below is the code for VF page, which allows user to choose the field from the picklist and  will give its respectively.

 

<apex:page controller="dynamicInputField">
<apex:form id="Test2">
<apex:pageBlock >

<apex:pageBlockButtons >
<apex:commandButton value="test" action="{!testfunc}"/>
</apex:pageBlockButtons>
<apex:pageBlockSection >

<apeX:actionRegion >
<apex:selectList value="{!f}" multiselect="false" size="1" style="width:250px">
<apex:selectOptions value="{!items}"/>
<apex:actionSupport event="onchange" action="{!rensection}" reRender="Test2" />


</apex:selectList>
</apeX:actionRegion>
<apex:variable value="{!f}" var="test" />
<apex:inputField value="{!acc[test]}" rendered="{!rensec}" >
</apex:inputfield>

<!-- <apex:repeat value="{!field}" var="afield">


</apex:repeat> -->



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

 

 

controller :

 

public class dynamicInputField{

public dynamicInputField() {
acc = new account();
acclist = new list<account>();
rensec = false;
f= 'Industry';
field = new list<string>();
field.clear();
popFields();
system.debug('test my code cons'+acc);

}

public account acc{get;set;}
public list<string> field{get;set;}
public Map<String, Schema.SobjectField> fieldMap{get;set;}
public list<string> filterFields{get;set;}
public string f{get;set;}
public boolean rensec{get;set;}
public string tid{get;set;}
public string val{get;set;}
public list<account> acclist{get;set;}
public ApexPages.StandardController controller;

public pagereference testfunc(){
Schema.DescribeFieldResult r = Account.name.getDescribe();
Schema.sObjectField T = r.getSObjectField();
system.debug('testing my account '+ acc.name);
system.debug('test my account'+acc);
insert acc;
system.debug('test my account'+acc);
return null;

}

public void rensection(){

rensec = true;
system.debug('test my code'+f);
acclist.add(acc);
// field = new list<string>();
field.add(f);
system.debug('/test my code'+field);
system.debug('/test my code'+acc);

}

public dynamicInputField(ApexPages.StandardController controller){
this.controller = controller;
acc = new account();
rensec = false;
f= 'Industry';
field = new list<string>();
field.clear();
popFields();

}
public List<String> threeFieldList {
get {
if (threeFieldList == null) {
threeFieldList = new List<String>();
threeFieldList.add('Industry');
threeFieldList.add('AnnualRevenue');
threeFieldList.add('BillingCity');
}
return threeFieldList;
}
private set;
}

private void popFields() {

filterFields = new list<string>();
Schema.DescribeSObjectResult r = account.sObjectType.getDescribe();
system.debug('test my code fields :'+r);
fieldMap = Schema.SobjectType.account.fields.getMap();
for (String s : fieldMap.keySet()) {

system.debug('filterFieldstop'+s);
filterFields.add(s);



}

}


public void setvalue(){
acc = new Account();
String fvalue = ApexPages.CurrentPage().getParameters().get('fieldvalue');
system.debug('fvalue'+fvalue);
system.debug('fvalue21'+acc);

}



public List<SelectOption> items { get
{
List<String> sorted = new List<String>(filterFields);
sorted.sort();
List<SelectOption> options = new List<SelectOption>();
options.add(new SelectOption('none','none'));
for (String s : sorted ) {
system.debug('filterFields'+s);
options.add(new SelectOption(s,fieldMap.get(s).getDescribe().getLabel()));
}
return options;
}
}
}

 

 

----------------------------------------------------------------------------

 

I am not able to read the value of inputfield that user gives. Please help me how to read and store it in a variable, so that i can use it in a query.

 

 

 

 

hi all,

 

I am trying to call java servlet through apex using servlets. This works fine when i am not passing any parameter in the request like the one below:

req.setEndpoint('http://ec2-174-129-109-194.compute-1.amazonaws.com/examples/servlets/servlet/dmgevents')

 

but as soon as i attached parameters to  the request it starts giving status 500 error.

I am passing parameters as below:

 

req.setEndpoint('http://ec2-174-129-109-194.compute-1.amazonaws.com/examples/servlets/servlet/dmgevents?an=Autocomplete.docx&aid=a07M0000000hfXX&dn=shell1 - S-00003 - 20111111060421.doc');

 

 

Please help if anybody has idea about this issue.

 

with regards,

Palak

 

hi all,

Is it possible to send file in word format in multipart http post request?

Hi all,

 

I have created two visualforce tabs for contact, each showing records of two diferent record types i.e Contact and Job Seeker, using enhanced list.

I want add list view buttons such as new Contact and new job seeker on visualforce page, according to the recordtype.

Is it possible to do so. Please help me its urgent.

 

With Regards,

Palak Agarwal

Hi,

 

I have to create the list of custom as well as some standard fields of contact, which are added to a layout.

I also need to discard standard fields such as createdID etc. and formula fields.

Currently I am using describeSobject and able to retreive all the fields on contacts.

 

Please help me, it is urgent.

 

With Regards

Palak Agarwal

  • February 21, 2012
  • Like
  • 0