• Sergey Trusov
  • NEWBIE
  • 64 Points
  • Member since 2014

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 9
    Replies
Hi All

Can Any body tell me how to integrate/connect Tally data to salesforce Means i want all data(excell format) from tally to salesforce org automatically.
User-added image
I am not able to get access_token from above URL.

I have tried below code but even then 'token' is returning null value.
token = ApexPages.currentPage().getParameters().get('%23access_token');

 
Please participate in the Salesforce IDE survey: https://www.surveymonkey.com/r/B5QXMVQ 
Hi

I managed to get my Java Environment up and running using the following:
https://developer.salesforce.com/docs/atlas.en-us.salesforce_developer_environment_tipsheet.meta/salesforce_developer_environment_tipsheet/?state=id

The above uses HttpComponents 4.4.

There are examples using the Rest API here:
https://developer.salesforce.com/page/Getting_Started_with_the_Force.com_REST_API

This appears to be using the old version of HttpComponents (v3 maybe?). In particular, I'm trying to get the SOQL code working for HttpComponents 4.4. Has anyone successfully managed to do so and have code samples?

Thanks
 
<apex:page controller="mycontroller">  
<apex:pageBlock >  
    <apex:form >  
        <apex:actionFunction name="ObjectFileds" action="{!ObjectFields}"/>   
        <!--apex:commandButton value="Show Table" action="{!ShowTable}"/-->
          
        <apex:pageBlockSection >  
            <apex:pageBlockSectionItem >  
                <apex:outputLabel value="Select Object"/>  
                <apex:selectList size="1" value="{!SelectedObject}" onchange="ObjectFileds();">  
                    <apex:selectOption itemLabel="--None--" itemValue="--None--"/>  
                    <apex:selectoptions value="{!supportedObject}" />  
                </apex:selectlist>  
            </apex:pageBlockSectionItem>  
              
            <apex:pageBlockSectionItem id="thePage" > 
              
                  
                <apex:outputLabel value="Select Field" />  
               <apex:outputpanel id="out">  
                <apex:selectList multiselect="true" size="5" value="{!SelectedFields}">  
                    <apex:selectOption itemLabel="--None--" itemValue="--None--"/>  
                    <apex:selectoptions value="{!fieldLableAPI}" />  
                </apex:selectlist>
               </apex:outputpanel>   
              
               </apex:pageBlockSectionItem> 
             <apex:pageblockTable value="{!fieldInfo}" var="item" >
            <!--    <apex:column value="{!item.name}" headerValue="Name"/>
                <apex:column value="{!item.Label}" headerValue="Label"/>
                <apex:column value="{!item.Type}" headerValue="Type"/>   -->
              <apex:repeat value="{!displayProperties}" var="f">
                   <apex:column value="{!item[f]}"/>
            </apex:repeat>     -->
            </apex:pageblockTable>        
            
               
              
 </apex:pageBlockSection> 
 <br/>
 <apex:commandButton value="Customize" action="{!customize}"/>
          
    </apex:form>  
</apex:pageBlock>  
</apex:page>


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

public with Sharing class mycontroller  
{  
     
    public List<selectoption> supportedObject {get; set;}  
    public String SelectedObject {get; set;}  
    Map<String, Schema.SObjectType> gd = Schema.getGlobalDescribe();  
    //Set<String> objectKeys = gd.keySet();  
    public List<SelectOption> fieldLableAPI {get; set;}  
    public List<String> SelectedFields {get; set;}  
    public List<sObject> ObjectList {get; set;} 
    public PageReference savePage; 
   
   //public List<Schema.DescribeFieldResult> fieldInfo{get;set;}
    public List<String> selectedProperties{get;set;}
    public Set<String> selectedNames = new Set<String>{'Name'};
    
    public mycontroller()  
    {  
        supportedObject = new List<selectoption>() ;  
        SelectedObject = '--None--' ;  
        fieldLableAPI = new List<SelectOption>() ;  
        SelectedFields = new List<String>() ;  
        ObjectList = new List<sObject>() ; 
        selectedProperties = new List<String>(); 
          
         
        for(Schema.SObjectType item : ProcessInstance.TargetObjectId.getDescribe().getReferenceTo())  
        {  
              
            if(item.getDescribe().Custom)  
            {  
                 
                supportedObject.add(new SelectOption(item.getDescribe().getName(), item.getDescribe().getLabel() ));  
            }  
        }  
    }  
    public void ObjectFields()  
    {  
        fieldLableAPI.clear();
        if(SelectedObject != '--None--')  
        {  
            Schema.SObjectType systemObjectType = gd.get(SelectedObject); 
            Schema.DescribeSObjectResult r = systemObjectType.getDescribe();  
            Map<String, Schema.SObjectField> M = r.fields.getMap();  
            for(Schema.SObjectField fieldAPI : M.values())
            {
            if(fieldAPI.getdescribe().Iscustom())
            {  
                fieldLableAPI.add(new SelectOption(fieldAPI.getDescribe().getName() , fieldAPI.getDescribe().getLabel())) ;  
            } 
      }}
       else
    {
     fieldLableAPI.clear();
     //fieldLableAPI=null; 
     }    
    }
    
   public Schema.DescribeFieldResult[] getFieldInfo(){
    
     DescribeFieldResult[] sobFieldDescribes = new DescribeFieldResult[]{};
     if(SelectedObject=='--None--'){
     return null;
     }
     else{
     Schema.SObjectType sobType  = gd.get(SelectedObject);
     System.debug('P---'+sobType);
     DescribeSObjectResult sobDescribe = sobType.getDescribe();
      
       Map<String, Schema.SObjectField> fields = sobDescribe.fields.getMap();
           for(String s:selectedFields){
               Schema.SobjectField sobField = fields.get(s);
                DescribeFieldResult sobFieldDescribe = sobField.getDescribe(); 
                sobFieldDescribes.add(sobFieldDescribe);
           }
           
      return sobFieldDescribes;
    }
    }
    
    
    
    public PageReference showTable(){
    
        getFieldInfo();
        return null;
    }
    
    public PageReference customize(){
        savePage = ApexPages.currentPage();
        return Page.objPage2new;
    }
    

    public PageReference show(){
    //getFieldInfo();
    getDisplayProperties();
    return savePage;
    
    }
    
    public List<String> getDisplayProperties(){
        List<String> displayProp = new List<String>(selectedProperties);
        System.debug('!!!----'+selectedProperties);
        displayProp.sort();
       // getFieldInfo();
        return displayProp;
    
    }
    
    }



second vf page

<apex:page controller="mycontroller">
   <apex:form >
    <apex:pageBlock title="Select Properties:">
        <apex:selectList value="{!selectedProperties}" size="4" multiselect="true">
            <apex:selectOption itemLabel="Name" itemValue="Name"/>
            <apex:selectOption itemLabel="Label" itemValue="Label"/>
            <apex:selectOption itemLabel="Type" itemValue="Type"/>
            <apex:selectOption itemLabel="Length" itemValue="Length"/>
            
           
        </apex:selectList>
        <apex:pageBlockButtons >
        <apex:commandButton value="ShowProp" action="{!show}"/>
        </apex:pageBlockButtons>
    </apex:pageBlock>   
   </apex:form>
</apex:page>
what are the precautions to be taken while deactivating a user???
  • February 16, 2015
  • Like
  • 0
Hi All

Can Any body tell me how to integrate/connect Tally data to salesforce Means i want all data(excell format) from tally to salesforce org automatically.
Hi Guyz,

I am running into a scheduling problem with my apex class. I have a batch apex class named 'MyBatchApex' which I want to schedule to run every 5 minutes. I created a class with implements the Schedulable interface and here goes the code..
 
global class MySchedulerClass{
    global void execute(SchedulableContext sc) {
        ID BatchId = Database.executeBatch(new MyBatchApex(), 50);

    } 
    public static void scheduleThis(){
       String cronString='0 5 * * * ?';
       System.schedule('MyJob', cronString, new MySchedulerClass());
    }
}

To schedule this, I am running the following snipper from Developer Console 
MySchedulerClass.scheduleThis()

The job creates a async job and executes the batch after 5 mins as expected and then stops to run. I want this to execute every 5 minutes like a cron job. Am I doing anything wrong here? How to acheive a frequency of 5 min execution then?
User-added image
I am not able to get access_token from above URL.

I have tried below code but even then 'token' is returning null value.
token = ApexPages.currentPage().getParameters().get('%23access_token');