• Anjaneylu
  • NEWBIE
  • 169 Points
  • Member since 2014
  • Self

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 76
    Questions
  • 75
    Replies
Hi all,
I am trying to build a bar chart in lightning component with picklist values(X- axis) against the list of string (Y - Axis) values. 
I tried to find several blogs, but I could not able to find the exact one. 

Can someone help me with one of the examples. 
Thank you.User-added image
Hi All,
I am trying to fetch the account records from the queryResult of Salesforce to Salesforce integration response. But unable to split from the data. Can someone please help me. 
 
string query1 = 'Select Id, Name, phone from Account limit 10';
partnerSoapSforceCom.QueryResult qr = new partnerSoapSforceCom.QueryResult();
   qr =  partner.Query_http(query1);
List<sobjectPartnerSoapSforceCom.sObject_x> sobjectlist =  qr.records;
for(sobjectPartnerSoapSforceCom.sObject_x aa : sobjectlist ){
    system.debug('aa.type_x---'+aa.type_x);
    system.debug('aa.fieldsToNull---'+aa.fieldsToNull);	
    system.debug('aa.anyElement---'+aa.anyElement);	
    
}

Here the output response from the above debug log is like below...

 
(sObject_x:[Id=0013I000003wus6QAA, Id_type_info=(Id, urn:sobject.partner.soap.sforce.com, ID, 1, 1, true), anyElement=(XMLNode[ELEMENT,Id,urn:sobject.partner.soap.sforce.com,null,null,[XMLNode[TEXT,null,null,null,null,null,0013I000003wus6QAA,]],null,], XMLNode[ELEMENT,Name,urn:sobject.partner.soap.sforce.com,null,null,[XMLNode[TEXT,null,null,null,null,null,test Account,]],null,], XMLNode[ELEMENT,Phone,urn:sobject.partner.soap.sforce.com,[common.apex.api.dom.XmlNode$Attribute@73219693],[common.apex.api.dom.XmlNode$NamespaceDef@777814a5],null,null,]), anyElement_type_info=(anyElement, urn:sobject.partner.soap.sforce.com, List<DOM.XmlNode>, 0, 1, true), apex_schema_type_info=(urn:sobject.partner.soap.sforce.com, true, false), field_order_type_info=(type_x, fieldsToNull, Id, anyElement), fieldsToNull=(), fieldsToNull_type_info=(fieldsToNull, urn:sobject.partner.soap.sforce.com, string, 0, -1, true), type_x=Account, type_x_type_info=(type, urn:sobject.partner.soap.sforce.com, string, 1, 1, false)])

Thank you.
Hi All,

Here i am unable to handle/bind the value from vf page Input field to controller extension. While saving the record it is havaing the value as null for picklist fields..Can you help me on this. I want to save the values what i entered/selected on UI.
 
<apex:page standardcontroller="Account" extensions="QuickActionToCreateCaseExtension" showHeader="false" doctype="html-5.0" lightningStylesheets="true"> 
   <apex:slds />

    
    
        <apex:form id="FormID">
            <apex:actionFunction action="{!createCase}" name="createCase" rerender="FormID,out"  oncomplete="window.opener.location.refresh();"/> 
            <apex:outputPanel id="out">
                <table >
                    <tbody>
                        <tr>
                            <td class = "labelCol">
                                <label>Type: &nbsp; &nbsp;</label>
                            </td>
                            <td>  <apex:inputfield value="{!theCase.type}" id="TypeID"/> </td>
                            
                        </tr>
                        <tr>
                            <td class = "labelCol" id="subtabid">
                                <label>Sub Type: &nbsp; &nbsp;</label>
                            </td>
                            <td>
                              <apex:inputfield value="{!theCase.Sub_Type__c}" onchange="CaseSubTypeChange();" id="SubtypeID"/>
                            </td>
                        </tr>
                        <tr id="AssetID">
                            <td class = "labelCol">
                                <label>Serial Number : &nbsp; &nbsp;</label>
                            </td>
                            <td> </td>
                        </tr> 
                         <tr id="ReplcmntSerId">
                            <td class = "labelCol">
                                <label>Replacement Serial Number : &nbsp; &nbsp;</label>
                            </td>
                            <td> <apex:inputField value="{!theCase.Replacement_Serial_Number__c}"> </apex:inputField>  </td>
                        </tr>
                        <tr id="DescrID">
                            <td class = "labelCol">
                                <label>Description : &nbsp; &nbsp;</label>
                            </td>
                            <td> <a data-toggle="tooltip" title="If you selected 'Partial Solution' or 'Component', then please provide the following:
						Target Solution (Root Asset Id):
							Asset Ids (SFDC Ids - Bundle = Level 2, Component = Level 3):"><apex:inputField value="{!theCase.Description}" id="DESId" > </apex:inputField>  </a></td>
                        </tr>
                           
                        <tr id="DestnSiteID">
                            <td class = "labelCol">
                                <label>Destination Site : &nbsp; &nbsp;</label>
                            </td>
                            <td> <apex:inputField value="{!theCase.Destination_Site__c}"> </apex:inputField>  </td>
                        </tr>
                        <tr id="AssetMoveID">
                            <td class = "labelCol">
                                <label>Asset Move Type : &nbsp; &nbsp;</label>
                            </td>
                            <td> <apex:inputField value="{!theCase.Asset_Move_Type__c}"> </apex:inputField>  </td>
                        </tr>
                        <tr id="OrderID">
                            <td class = "labelCol">
                                <label>Order : &nbsp; &nbsp;</label>
                            </td>
                            <td> <apex:inputField value="{!theCase.Order__c}"> </apex:inputField>  </td>
                        </tr> 
                        <tr>
                            <td align= "Center">
                                <button type="button" 
                                        style="position:fixed;padding:5px 10px; font-size:13px; font-weight:bold; line-height:18px;" onclick = "createCase()" id="addcasebutton">Create Case</button> 
                            </td>
                        </tr>
                    </tbody>
                </table>
            </apex:outputPanel>
        </apex:form>
    

    
</apex:page>
 
public class QuickActionToCreateIBATCaseExtension {
    private final SObject parent;
    public Case theCase {get; set;}
	//public Case theFinalCase {get; set;}

    public String lastError {get; set;}
    
    public account acc {get; set;}
    Id ITRecordTypeId = Schema.SObjectType.Case.getRecordTypeInfosByName().get('IT').getRecordTypeId();
    
    public QuickActionToCreateCaseExtension (apexpages.StandardController controller){
        parent = controller.getRecord();
        acc = [select id,name, Geo2__c from account where id =:parent.id ];
        theCase = new Case();
        //theFinalCase = new Case();
		theCase.recordtypeId = IBATRecordTypeId ;

        lastError = '';
    }
    public PageReference createCase() {
		theCase = new Case();

        theCase.origin = 'Internal';
       // theCase.Subject =  +theCase.Destination_Site__c;
        theCase.accountId = parent.id;
        theCase.MDMGeo__c = acc.Geo2__c;
        theCase.Priority = '1-High';
       	/*theCase.type = +theCase.Type;
        theCase.Sub_Type__c = +theCase.Sub_Type__c; */
        theCase.recordtypeid = ibRecordTypeId ;
        theCase.Subject = acc.name+ '| ' +theCase.Destination_Site__c;         

        createNewCase();

        return null;
    }
    private void createNewCase() {      
        try {
            /*Database.DMLOptions dml = new Database.DMLOptions(); 
            dml.DuplicateRuleHeader.AllowSave = true;
            //Account duplicateAccount = new Account(Name='dupe');
            Database.SaveResult sr = Database.insert(theCase, dml);*/
            insert theCase;
            //
           // if(sr.isSuccess()){
               // System.debug('Case inserted successfully and id is --'+sr.getId());
                FeedItem post = new FeedItem();
                post.ParentId = ApexPages.currentPage().getParameters().get('id');
                post.Body = 'IBAT case created';
                post.type = 'LinkPost'; 
                post.LinkUrl = '/' + theCase.Id;
                post.Title = theCase.Subject;
                insert post;
                
           /* }
            else{
                System.debug('errors are---'+sr.getErrors());
            }*/
            
            
            
        } catch(System.Exception ex){
            lastError = ex.getMessage();
            system.debug('ThelastError  '+lastError);
            
        }
    }   
    
    
}

Your inputs much appreciated. 

Thanks in advance,
 
Hi all,

I am trying to implement jquery to show and hide fields. But when i used alert statement it is working for 1st picklist value. But for second picklist value it is not showing. Can you help me out here. Check the code once !!
Thanks in Advance.
<apex:page standardcontroller="Account" extensions="QuickActionToCreateIBATCaseExtension" showHeader="false" doctype="html-5.0"> 

    <style type="text/css">
        tr {  display: table-row; vertical-align: inherit; border-color: inherit; }
        div { font-weight: bold;  }
        .lableCol { padding-top: 3px; padding-bottom: 3px; width: 50%; }
        .row { content: ""; display: table; clear: both; }
        .column { float: left;  width: 50%;  padding: 10px; height: 300px; }
        table {border:0; cellpadding:0; cellspacing:0;}
    </style>
     
    <div> 
        <apex:form id="FormID">
            <apex:actionFunction action="{!createCase}" name="createCase" rerender="FormID,out"  oncomplete="refreshFeed();"/> 
            <apex:outputPanel id="out">
                <table >
                    <tbody>
                        <tr>
                            <td class = "labelCol"  style="width: 50%;">
                                <label>Type: &nbsp; &nbsp;</label>
                            </td>
                            <td>  <apex:inputField value="{!theCase.type}" id="CaseType"> </apex:inputField>  </td>
                        </tr>
                        <tr>
                            <td class = "labelCol"  style="width: 50%;">
                                <label>Sub Type: &nbsp; &nbsp;</label>
                            </td>
                            <td>  <apex:inputField value="{!theCase.Sub_Type__c}" id="CaseSubType"> </apex:inputField>  </td>
                        </tr>
                        
                        <tr id="DescrID">
                            <td class = "labelCol">
                                <label>Description : &nbsp; &nbsp;</label>
                            </td>
                            <td> <apex:inputField value="{!theCase.Description}"> </apex:inputField>  </td>
                        </tr>
                       <tr id="AssetID">
                            <td class = "labelCol">
                                <label>Asset : &nbsp; &nbsp;</label>
                            </td>
                            <td> <apex:inputField value="{!theCase.assetId}"> </apex:inputField>  </td>
                        </tr>  
                        <tr id="DestnSiteID">
                            <td class = "labelCol">
                                <label>Destination Site : &nbsp; &nbsp;</label>
                            </td>
                            <td> <apex:inputField value="{!theCase.Destination_Site__c}"> </apex:inputField>  </td>
                        </tr>
                       <!-- <tr>
                            <td class = "labelCol">
                                <label>Asset Move Type : &nbsp; &nbsp;</label>
                            </td>
                            <td> <apex:inputField value="{!theCase.Destination_Site__c}"> </apex:inputField>  </td>
                        </tr> -->
                        <tr>
                            <td align= "Center">
                                <button type="button" onclick="createCase();" 
                                        style="position:fixed;padding:5px 10px; font-size:13px; font-weight:bold; line-height:18px;" id="addcasebutton">Create Case</button> 
                            </td>
                        </tr>
                    </tbody>
                </table>
            </apex:outputPanel>
        </apex:form>
    </div> 
    
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
     <script type="text/javascript"> 
        
        $( document ).ready(function() {
         // On Page load trying to hide all these by IDs.
         $("[id$=DescrID],[id$=AssetID],[id$=DestnSiteID]").hide();
      
         $("[id$=CaseType]").change(function(){
            var CaseType1 = $(this).val();
            
             alert('CaseSubType1 '+CaseType1);// This is showing alert when i changed the Type
           
         });
         
         $("[id$=CaseSubType]").change(function(){
            var CaseSubType1 = $(this).val();
            
             alert('CaseSubType1 '+CaseSubType1);// This is NOT showing alert when i changed the SubType
           
         });
         
     });
    </script> 
    
   <script type='text/javascript' src='/canvas/sdk/js/publisher.js'>
    <script>
    function refreshFeed() { 
        Sfdc.canvas.publisher.publish({name : 'publisher.refresh', payload : {feed:true}}); 
        
    }
    </script>  
    
</apex:page>

Hi All,

I am having issues with Entitlements.  My scenario is like when the SLA of the case gets breached, then we need to send the Email alert after every 4 hours to the case owner until the case gets closed. 
I created a milestone with Recurrence Type as Sequential. But it is not triggering. 

Can someone please suggest on this one. 

Thanks in Advance
Anji K
 
Hello Experts,

Here i need to display the account in the contact related list ..

when we opens the contact detail page there  we need to see the Account record..
So kindly please suggest me..

Thanks in advacne.
Anji Reddy
 
trigger Alumni_Company_Trigger on Company__c (before insert, before update, after insert,after update ){
 if(trigger.isupdate){
    	 set<id> comids = new set<id>();
         list<job__c> lstjb = new list<job__c>();
           for(Company__c com : trigger.new){
               if(com.Industry__c != ''){
             if(com.Industry__c != trigger.oldmap.get(com.Id).industry__c)
             {
                 comids.add(com.id);
             }
               }
               else{} 
         }
              list<job__c> jblist = [select id, Company__r.Name, Industry__c from job__c where company__r.id  in : comids];
              system.debug('the list is having  ---->'+jblist);
              for(Company__c com : trigger.new){   
           	  for(job__c jb : jblist){
                 if(com.Industry__c == 'OTH')
                 {
                     jb.industry__c = 'Other';
                   
                  }
                 else if(com.Industry__c == 'CIP')
                 {
                     jb.Industry__c = 'Consumer and Industrial Products';
                   
                 }
                  else if(com.Industry__c == 'E & R')
                 {
                     jb.Industry__c = 'Energy and Resources';
                 
                 }
                  else if(com.Industry__c == 'FED')
                 {
                     jb.Industry__c = 'Federal';
              
                 }
                 else if(com.Industry__c == 'FS')
                 {
                     jb.Industry__c = 'Financial Services';
                   
                 }
                 else if(com.Industry__c == 'CIP')
                 {
                     jb.Industry__c = 'Consumer and Industrial Products';
                    
                 }
                 else if(com.Industry__c == 'LSHC')
                 {
                     jb.Industry__c = 'Life Sciences and Health Care';
                    
                 }
                 else if(com.Industry__c == 'PS')
                 {
                     jb.Industry__c = 'Public Sector';
                    
                 }
                 else if(com.Industry__c == 'TMT')
                 {
                     jb.Industry__c = 'Technology, Media and Telecom';
                  
                 }
                else if(com.Industry__c == 'NONE')
                 {
					jb.Industry__c = '';
                    
                 }
                  lstjb.add(jb);
             }
             
         }
        if(lstjb.size()>0)
        {
        update lstjb;
        }
        else{}
    }
}

Thanks in advance
Anji 
Hi experts,
I have developed one page , and it is enabled in vf page access permission for that particular site..
But it is not showing fileds  when open through the sites page..
and  all the fields are having read only permission..

Please suggest your ideas,
Thanks in advance
Anji K
hi experts,
Here i created one custom component. when i call this custom component in vf page it is not able to displaying the fields..
but in some of the pages it is displaying the fields which were in the custom component..
So please suggest me,

Thanks in Advance,
Anji
Hi Experts,

Here i am facing the issue in calling the file from zipped folder which is in the static resource..
and with  that image i want to use in the background for page..

Here my static resource file name is Static
 and Zipped file name is Book.zip
 and files in this Zipped folder is images and two files are there..
pen.jpg  and pencil.jpg.
here i tried to call these files like ..
And image is not displaying here in the background..

 
body
         {
               background-image: "{!URLFOR($Resource.static, 'images/pen.jpg')}";     
         }

So please suggest me..
Thanks in Advance,
Anji K..

 
Hi developers,

Here i have a css file and i want to create one visualforce  custom component with the help of  css code...'
how can i create that component..
 
any basic code for that one....

Please help me..
Thanks in advance,
reddy
hi 
what is the use of SRC attribute in SCRIPT tag in visualforce page.. ?
here i have seen this piece of code for creating account record through visualforce page. 
why he used this attribute.
here example is :
<apex:page id="page">   
                  <script src="/soap/ajax/36.0/connection.js" type="text/javascript">
             
         </script>
         <script>
         function callAjax(){
             sforce.connection.sessionid = '{!$Api.session_id}';
             var accountnam = document.getElementById('page:fm:accountname').value;
             var indust = document.getElementById('page:fm:accountindustry').value;
             var account1 = new sforce.sobject("account");
             account1.name = accountnam;
             account1.industry = indust;
             var result = sforce.connection.create([account1]);
             document.getElementById('page:fm:reslt').innerhtml = result;
         }
         </script>
         
     <apex:form id="fm">
              Account name : &nbsp;  &nbsp;   &nbsp;  <apex:inputText id="accountname"/><br/>
         Industry :  &nbsp;  &nbsp;   &nbsp; &nbsp;  &nbsp;  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<apex:inputText id="accountIndustry"/><br/>
         <apex:commandButton value="Call ajax" oncomplete="callAjax()" />
         <apex:outputLabel id="reslt" />
         
     </apex:form>
</apex:page>

please help me 
Thanks in Advance
Anji reddy
 
Hi here i have created connected app in one org and in my another org  i have created this code to generate the security token. but here i am getting error so please help me and suggest me..
 
<apex:page controller="RestAPISFDC2SFDC_con">
  <apex:form >
  <apex:commandButton value="Get Access Token" action="{!getaccesstoken}"/> <BR/>
  status :: {!status}<BR/>
  statusCode:: {!statuscode}<BR/>
  Response: {!response}
  </apex:form>
</apex:page>

and Controller for the above page is 
 
public with sharing class RestAPISFDC2SFDC_con {
public string response{set;get;}
Public string status{set;get;}
Public integer statuscode{set;get;}
   public void getaccesstoken()
   {
       Http p=New Http();
       
       Httprequest req=new Httprequest();
       req.setendpoint('https://login.salesforce.com/services/oauth2/token');
       req.setmethod('POST');
      
      
    string Body='grant_type=password&client_id=3MVG9Y6d_Btp4xp5yX4.NCrDL2HiYHo_qJldFC.lJJOmdNJvPPdlbzlYK5LPISB9aWUbkBAx61Yk7q3L6Wexv&client_secret=5523536280322918040&username=aaa@xzz&password=password';  
    /* string Body='grant_type=password';
     Body=Body+'&client_id=3MVG9Y6d_Btp4xp5yX4.NCrDL2HiYHo_qJldFC.lJJOmdNJvPPdlbzlYK5LPISB9aWUbkBAx61Yk7q3L6Wexv';
     Body=Body+'&client_secret=5523536280322918040';
     Body=Body+'&username=anj@xyz.com';
     Body=Body+'&password=passwordMd8joDw2g6XFre8QurSBkxaS';*/
     
     req.setbody(body);
    // req.setheader('Content-Type','application/json');
     
     Httpresponse res=new Httpresponse();
     res=p.send(req);
     
     response=res.getbody();
     status=res.getstatus();
     statuscode=res.getstatuscode();
  }
}

Thanks in  Advance 
Anji Reddy
hi to all,
Here i am facing the problem.
here i written some piece of code for sorting account name or account annual revenue like that.
Here i  written some piece of code.  i am unable to solve the solution.
So please help me.
public class ComparableAccountNames_controller {
   public list<WrapperClass> wraperlist{get; set;}
   public list<account> actlist {get; set;}
   public ComparableAccountNames_controller(){
       actlist = [select id, name, phone from account limit 10];
   }
   
   public class WrapperClass implements comparable {
       public string actlist.name {get; set;}
       public integer actlist.phone {get; set;}
       public WrapperClass( actlist.name, actlist.phone){
       this.actlist.name = actlist.name;
       this.actlist.phone = actlist.phone;
         global Integer compareTo(Object ObjToCompare) {
             return actlist.Name.CompareTo(((WrapperClass)ObjToCompare).actlist.Name);
         }
         
       }
   }
}

Thanks in advance 
Anji.
Hi 
Here i written one batch apex and test class.
Here i am unable to cover the execute method.
So plesae kindly help me..
global class batchcls implements database.batchable<Sobject>{
   
   global List<Account> start(Database.batchablecontext objvar){
   
   return [select id,name,billingcity from account];
   }
   global void execute(Database.batchablecontext objvar,List<Account> acctlst){
      List<contact> conlst=new List<contact>();
      for(Account acct:acctlst){
          contact con=new contact();
          con.lastname=acct.name;
          con.phone='4251212123';
          conlst.add(con);
      }
      if(conlst.size()>0){
        insert conlst;
      }
   }
   global void finish(Database.batchablecontext objvar){
   
   }
}

The Test class is 
]
@isTest
private class batchcls_Test{
    public static testmethod void mymethod(){
        list<account> actlist = [select id, name, billingcity from account ];
        list<contact> conlist = new list<contact>();
        for(account acc : actlist){
            contact con =new contact ();
            con.lastname = 'sampleTest';
            con.phone = '9900990099';
            con.accountid = acc.id;
            conlist.add(con);
        }
        if(conlist.size()>0)
        insert conlist;
            
           Test.StartTest();
           batchcls instancevar = new batchcls();
           ID batchprocessid = Database.executeBatch(instancevar);
          
           Test.StopTest();
       
     }
}

Thanks in Advance,
Anji
Hi 
i have a custom object with field sales_reps__C (lookup relation ship) to user object.
After saving the record , The record can be edited only by the selected user.
Other than that user no one can edit the record. how can you achieve this ?

Thanks in advance
Anji
hi 
here i have 3 objects. A, B and C , here A is the parent to B and B is the parent to C.
now my requirement is to write query on A and then i want to get childs  B  and C records.
is it possible to query on a single query.

suggest me the solution.
thanks in advance,
Anji
Hi,
here i want to know the about the Namespace.
what is the main reason for introducing the Namespace. ? and what are the uses of namespace ?

please suggest me,

Thanks in advance,
​Anji
Hi here i am not able to get the entered value in the input.
here is the piece of code i have written.
Please help me.
 
<apex:page controller="SelectdPlist_controller">
  <apex:form >
      <apex:pageBlock >
          <apex:pageBlockSection title="Please enter the some value in the box">
               <apex:actionSupport event="onmouseout" action="{!Gettheinputvalue}" reRender="pbs2">
              Please enter the some text &nbsp; <apex:inputText value="{!inputvalue}" />
               </apex:actionSupport>
          </apex:pageBlockSection>
          <apex:pageBlockSection title="The Output Section" id="pbs2">
             <apex:outputLabel >You have selected {!outputvalue} </apex:outputLabel>
          </apex:pageBlockSection>
      </apex:pageBlock>
  </apex:form>
</apex:page>

apex class
 
public class SelectdPlist_controller {
    public string inputvalue {get; set;}
    public string outputvalue {get; set;}
    public void Gettheinputvalue(){
    outputvalue = 'fgdginputvalue';
       }
    }

Thanks and Regards,
Anji reddy
 
Hi, 
Here my doubt is i want to convert the number to text format. 
here i used to TEXT(numberfield) in the formula field. but it is not working.
Ex: when a user enters 100 then the text format of the field has to display ONE HUNDRED. 

Please help me..

Thanks and Regards,
Anji reddy k
Hello,

during a recent deployment we came across a problem. We tried to delete a role (e.g. named "Role") and a subordinate role (e.g. name "Sub-Role").

Role
|-Sub-Role

first version of our file for destructive changes:
 
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>Role</members>
<members>Sub_Role</members>
        <name>Role</name>
    </types>
</Package>
this failed with the message
Your attempt to delete the role Role could not be completed because users are currently assigned to that role or at least one role reports to that role.: Role: Sub-Role
then we changed the order of the roles 
<?xml version="1.0" encoding="UTF-8"?>
<Package xmlns="http://soap.sforce.com/2006/04/metadata">
    <types>
        <members>Sub_Role</members>
<members>Role</members>
        <name>Role</name>
    </types>
</Package>

This failes with the same message.

Is it possible to define an order of deletion?

Thanks
Peter

 
Something is wrong in my code for email template I am getting a below o/p but I want fig 2 output.It looks good on page but when i am generating
 a PDF it is showing below ouput. 
Fig 1

fig 2
trigger Alumni_Company_Trigger on Company__c (before insert, before update, after insert,after update ){
 if(trigger.isupdate){
    	 set<id> comids = new set<id>();
         list<job__c> lstjb = new list<job__c>();
           for(Company__c com : trigger.new){
               if(com.Industry__c != ''){
             if(com.Industry__c != trigger.oldmap.get(com.Id).industry__c)
             {
                 comids.add(com.id);
             }
               }
               else{} 
         }
              list<job__c> jblist = [select id, Company__r.Name, Industry__c from job__c where company__r.id  in : comids];
              system.debug('the list is having  ---->'+jblist);
              for(Company__c com : trigger.new){   
           	  for(job__c jb : jblist){
                 if(com.Industry__c == 'OTH')
                 {
                     jb.industry__c = 'Other';
                   
                  }
                 else if(com.Industry__c == 'CIP')
                 {
                     jb.Industry__c = 'Consumer and Industrial Products';
                   
                 }
                  else if(com.Industry__c == 'E & R')
                 {
                     jb.Industry__c = 'Energy and Resources';
                 
                 }
                  else if(com.Industry__c == 'FED')
                 {
                     jb.Industry__c = 'Federal';
              
                 }
                 else if(com.Industry__c == 'FS')
                 {
                     jb.Industry__c = 'Financial Services';
                   
                 }
                 else if(com.Industry__c == 'CIP')
                 {
                     jb.Industry__c = 'Consumer and Industrial Products';
                    
                 }
                 else if(com.Industry__c == 'LSHC')
                 {
                     jb.Industry__c = 'Life Sciences and Health Care';
                    
                 }
                 else if(com.Industry__c == 'PS')
                 {
                     jb.Industry__c = 'Public Sector';
                    
                 }
                 else if(com.Industry__c == 'TMT')
                 {
                     jb.Industry__c = 'Technology, Media and Telecom';
                  
                 }
                else if(com.Industry__c == 'NONE')
                 {
					jb.Industry__c = '';
                    
                 }
                  lstjb.add(jb);
             }
             
         }
        if(lstjb.size()>0)
        {
        update lstjb;
        }
        else{}
    }
}

Thanks in advance
Anji 
System.degug() is working for 2 3 debug only. then the remining System.debug() logs are not getting genrated.
Hi All,

I m very new to salesforce and I m wondering if there is a way to hide custom fileds on custom Objects  if there is no value entered in them?

Thanks,
hi experts,
Here i created one custom component. when i call this custom component in vf page it is not able to displaying the fields..
but in some of the pages it is displaying the fields which were in the custom component..
So please suggest me,

Thanks in Advance,
Anji
Hi Experts,

Here i am facing the issue in calling the file from zipped folder which is in the static resource..
and with  that image i want to use in the background for page..

Here my static resource file name is Static
 and Zipped file name is Book.zip
 and files in this Zipped folder is images and two files are there..
pen.jpg  and pencil.jpg.
here i tried to call these files like ..
And image is not displaying here in the background..

 
body
         {
               background-image: "{!URLFOR($Resource.static, 'images/pen.jpg')}";     
         }

So please suggest me..
Thanks in Advance,
Anji K..

 
hi 
what is the use of SRC attribute in SCRIPT tag in visualforce page.. ?
here i have seen this piece of code for creating account record through visualforce page. 
why he used this attribute.
here example is :
<apex:page id="page">   
                  <script src="/soap/ajax/36.0/connection.js" type="text/javascript">
             
         </script>
         <script>
         function callAjax(){
             sforce.connection.sessionid = '{!$Api.session_id}';
             var accountnam = document.getElementById('page:fm:accountname').value;
             var indust = document.getElementById('page:fm:accountindustry').value;
             var account1 = new sforce.sobject("account");
             account1.name = accountnam;
             account1.industry = indust;
             var result = sforce.connection.create([account1]);
             document.getElementById('page:fm:reslt').innerhtml = result;
         }
         </script>
         
     <apex:form id="fm">
              Account name : &nbsp;  &nbsp;   &nbsp;  <apex:inputText id="accountname"/><br/>
         Industry :  &nbsp;  &nbsp;   &nbsp; &nbsp;  &nbsp;  &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<apex:inputText id="accountIndustry"/><br/>
         <apex:commandButton value="Call ajax" oncomplete="callAjax()" />
         <apex:outputLabel id="reslt" />
         
     </apex:form>
</apex:page>

please help me 
Thanks in Advance
Anji reddy
 
Hi here i have created connected app in one org and in my another org  i have created this code to generate the security token. but here i am getting error so please help me and suggest me..
 
<apex:page controller="RestAPISFDC2SFDC_con">
  <apex:form >
  <apex:commandButton value="Get Access Token" action="{!getaccesstoken}"/> <BR/>
  status :: {!status}<BR/>
  statusCode:: {!statuscode}<BR/>
  Response: {!response}
  </apex:form>
</apex:page>

and Controller for the above page is 
 
public with sharing class RestAPISFDC2SFDC_con {
public string response{set;get;}
Public string status{set;get;}
Public integer statuscode{set;get;}
   public void getaccesstoken()
   {
       Http p=New Http();
       
       Httprequest req=new Httprequest();
       req.setendpoint('https://login.salesforce.com/services/oauth2/token');
       req.setmethod('POST');
      
      
    string Body='grant_type=password&client_id=3MVG9Y6d_Btp4xp5yX4.NCrDL2HiYHo_qJldFC.lJJOmdNJvPPdlbzlYK5LPISB9aWUbkBAx61Yk7q3L6Wexv&client_secret=5523536280322918040&username=aaa@xzz&password=password';  
    /* string Body='grant_type=password';
     Body=Body+'&client_id=3MVG9Y6d_Btp4xp5yX4.NCrDL2HiYHo_qJldFC.lJJOmdNJvPPdlbzlYK5LPISB9aWUbkBAx61Yk7q3L6Wexv';
     Body=Body+'&client_secret=5523536280322918040';
     Body=Body+'&username=anj@xyz.com';
     Body=Body+'&password=passwordMd8joDw2g6XFre8QurSBkxaS';*/
     
     req.setbody(body);
    // req.setheader('Content-Type','application/json');
     
     Httpresponse res=new Httpresponse();
     res=p.send(req);
     
     response=res.getbody();
     status=res.getstatus();
     statuscode=res.getstatuscode();
  }
}

Thanks in  Advance 
Anji Reddy

Hi Gurus,

I have created an Apex Class which creates a User Account (future method) . This Class is called from Process Builder when a custom object record is created.

Now, I am trying to create a Test Class, but I am getting 'MIXED_DML_OPERATION, DML operation on setup object is not permitted after you have updated a non-setup object (or vice versa):'

How to get around this ?

Thanks,

Raghu



Now, I am trying to create a test class for this, 
 

hi to all,
Here i am facing the problem.
here i written some piece of code for sorting account name or account annual revenue like that.
Here i  written some piece of code.  i am unable to solve the solution.
So please help me.
public class ComparableAccountNames_controller {
   public list<WrapperClass> wraperlist{get; set;}
   public list<account> actlist {get; set;}
   public ComparableAccountNames_controller(){
       actlist = [select id, name, phone from account limit 10];
   }
   
   public class WrapperClass implements comparable {
       public string actlist.name {get; set;}
       public integer actlist.phone {get; set;}
       public WrapperClass( actlist.name, actlist.phone){
       this.actlist.name = actlist.name;
       this.actlist.phone = actlist.phone;
         global Integer compareTo(Object ObjToCompare) {
             return actlist.Name.CompareTo(((WrapperClass)ObjToCompare).actlist.Name);
         }
         
       }
   }
}

Thanks in advance 
Anji.
Hi 
Here i written one batch apex and test class.
Here i am unable to cover the execute method.
So plesae kindly help me..
global class batchcls implements database.batchable<Sobject>{
   
   global List<Account> start(Database.batchablecontext objvar){
   
   return [select id,name,billingcity from account];
   }
   global void execute(Database.batchablecontext objvar,List<Account> acctlst){
      List<contact> conlst=new List<contact>();
      for(Account acct:acctlst){
          contact con=new contact();
          con.lastname=acct.name;
          con.phone='4251212123';
          conlst.add(con);
      }
      if(conlst.size()>0){
        insert conlst;
      }
   }
   global void finish(Database.batchablecontext objvar){
   
   }
}

The Test class is 
]
@isTest
private class batchcls_Test{
    public static testmethod void mymethod(){
        list<account> actlist = [select id, name, billingcity from account ];
        list<contact> conlist = new list<contact>();
        for(account acc : actlist){
            contact con =new contact ();
            con.lastname = 'sampleTest';
            con.phone = '9900990099';
            con.accountid = acc.id;
            conlist.add(con);
        }
        if(conlist.size()>0)
        insert conlist;
            
           Test.StartTest();
           batchcls instancevar = new batchcls();
           ID batchprocessid = Database.executeBatch(instancevar);
          
           Test.StopTest();
       
     }
}

Thanks in Advance,
Anji
Hi all,

i am trying to align my command button in center but its not working i have used all the css properties like align and float in my output panel but still its not working

<apex:page controller="VistAudit_VFC" action="{!createData}">
 <apex:form >
  <apex:outputLabel value="Audit Visit" style="font-family:Times New Roman;font-size:15px">
 </apex:outputLabel><br></br>
 
<apex:outputPanel style="float:centre">
 <apex:commandButton value="Save" action="{!save}"/>
 </apex:outputPanel>

</apex:page>

any help would be appreciated

thanks
i have writen the code for Alpha-Numeric keys  but it working for all keys in the keyboard (delete,backspace,enter,arrowkeys.............)

The piece of code is 
<apex:page >
  <script>
  function keyup()
  {
  alert("key up calles");
  }
  function keypress()
  {
  alert('key press calles');
  }
  function keydown()
  {
  alert('key down calles');
  }
  </script>
  <apex:form >
  Name:<input type = "text" onkeyup="keyup()"/><br/>
  Email:<input type = "text" onkeypress="keypress()"/><br/>
  PhoneNumber:<input type= "text" onkeydown= "keydown()"/><br/>
  </apex:form>
  
</apex:page>