• Raviteja
  • NEWBIE
  • 5 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 22
    Questions
  • 21
    Replies

HI, 

    This the example of using fieldset in apex, given in salesforce documentation.I want some enhancement to this code is that to update the values using different button.Working with Field Sets Using Apex

 

class:

=================================

public class MerchandiseDetails {

public Merchandise__c merch { get; set; }

public MerchandiseDetails() {
this.merch = getMerchandise();
}

public List<Schema.FieldSetMember> getFields() {
return SObjectType.Merchandise__c.FieldSets.Dimensions.getFields();
}

private Merchandise__c getMerchandise() {
String query = 'SELECT ';
for(Schema.FieldSetMember f : this.getFields()) {
query += f.getFieldPath() + ', ';
}
query += 'Id, Name FROM Merchandise__c LIMIT 1';
return Database.query(query);
}
}

 

Vf:

=============================================

<apex:page controller="MerchandiseDetails">
<apex:form >

<apex:pageBlock title="Product Details">
<apex:pageBlockSection title="Product">
<apex:inputField value="{!merch.Name}"/>
</apex:pageBlockSection>

<apex:pageBlockSection title="Dimensions">
<apex:repeat value="{!fields}" var="f">
<apex:inputField value="{!merch[f.fieldPath]}"
required="{!OR(f.required, f.dbrequired)}"/>
</apex:repeat>
</apex:pageBlockSection>

</apex:pageBlock>

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

 

 

I want one button in vf  to update these values.

 

Thanks.....

Hi I am getting vf page error saying that id Not specifeid in update call. i got the record values using dynamic query into vf as inputfeild.when try to update the values on click of UpdateBarcode  geting the  error.

 

Vf :

===========================

<apex:page controller="Cls_Update_Size" sidebar="false" showHeader="false" >
<apex:form >
<apex:pageBlock id="repeat" >
<div style="margin:10px 300px 10px 400px"><h3 style="margin:10px 10px 10px 2px">Enter Barcode</h3><br/>
<apex:inputText value="{!Barcode}" size="40"/>
<apex:pageMessages />
</div><br/><hr/>
<apex:panelGrid >
<apex:facet name="header">Select the Feilds to Update</apex:facet>
<table style="margin:0px 0px 0px 0px">
<apex:repeat value="{!Warpmthd}" var="c" id="table" >
<td><apex:inputCheckbox value="{!c.selected}"/>
<apex:outputlabel value="{!c.fl.Label}"/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td>
</apex:repeat><br/><br/><br/>

</table>
<table>
<apex:repeat value="{!fields}" var="f">
<tr>
<td>
<strong> <apex:outputlabel value="{!f.label}" /></strong> </td> <td> <apex:inputField value="{!feildvalue[f.fieldPath]}" />
</td>
</tr>
</apex:repeat>
</table>
<apex:commandButton action="{!UpdateEntered}" value="Update" style="margin:30px 0px 10px 100px" />
</apex:panelGrid>
<div style="margin:10px 0px 30px 1100px" ><br/><br/>
<apex:commandButton action="{!Find}" value="Find" rerender="repeat"/>&nbsp;&nbsp;
<apex:commandButton action="{!Oknext}" value="Ok and Next"/>&nbsp;&nbsp;
<apex:commandButton action="{!Close}" value="Close"/>
</div>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

Class:

======================================================================================

public class Cls_Update_Size {

public boolean updateButton { get; set; }

public String inputSection { get; set; }

public PageReference UpdateEntered(){
system.debug('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'+feildvalue);
update feildvalue;
return null;
}


public Samples_Mgmt__c feildvalue{ get; set; }
Public Id SamId=null;
Public Id OffId=null;
public Samples_Mgmt__c sample;
public string size;
list<Samples_Mgmt__c> lstsam= new list<Samples_Mgmt__c>();
list<offer__c> lstoff= new list<offer__c>();
public String Barcode { get; set;}
public list<wrap> lstwrap {get; set;}
List<Schema.FieldSetMember> lstFieldSetMember =new List<Schema.FieldSetMember>();
List<Schema.FieldSetMember> selectedFeilds = new List<Schema.FieldSetMember>();

public Cls_Update_Size(){


lstsam=[select id,Bar_Code__c from Samples_Mgmt__c];
lstFieldSetMember.addall(SObjectType.Samples_Mgmt__c.FieldSets.Search_Barcode.getFields());
lstwrap=new List<wrap>();
}

public PageReference Find(){
updateButton =true;
selectedFeilds.clear();
for(wrap w: getWarpmthd()) {
if(w.selected == true) {
selectedFeilds.add(w.fl);
}
}
feildvalue=new Samples_Mgmt__c();
system.debug('******************************'+getFeildvalues());
feildvalue=getFeildvalues();
lstwrap.clear();

return null;
}


public Samples_Mgmt__c getFeildvalues(){
SamId='a0UK0000001jFOz';

String query = 'SELECT ';
for(Schema.FieldSetMember f : this.getFields()) {
query += f.getFieldPath() + ', ';
}
query += 'Id, Name FROM Samples_Mgmt__c where id=:SamId';
return Database.query(query);
}

public List<Schema.FieldSetMember> getFields(){

return selectedFeilds;
}

public List<wrap> getWarpmthd(){

for(Schema.FieldSetMember mem :lstFieldSetMember){
lstwrap.add(new wrap(mem));
}
return lstwrap;
}
Public class Wrap{
public Boolean selected{get; set;}
public Schema.FieldSetMember fl{get; set;}
public Wrap(Schema.FieldSetMember m){
selected = false;
fl=m;
}
}

}

 

Thanks in advance...

Hi I am getting vf page error saying that id Not specifeid in update call. i got the record values using dynamic query into vf as inputfeild.when try to update the values on click of UpdateBarcode  geting the  error.

 

Vf :

===========================

<apex:page controller="Cls_Update_Size" sidebar="false" showHeader="false" >
<apex:form >
<apex:pageBlock id="repeat" >
<div style="margin:10px 300px 10px 400px"><h3 style="margin:10px 10px 10px 2px">Enter Barcode</h3><br/>
<apex:inputText value="{!Barcode}" size="40"/>
<apex:pageMessages />
</div><br/><hr/>
<apex:panelGrid >
<apex:facet name="header">Select the Feilds to Update</apex:facet>
<table style="margin:0px 0px 0px 0px">
<apex:repeat value="{!Warpmthd}" var="c" id="table" >
<td><apex:inputCheckbox value="{!c.selected}"/>
<apex:outputlabel value="{!c.fl.Label}"/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td>
</apex:repeat><br/><br/><br/>

</table>
<table>
<apex:repeat value="{!fields}" var="f">
<tr>
<td>
<strong> <apex:outputlabel value="{!f.label}" /></strong> </td> <td> <apex:inputField value="{!feildvalue[f.fieldPath]}" />
</td>
</tr>
</apex:repeat>
</table>
<apex:commandButton action="{!UpdateEntered}" value="Update" style="margin:30px 0px 10px 100px" />
</apex:panelGrid>
<div style="margin:10px 0px 30px 1100px" ><br/><br/>
<apex:commandButton action="{!Find}" value="Find" rerender="repeat"/>&nbsp;&nbsp;
<apex:commandButton action="{!Oknext}" value="Ok and Next"/>&nbsp;&nbsp;
<apex:commandButton action="{!Close}" value="Close"/>
</div>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

Class:

======================================================================================

public class Cls_Update_Size {

public boolean updateButton { get; set; }

public String inputSection { get; set; }

public PageReference UpdateEntered(){
system.debug('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'+feildvalue);
update feildvalue;
return null;
}


public Samples_Mgmt__c feildvalue{ get; set; }
Public Id SamId=null;
Public Id OffId=null;
public Samples_Mgmt__c sample;
public string size;
list<Samples_Mgmt__c> lstsam= new list<Samples_Mgmt__c>();
list<offer__c> lstoff= new list<offer__c>();
public String Barcode { get; set;}
public list<wrap> lstwrap {get; set;}
List<Schema.FieldSetMember> lstFieldSetMember =new List<Schema.FieldSetMember>();
List<Schema.FieldSetMember> selectedFeilds = new List<Schema.FieldSetMember>();

public Cls_Update_Size(){


lstsam=[select id,Bar_Code__c from Samples_Mgmt__c];
lstFieldSetMember.addall(SObjectType.Samples_Mgmt__c.FieldSets.Search_Barcode.getFields());
lstwrap=new List<wrap>();
}

public PageReference Find(){
updateButton =true;
selectedFeilds.clear();
for(wrap w: getWarpmthd()) {
if(w.selected == true) {
selectedFeilds.add(w.fl);
}
}
feildvalue=new Samples_Mgmt__c();
system.debug('******************************'+getFeildvalues());
feildvalue=getFeildvalues();
lstwrap.clear();

return null;
}


public Samples_Mgmt__c getFeildvalues(){
SamId='a0UK0000001jFOz';

String query = 'SELECT ';
for(Schema.FieldSetMember f : this.getFields()) {
query += f.getFieldPath() + ', ';
}
query += 'Id, Name FROM Samples_Mgmt__c where id=:SamId';
return Database.query(query);
}

public List<Schema.FieldSetMember> getFields(){

return selectedFeilds;
}

public List<wrap> getWarpmthd(){

for(Schema.FieldSetMember mem :lstFieldSetMember){
lstwrap.add(new wrap(mem));
}
return lstwrap;
}
Public class Wrap{
public Boolean selected{get; set;}
public Schema.FieldSetMember fl{get; set;}
public Wrap(Schema.FieldSetMember m){
selected = false;
fl=m;
}
}

}

 

Thanks in advance...

Hi,

 I have created Rest resource class to accept json(POST Method) from php.

@RestResource(urlmapping='/JsonService/*')  
global class AttorneyAdapter{    
    @HttpPost
    global static void  doPost()    {        
        RestRequest req = RestContext.request;
        RestResponse res = RestContext.response;
        string strJSON = req.requestBody.toString();          
        JSONparser parser = JSON.createParser(strJSON);           
        Type reqObj = Type.forName('MyClass');         
        MyClass myClassObj =(MyClass)parser.readValueAs(reqObj);  
             lead l=new lead();
             l.lastname=myClassObj.last_name;
             l.firstname=myClassObj.first_name;
             l.title=myClassObj.userid;
             l.state=myClassObj.state;
             l.company=myClassObj.firm_name;
             insert l;  }  }

getting  error:
message: "System.JSONException: No content to map to Object due to end of input (System Code) Class.AttorneyAdapter.doPost: line 15, column 1

Help me....

 

thanks,

Raviteja

Hi ,

 

     I have wrote some code to call the Batch Apex,problem with SOQL Query.

 

OwnerReassignment reassign = new OwnerReassignment();

datetime myDate = datetime.newInstance(2013, 5, 1);
string site='Amazon Web Services';
string stus ='open';
reassign.query = 'select lastname,ownerid,country,Territory__c,company from lead where CreatedDate > :myDate AND status=:'+stus+ 'AND Site__c!=:'+site;

reassign.email='XXX@XXX.com';

ID batchprocessid = Database.executeBatch(reassign);

 

Getting System.QueryException: unexpected token: Site__c

 

Help me to Write SOQL,Thanks in advance...

Hi ,

       I want to integrate salesforce with MS-sql database i.e,whenever data is inserted in MS-SQL database at the same time that record inserted into Salesforce.

So,for this am using dataloader..But am not able to map the data on 2 platforms.Could you please describe the Process.

 

 

Thank you in advance.

Hi ,

       I want to integrate salesforce with MS-sql database i.e,whenever data is inserted in MS-SQL database at the same time that record inserted into Salesforce.

So,for this am using dataloader..But am not able to map the data on 2 platforms.Could you please describe the Process.

 

 

Thank you in advance.

Hi,

      We Want move data from mysql to Salesforce.So,which is the best way to integrate.i.e,either by coding(Apex) or any app(Tool).Please suggest me.

 

 

Thanks in advance.

Hi,

      We Want move data from mysql to Salesforce.So,which is the best way to integrate.i.e,either by coding(Apex) or any app(Tool).Please suggest me.

 

 

Thanks in advance.

     

  Hi,

       I want know the way how to make my salesforce accounts follow in my facebook account. If they are once added to facebook account they can view my post and updates.Please come out with a thing that should be free of cost.

    Thanks in advance,

       Raviteja.

HI,


Iam writing Apex code to create new contact record,when i select the parent account the address of selected account should copy to contact address fields  in edit page itself.

 

I wrote some code :

vf:

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

<apex:page sidebar="false" Controller="cont">
    <apex:form >  
    <apex:inputfield value="{!con.accountid}">
    <apex:actionSupport event="onchange" action="{!getrec}"/>
    </apex:inputField>    
    </apex:form>
</apex:page>


class:

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

public class cont {
 
  public contact con {get; set; }
    
     public PageReference getrec() {
      if(con!=null){    
    contact cc=[select id,name from contact where id=:con.accountid ];
        }   
        return null;
    }      
}

 

Getting following Error:
------------------------------------------------

Visualforce Error

System.NullPointerException: Attempt to de-reference a null object

Error is in expression '{!getrec}' in component <apex:page> in page parentaddr

 

Please suggest me to give permission to edit activity for particular profile.     

I wrote some code but unable to display in vf

 

vf:

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

<apex:pageBlockTable value="{!get}" var="get_var" rendered="{!get_ren}">
             <apex:column value="{!get_var.name}"/>
            
            </apex:pageBlockTable>

 

class:

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

list<SObject> selrec= new list<SObject>();

 accrec=[select id,name,check__c from account limit 10];

 conrec=[select id,lastname,check__c from contact limit 10];

 public PageReference Addtoselectedlist() {
       get_ren=true;
       for(account a:accrec){
         if(a.check__c==true){
         selrec.add(a);
         }
       }
       for(contact c:conrec){
         if(c.check__c==true){
         selrec.add(c);
         }
        
    }
 
return null;
}
     public sobject[] getGet() {
        return selrec;
    }

Hi,

I want update cost  field in raw custom obj.All records need to be update when i update one record.

 

I wrote some code its not working properly


trigger:

=========================

trigger costincr on Raw__c (before update) {

list<raw__c> raw= new list<raw__c>();
raw=[select id,name,cost__c,Exp_Date__c from Raw__c ];
cost_incr w=new cost_incr();
w.incr_method(raw);
}

class:

===================

public class cost_incr{


    public void incr_method(raw__c[] raw){
    raw=[select id,name,cost__c,Exp_Date__c from Raw__c ];
        for(raw__c rec:raw)
        {
        if(rec.cost__c!=null)
        {
        rec.cost__c=rec.cost__c+55;            
         }
        }
        update raw;
    }


}

 

Thanks

i have datatable with columns

             1.account name    2.childs of account    

                    ---                                 ---

                    ---                                  ---


in first column all account names and secound column should consists child record names(parent account)

i am unable to write soql query to retrieve child records

 

 i wrote below code:

 

vf:

================================

<apex:page standardController="account" sidebar="false" recordSetVar="acc" extensions="getchilds">
    <apex:form >
        <apex:pageBlock >
            <apex:dataTable bgcolor="silver" border="2" value="{!acc}" var="a" cellspacing="10" cellpadding="5">
             <apex:facet name="header">List of account along with childs</apex:facet>
        <apex:column >
                <apex:facet name="header">parent</apex:facet>           
            <apex:outputText value="{!a.name}"/>
        </apex:column>
        <apex:column >
                <apex:facet name="header">childs</apex:facet>          
            <apex:outputText />
        </apex:column>
        <apex:column >
                <apex:facet name="header">phone</apex:facet>          
            <apex:outputText value="{!a.phone}"/>
        </apex:column>
                
            </apex:dataTable>
        </apex:pageBlock>
    </apex:form>
 </apex:page>

 

class:

==============

public class getchilds {
list<string> child=new list<string>();
    
    public getchilds(ApexPages.StandardSetController controller) {
        child=[select name from account where id=parentid];
    }

}

i have multi select picklist feild in account. the no of opportunities should be created that are equals to values selected in multi select picklist feild

 

i wrote below code . by using this iam able to create one opportunty at a time

 

trigger:

=========================

  trigger OppIns on Account (after insert) {

list<Opportunity> oppts =new list<Opportunity>();
 for(account acc:trigger.new)
 {
 oppts =new list<Opportunity>();
oppts.add(new Opportunity(name=acc.products__c,accountid=acc.id,StageName='Prospecting',Closedate=date.today()));

  }

   insert oppts;

}

 

 

for example i select  two values in picklist two opportunity should be created

i created one object to maintain the username&passwords of users.i wrote some code it showing error...


vf
-----
<apex:page Controller="Logincls" sidebar="false">
<apex:form >
  <apex:pageBlock title="GMAIL ACCOUNT" >
  <apex:pageBlockSection title="ENTER USERNAME&PASSWORD">
  <apex:inputtext label="USERNAME" Value="{UserID}"/>
  <apex:outputText ></apex:outputText>
  <apex:inputtext label="PASSWORD" Value="{Password}"/>
  </apex:pageBlockSection>
  <apex:pageblocksection >
  <apex:commandButton value="LOGIN" action="{!login}"/>
  </apex:pageblocksection>
  </apex:pageBlock>
  </apex:form>
</apex:page>

apex
-------
public class logincls
{
public string pass;
public string userid{get;set;}
public string password{get;set;}
{
pass=[select password__c from login__c where user_id__c=:userid];
}
public pagereference login
{
if(password=pass)
pagereference hello = new pagereference('apex/helloworld');
hello.setredirect(true);
return hello;
}
}

THANKS IN ADVANCE...

  Hi,

       I want know the way how to make my salesforce accounts follow in my facebook account. If they are once added to facebook account they can view my post and updates.Please come out with a thing that should be free of cost.

    Thanks in advance,

       Raviteja.

Hello,

I am trying to create a trigger that makes a number field automatically be populated with data that is in a formula field whenever the formula field is changed. (regardless of whether a user edited the record or not).

The code of the formula field (Parent_number_reached__c) is as follows: Parent_Object__r.Number_Reached__c
The Number field is called Parent_number_reached_local__c

I want Parent_number_reached_local__c to have the data be synchronized with Parent_number_reached__c, so that whenever Parent_number_reached__c is changed, change Parent_number_reached_local__c to the same value.

I am told that this is a relatively simple Trigger to write. Please send me such a code.

Thank you,
Menachem
My class

public with sharing class AccountContactRoles {
    private final Contact acr;
   
    public AccountContactRoles(ApexPages.StandardController controller){
        this.acr = (Contact)controller.getRecord();
    }
   
    public List<AccountContactRole> acrs {
        get {
            if (acrs == null) {
                acrs = [Select Id, AccountId, ContactId, Role, IsPrimary From AccountContactRole
                    Where ContactId=:acr.Id];               
            }
            return acrs;
        }
        private set;
    }
}


my Test class

@isTest
private class TestAccountcontactroleClass{
    @isTest
    private static void testClass()
    {
    //Standard controller of Accountcontactrole
    //Create a new instance of Accountcontactrole
    Account acc = new Account(Name = 'Test Account');
    insert acc;
    Contact con = new Contact(LastName = 'Test Last Name', AccountId = acc.Id);
    insert con;
   
    AccountContactRole acr1 = new AccountContactRole();
                acr1.AccountId = acc.Id;
                acr1.ContactId = con.Id;
                acr1.Role = 'Test 1';
                acr1.IsPrimary=True;
            insert acr1;
    //Insert the object virtually
  

    //Create a new instance of standard controller
    ApexPages.StandardController sc = new ApexPages.standardController(con);

    AccountContactRoles controller = new AccountContactRoles(sc);   
    }
}



And am getting the following error.

Error: Compile Error: Dependent class is invalid and needs recompilation:
AccountContactRoles: line 11, column 17: Illegal assignment from LIST<AccountContactRole> to LIST<AccountContactRole> at line 25 column 42.


i dont understand why am getting this..help me out ...thanks
Hi,

We are accessing Salesforce API in .NET

One of the object we are saving from the SF API has a DateTime field. It seems that due to timezone differences between the SF User ( GMT + 11 ) and the host server of .NET application ( GMT ) is causing wrong DateTime being saved in the SF.

Any way to force saving DateTimes as entered wihtout timezone information / adjustment?

Regards
Hi everyone i have a requirement to create criteria based sharingrule. but edition limit 50 (enterprise) is exceeded how can i create sharing rule for account object.For this account OWD is set as private!! give me some valuable suggestions or ideas..!!

Hi I am getting vf page error saying that id Not specifeid in update call. i got the record values using dynamic query into vf as inputfeild.when try to update the values on click of UpdateBarcode  geting the  error.

 

Vf :

===========================

<apex:page controller="Cls_Update_Size" sidebar="false" showHeader="false" >
<apex:form >
<apex:pageBlock id="repeat" >
<div style="margin:10px 300px 10px 400px"><h3 style="margin:10px 10px 10px 2px">Enter Barcode</h3><br/>
<apex:inputText value="{!Barcode}" size="40"/>
<apex:pageMessages />
</div><br/><hr/>
<apex:panelGrid >
<apex:facet name="header">Select the Feilds to Update</apex:facet>
<table style="margin:0px 0px 0px 0px">
<apex:repeat value="{!Warpmthd}" var="c" id="table" >
<td><apex:inputCheckbox value="{!c.selected}"/>
<apex:outputlabel value="{!c.fl.Label}"/> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </td>
</apex:repeat><br/><br/><br/>

</table>
<table>
<apex:repeat value="{!fields}" var="f">
<tr>
<td>
<strong> <apex:outputlabel value="{!f.label}" /></strong> </td> <td> <apex:inputField value="{!feildvalue[f.fieldPath]}" />
</td>
</tr>
</apex:repeat>
</table>
<apex:commandButton action="{!UpdateEntered}" value="Update" style="margin:30px 0px 10px 100px" />
</apex:panelGrid>
<div style="margin:10px 0px 30px 1100px" ><br/><br/>
<apex:commandButton action="{!Find}" value="Find" rerender="repeat"/>&nbsp;&nbsp;
<apex:commandButton action="{!Oknext}" value="Ok and Next"/>&nbsp;&nbsp;
<apex:commandButton action="{!Close}" value="Close"/>
</div>
</apex:pageBlock>
</apex:form>
</apex:page>

 

 

Class:

======================================================================================

public class Cls_Update_Size {

public boolean updateButton { get; set; }

public String inputSection { get; set; }

public PageReference UpdateEntered(){
system.debug('@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@'+feildvalue);
update feildvalue;
return null;
}


public Samples_Mgmt__c feildvalue{ get; set; }
Public Id SamId=null;
Public Id OffId=null;
public Samples_Mgmt__c sample;
public string size;
list<Samples_Mgmt__c> lstsam= new list<Samples_Mgmt__c>();
list<offer__c> lstoff= new list<offer__c>();
public String Barcode { get; set;}
public list<wrap> lstwrap {get; set;}
List<Schema.FieldSetMember> lstFieldSetMember =new List<Schema.FieldSetMember>();
List<Schema.FieldSetMember> selectedFeilds = new List<Schema.FieldSetMember>();

public Cls_Update_Size(){


lstsam=[select id,Bar_Code__c from Samples_Mgmt__c];
lstFieldSetMember.addall(SObjectType.Samples_Mgmt__c.FieldSets.Search_Barcode.getFields());
lstwrap=new List<wrap>();
}

public PageReference Find(){
updateButton =true;
selectedFeilds.clear();
for(wrap w: getWarpmthd()) {
if(w.selected == true) {
selectedFeilds.add(w.fl);
}
}
feildvalue=new Samples_Mgmt__c();
system.debug('******************************'+getFeildvalues());
feildvalue=getFeildvalues();
lstwrap.clear();

return null;
}


public Samples_Mgmt__c getFeildvalues(){
SamId='a0UK0000001jFOz';

String query = 'SELECT ';
for(Schema.FieldSetMember f : this.getFields()) {
query += f.getFieldPath() + ', ';
}
query += 'Id, Name FROM Samples_Mgmt__c where id=:SamId';
return Database.query(query);
}

public List<Schema.FieldSetMember> getFields(){

return selectedFeilds;
}

public List<wrap> getWarpmthd(){

for(Schema.FieldSetMember mem :lstFieldSetMember){
lstwrap.add(new wrap(mem));
}
return lstwrap;
}
Public class Wrap{
public Boolean selected{get; set;}
public Schema.FieldSetMember fl{get; set;}
public Wrap(Schema.FieldSetMember m){
selected = false;
fl=m;
}
}

}

 

Thanks in advance...

New to salesforce development. Primarily a dot net developer.

In two or more properties of my controller I want to access values from another controller's properties.

This is how my controller is looking -

 

Controller1 POutlook = new Controller1();

 

 public Decimal currentMonthActualPer {
       get
        {
          return Controller1.currentMonthActualPer;
        }
    }
     public Decimal currentMonthForecastPer {
       get
        {
          return Controller1.currentMonthForecastPer;
        }
    }
    Public String currentMonthBackground{
       get
        {
          return Controller1.currentMonthBackground;
        }
    }
  

 

In my visualfocepage I am accesing this properties directly as -

 

{!currentMonthActualPer} and {!currentMonthForecastPer}

 

Now, I am not sure about Page life cycle of Apex page just wanted to confirm that Apex engine will execute statement -

Controller1 POutlook = new Controller1(); only once or will it call it every time a property's is called(Binded) in visualforce page.

Lot of calculation code has been written Controller1 constructer so just want to execute it once only.

 

Hi All,

 

I have a date field that is obtained as user input. I need to dispaly a report that contains the count of certain value for each date. So am auto incrementing the date of the date field. After incrementing the field, i have to assign the value to the same field. But am getting wrong incremented values.

 

I have assigned a field called start date.

 

                           Date startDT=Date.newInstance(2013, 8, 15); -- 2013-08-15 00:00:00

 

Then within the for loop am incrementing the day of the field and assigning to the same filed...

 

                          startDT = startDT.addDays(1);

 

When i use debug and get the output, the startDT value changes to 2013-12-12 00:00:00.

 

I don't know what mistake i have done. Can anyone please help me??????

 

Hi ,

 

     I have wrote some code to call the Batch Apex,problem with SOQL Query.

 

OwnerReassignment reassign = new OwnerReassignment();

datetime myDate = datetime.newInstance(2013, 5, 1);
string site='Amazon Web Services';
string stus ='open';
reassign.query = 'select lastname,ownerid,country,Territory__c,company from lead where CreatedDate > :myDate AND status=:'+stus+ 'AND Site__c!=:'+site;

reassign.email='XXX@XXX.com';

ID batchprocessid = Database.executeBatch(reassign);

 

Getting System.QueryException: unexpected token: Site__c

 

Help me to Write SOQL,Thanks in advance...

Hi,

      We Want move data from mysql to Salesforce.So,which is the best way to integrate.i.e,either by coding(Apex) or any app(Tool).Please suggest me.

 

 

Thanks in advance.

     

  Hi,

       I want know the way how to make my salesforce accounts follow in my facebook account. If they are once added to facebook account they can view my post and updates.Please come out with a thing that should be free of cost.

    Thanks in advance,

       Raviteja.

Plz guys help me out in this issue....

 

I want the side bar content to be appeared as different for each obeject home page...how can i achieve this and also how to add the custom link to this  ??

Please suggest me to give permission to edit activity for particular profile.     

i have multi select picklist feild in account. the no of opportunities should be created that are equals to values selected in multi select picklist feild

 

i wrote below code . by using this iam able to create one opportunty at a time

 

trigger:

=========================

  trigger OppIns on Account (after insert) {

list<Opportunity> oppts =new list<Opportunity>();
 for(account acc:trigger.new)
 {
 oppts =new list<Opportunity>();
oppts.add(new Opportunity(name=acc.products__c,accountid=acc.id,StageName='Prospecting',Closedate=date.today()));

  }

   insert oppts;

}

 

 

for example i select  two values in picklist two opportunity should be created

Please help on this problem. I got the following error message (pasted below) while trying to install Force.Com IDE on Eclipse. I tried on three different machines and two versions of Eclipse but got the same error. Thanks.

 

An error occurred while collecting items to be installed
session context was:(profile=epp.package.jee, phase=org.eclipse.equinox.internal.p2.engine.phases.Collect, operand=, action=).
Problems downloading artifact: osgi.bundle,com.salesforce.ide.api,25.0.0.201206181021.
MD5 hash is not as expected. Expected: cfe2af79a543696580b0dc8120ae63ea and found 51dc4152445563a0cf707399b18366cc.
Problems downloading artifact: osgi.bundle,com.salesforce.ide.documentation,25.0.0.201206181021.
MD5 hash is not as expected. Expected: 314d2f02d4c7e63caaff7feff76dcd87 and found 40018475a97480482fd77be466fe5cb5.

How to create a record based on the response of webservice call, when the data of the record being created needs to be passed in the  webservice callout?

 

Please let me know your thoughts.

 

Thanks and regards,

Kumar