• Abu Hashim
  • NEWBIE
  • 125 Points
  • Member since 2015

  • Chatter
    Feed
  • 4
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 41
    Replies
Hi,
i am working on field sets.
here is my VF code:
 
<apex:PageblockSection columns="2" >
             
                      <apex:repeat value="{!$ObjectType.Student__c.FieldSets.STU_FS2}" var="F2">
                      <apex:inputField value="{!Student__c[F2]}"/>
                      </apex:repeat>
              </apex:PageblockSection>  
              
              <apex:PageblockSection columns="2" >
             
                      <apex:repeat value="{!$ObjectType.Student__c.FieldSets.STU_FS3}" var="F3">
                      <apex:inputField value="{!Student__c[F3]}"/>
                      </apex:repeat>
              </apex:PageblockSection>

there are 3 field sets STU_FS1, STU_FS2 and STU_FS3. When they are shown on the VF page, the fields are coming as it is defined in the object. How can i give individual names to such field which are present in field sets STU_FS1,2,3. In short, i want to use something like label for the fields present in field sets.
Hello 
  I made changes for some of the standard fields. I know that we cannot deploy the standard fields using change sets. Can someone suggest me a solution. How to deploy the standard field changes (Picklist)

Regards
 

Hi,

I need to create the link and when i click the link it open the form in 

Account page. My form is 

<apex:page standardcontroller="Account" tabstyle="Account" extensions="MyExtension" >
 
 <apex:form >
 
 <apex:sectionheader title="Account Details" subtitle="{!if(Account.Id==null,'New Account',Account.Name)}"></apex:sectionheader>
<apex:pageblock mode="edit" id="leadPB" title="Account Edit">
 
 <apex:pageblockbuttons >
<apex:commandbutton action="{!save}" value="Save"></apex:commandbutton>
 <!-- If you wish to implement Save & New functionality you will have to write an Apex Extension with your own Save & New Method -->
 <apex:commandbutton action="{!cancel}" value="Cancel"></apex:commandbutton>
 </apex:pageblockbuttons>
 
        <apex:pageBlockSection >
     
        
            <apex:inputtext value="{!Account.LastName}" label="Customer Name"/>
            <apex:inputtext value="{!Account.PersonMobilePhone}"/>
            <apex:inputtext value="{!Account.CustomLandLine__c}"/>
            <apex:inputField value="{!Account.City__c}"/>
            <apex:inputField value="{!Account.PersonEmail}"/>
             <apex:inputField value="{!Account.Source__c}"/>
            
            <!-- <apex:commandButton action="{!save}" value="Save!"/>-->
        </apex:pageBlockSection>
    </apex:pageBlock>
<apex:pageMessages />
</apex:form>



</apex:page>
how to create link for this page????
friends
I have a json file , I want to use deserializeuntyped method to understand it.

public class Jsonexample5
{
   public string result{get;set;}
   
   public Jsonexample5()
   {
     string jsonInput='{"response":{"count":1,"benchmark":0.22567009925842,"requests":[{"request":{"id":537481,"image_thumbnail":"","title":"Request for new bin(s) - residential","description":"Propmain ref  3234-1114","status":"submitted","address":"36 Pine Tree Close","location":"Peterborough, England","zipcode":"PE1 1EJ","user":"","date_created":1417173208,"count_comments":0,"count_followers":0,"count_supporters":0,"lat":52.599967,"lon":-0.233482,"user_follows":0,"user_comments":0,"user_request":1,"rank":"0"}}],"status":{"type":"success","message":"Success","code":200,"code_message":"Ok"}}}';
       
     Map<String,Object> jsmap = (Map<String,Object>)JSON.deserializeUntyped(jsonInput);
     system.debug('==>'+jsmap);
 
   }
}

I have 2 things to clarify
a) when I execute the above in developer console I get the deserialized format but it does not include attributes after location.
    i.e atrributes like zipcode , user , date_created , count_comments  etc are missing.

    The same input json string when executed in    http://codebeautify.org/jsonviewer#  gives all the attributes.

    I want to know why is this happening. Am I missing something:?


b) In real time scenario , do we use third pary tools to generate classes for json input or we have to manually write our own wrapper classes?

thanks
divya manohar
 
Hi All,

I have created a custom Lead Page using visualforce page. I am successfully able to integrate with the Lead control and use the tabStyle as Lead. Now I also want to show the activity history of the Lead in my custom page. Is there a way of doing this ? 

Please let me know if my question is not clear or any of you need any more update ?

Thanks in advance
Hi all
,
When I click button "New Quote" on one Opportunity after adding products, the page shows "A problem with the OnClick JavaScript for this button or link was encountered: unterminated string literal"
But only for one specific Account.

Should I revise the "OnClick JavaScript" for the button?

Thank you,
Shuang
How to satisfy these below lines in test class in salesforce?


Profile userProfile = [SELECT Id FROM Profile WHERE Name='System Administrator'];
            user userRole = [SELECT id, name, UserRole.name FROM User WHERE UserRole.name like '% FAWS Technical Onboarding Manager%'];
       if((userProfile.Id != UserInfo.getProfileId())||(userRole.Id != userInfo.getUserRoleId())){  
           

can any one suggest please?
Hi,
i am working on field sets.
here is my VF code:
 
<apex:PageblockSection columns="2" >
             
                      <apex:repeat value="{!$ObjectType.Student__c.FieldSets.STU_FS2}" var="F2">
                      <apex:inputField value="{!Student__c[F2]}"/>
                      </apex:repeat>
              </apex:PageblockSection>  
              
              <apex:PageblockSection columns="2" >
             
                      <apex:repeat value="{!$ObjectType.Student__c.FieldSets.STU_FS3}" var="F3">
                      <apex:inputField value="{!Student__c[F3]}"/>
                      </apex:repeat>
              </apex:PageblockSection>

there are 3 field sets STU_FS1, STU_FS2 and STU_FS3. When they are shown on the VF page, the fields are coming as it is defined in the object. How can i give individual names to such field which are present in field sets STU_FS1,2,3. In short, i want to use something like label for the fields present in field sets.
Hi all,
        I want to practice deployment using sandboxes for my Developer I certification. Is there any way I can do that in my free developer org? (I don't have sandboxes)
I will be using Trailhead as part of my training programme and I was looking into the possibility of monitoring the teams progress and achievements. Is there any way to do this? They will be required to complete 3-4 of the basic modules to gain an understanding of the system, the key words and how to complete a few basic functions. Ideally, I would like to monitor the individuals log ins and the number of modules completed the ensure they are ready to progress to the following training element.

Thanks!
I have this query below where in the output Account.Corportate_Code__c and Account.Industry column values are being concatenated as "AccountSNHUEducation" .

Account.Corportate_Code__c has value = SNHU
Account.Industry = Education

SELECT id,Account.Corportate_Code__c, StartDate, EndDate,Number_of_Backup_days_in_contract__c,Account.Industry, CreatedDate, LastModifiedDate, (SELECT id FROM Opportunities) FROM Contract WHERE Status = 'Activated' AND RecordTypeId = '01270000000Hp9oAAC'

I am running this query in Python and my code is:
query = (
                "SELECT Account.Corportate_Code__c, id, Account.Industry,  (SELECT id FROM Opportunities)  FROM Contract WHERE Status = 'Activated' AND RecordTypeId = '01270000000Hp9oAAC'")
            records = svc.query(query)
for rec in records[sf.records:]:
                        #out.write(rec)
                        print  str(rec[1]) + " : " + str(rec[2]) + " : " + str(rec[3]) + " : " + str(rec[4])

 
Hey everybody I'm new to writing formulas and I could really use some help with these 2 formula fields that I need to implement in my org. Any and all help would be greatly appreciated!

1. Write a formula field on the Opportunity Object that will show the value of the Opportunity.Amount field ONLY if the logged in user is the Opportunity Owner

2. Write a formula field that concatenates the Opportunity.Name, the Opportunity.Owner, and the Opportunity.Probability rounded DOWN to the nearest whole number.
Hi ,
I Have list of 10 accounts which i need to update out of that 10 records 5 records get updated and 5 records get failed to update due to validation rules ,Is there a way to get the failed record ids .any ideas ??

Thanks 
Kiran
Hi,
I'm overriding standard pagelayout with a visualforce page, but at the same time I'd like to render fields based on the selected recordtype.

I can easily get the recordtype Id by
public string rectypeid {
    get
    {
    rectypeid=ApexPages.currentPage().getParameters().get('RecordType');
    return rectypeid;
}
    set;
    }
Is there an easy way to retrieve the RecordtypeName (like above) or am I forced to use a query:
String RTName = [select Name from RecordType where RecordType.SobjectType = 'My_Obj__c' and RecordtypeId =: rectypeid  limit 1][0].Name;
In order to make the code more readable in the future, I'd prefer to use the name string rather than the Id.

Even if I know maintaining the Id is probably easier than the Name.

thanks for any suggestion,
Alex



 
Hello 
  I made changes for some of the standard fields. I know that we cannot deploy the standard fields using change sets. Can someone suggest me a solution. How to deploy the standard field changes (Picklist)

Regards
 
Hi,
Stuck in one requirement.in which at the time of create and update account one trgger has to be fired which will call class where i have to comapre login user with account's field that is Keymanager if success then need to assign a specfic permission set to the user.suppose there is 10-15 records where keymanager matches with login id then all have to have that permission like read,write and edit.need inputs
Hi, I'm totally new to salesforce.  I have a trigger which calls external URL on insert and update.
I can't get 100% code coverage. I get 81% at sandbox but on production i get less then 75%.
Here is my trigger
trigger EmsTrigger on Contact (after insert, after update){
    List<Contact> contactsToUpdate = new List<Contact>{};
    String id;
   for (Contact con: Trigger.new){
        contactsToUpdate.add(con);
        id=con.Id;
   }
   if(!contactsToUpdate.isEmpty()){
      if(UserInfo.getProfileId()!='hidden profileid'){
        Integer i=[select count() from Enrolment__c WHERE contact__c=:id];
          if(i>0){
            String JSONString = JSON.serialize(contactsToUpdate);
            Ems.doCallout(JSONString);
          }
      }
        
    }
}
My unit test
@IsTest

public class testEmsTrigger {
    
    static testmethod void insertContact(){
      Contact con = new Contact();
      con.FirstName='David';
      con.LastName='Hagen';
      insert con;
     
       Test.startTest();
       Test.setMock(HttpCalloutMock.class, new ExampleCalloutMock());
       Test.stopTest();
    }
}

I think issue is here in the following line which does not excute when test is run.
if(i>0){
}
 
I'm new to salesforce and would like to create a sample vf page which accept user input and once I clicked on save it will get inserted into my custom object and I want another button to show the record of the custom object on vf page, can you please help me for the code of vf and controller.
Its just for my learning purpose.
i need get error if  inserting a records  if dml is fails  shows error 
how to do  please tell me let you know


public class batchapexerror implements database.Batchable<sobject>,database.stateful {
    public string errors[] =new new string[]{'jnkjdnksdj','hfhh'};
    public database.QueryLocator start(database.BatchableContext be){
        return database.getQueryLocator('select id,name,firstname,lastname from account ');
       }
    public void execute(database.BatchableContext bc,list<sobject> acc){
        account a=new account();
        for(account a1:a){
               try{
                   if(a.AnnualRevenue==50000){
                a.name='prakesh';
                a.industry='banking';
                insert a;
                   }
               }catch(exception e){
                       errors.add(e.getmessage());
                   }
                   
            } 
            
        }
    public void finish(database.BatchableContext bc){
        
    }
   }