• venkatsforce
  • NEWBIE
  • 75 Points
  • Member since 2013

  • Chatter
    Feed
  • 3
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 39
    Questions
  • 34
    Replies

Hi all,

 

I have been trying to integrate salesforce with java. 

 

I got the wsdl (enterprise wsdl ) file from my developer org and  i wish to use that wsdl file in eclipse to convert that to java class and accessing that class in my java application.

 

I have used salesforce session which speaks about the integration between salesforce and java as reference.

 

I am moving forward as per the thing discussed in that session. I have downloaded the wsdl file and make it in the src folder of my java application. 

 

On the way to parse the wsdl file , I have tried to create the external tool in eclipse , I have given the location and working directory in that perfectly and 

 

I dont what to do with arguement variable and i am facing the problem right here.

 

So it didn't let me to run the external tool so the wsdl file will be converted to java class.

 

Can anyone help me out of this.

 

Thanks in advance

Hi All

           I am using one custom object as Sample__c it contains three fields, the fields are:

             1.  Startdatetime__c(Date/Time datatype)
             2.  Value__c (Text)
             3.  NextDatetime__c(Date/Time datatype)----> Formulafield(Startdatetime__c+Value__c)-1

       when am inserting any records in salesforce Startdatetime__c = 27/03/2014 04:00 , Value__c = 4 then the NextDatetime__c is 30/03/2014 05:00. Am assigning Startdatetime__c = 27/03/2014 04:00 but in NextDatetime__c is 30/03/2014 05:00 it increases 1hour also if the Nextdatetime__c is as 29/03/14 04:00 it shows a correct time format from Startdatetime__c. If the date goes to 30th day and above means the time  increases by 1hour , if the date is in same month like 29 below means it shows the correct time format.... Is there any other way to solve this?

Organization timezone & User timezone are same GMT+00:00 (Europe/London)


Thanks
Venkatsforce
Hi All
 
           I am using one custom object as Sample__c it contains three fields, the fields are:

             1.  Startdatetime__c(Date/Time datatype)
             2.  Value__c (Text)
             3.  NextDatetime__c(Date/Time datatype)----> Formulafield(Startdatetime__c+Value__c)-1

       when am inserting any records in salesforce Startdatetime__c = 27/03/2014 04:00 , Value__c = 4 then the NextDatetime__c is 30/03/2014 05:00. Am assigning Startdatetime__c = 27/03/2014 04:00 but in NextDatetime__c is 30/03/2014 05:00 it increases 1hour also if the Nextdatetime__c is as 29/03/14 04:00 it shows a correct time format from Startdatetime__c. If the date goes to 30th day and above means the time  increases by 1hour , if the date is in same month like 29 below means it shows the correct time format.... Is there any other way to solve this?

Organization timezone & User timezone are same GMT+00:00 (Europe/London)


Thanks
Venkatsforce


Hi All

      

       Am using Datetime datetype in sfdc my doubt is if i havng 1 string date='' & string time='' here how to store the date&time in Datetime datatype field....

 

Thanks

=========

Venkatsforce

Hi All

 

       How to seperate the Datetime as Date in one String and Time in One String?

 

Thanks

Venkatsforce

Hi

 

        Scenario

         ========

         1. TestAccount(PartnerAccount)

                    |

                     -------- 2.TestContact(Contact(Enable as a partner user)) ====== Services(Customobject records)

                                 3.TestUser(Contact(Enable as a partner user))=========Services(Customobject records)

 

          In this scenario my doubt is when i login using the TestContact partner portaluser credentials it shows the all records of the Services(custom object), i want only the particular contact related records.But here it shows all records in portal page.

 

 Am confusing with sharing rules, i assign owd as private and i assign sharing rules whatever its it shows all records.How to resolve it?Anyone clarify this scenario........................

 

Thanks

=========

Venkatsforce

                                         

                                         

Hi

 

     Am new to Force.com site development, when i using Force.com site login page at that time i give the logincredentials of the PartnerPortal user login details and then it moves to portal page, i want to redirect the page to Force.com site page instead of  portal page...As I use this url as https://partnerportalurl?username&password/apex/vfpage but i got the error as Unable to load the Visualforcepage.i dont know how to redirect..Is there any possibilities?

 

 

Regards

========

VenkatSForce

Hi All

 

              Is this possible to In-Active(deactivate) the CustomerPortaluser using apex class?

 

Thanks

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

Venkatsforce

 

Hi

 

How to remove \n,\  from a string? 

"XYZ": "{\n \"Test\" : \"S\",\n \"SK\" : \"C\",\n \"DD\" : \"A\",\n \"AA\" : \"V\"\n}"

I am using json method to build the json request to post to the client server. But in json i am having the literals \n and \. This json request is not in the string format so i can not replace \n and \ with null value. How can i replace the \n and \ with null value (request should be in json format).

 

Thanks

Venkatsforce

Hi 

 
     I am working on Single Sign-on concept using FederatedAuthenticationId from One Salesforce Org to other Org, In this concept ,where to be get the ServiceProvider Certificate. I get the IdentityProvider Certificate but i didn't find out the ServiceProvider certificate...Please let me give the solution for this concept.....
 
 
Regards
--------------
VenkatSForce

Hi All

 

         How do I Login as a Contact's Portal User using Force.com SiteLogin page?

 

Regards

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

VenkatSforce

 

  

Hi All

 

         How to convert the Lead to PersonAccount?

 

Thanks

-----------

VenkatSforce

Hi All

 

          I want to enable a PersonAccount in my DeveloperEdition, i click on the contact support --->openmycases button but it redirects it to error page.....Its possible to put a case in new DeveloperEdition?

 

 

Regards

=========

Venaktsforce

 

how to update a boolean field value for last record at the time of inserting large number of records?

 

        Am inserting large number of records in one object using apex class at that time ,i want to ensure a boolean field value as true for last record.

 

 

Thanks

Venkatsforce

Hi

 

   How to convert the lead to Contact & store the Contact with existing Acount using Trigger?

 

Thanks

=======

Sforce

Hi

 

     This is my custom text template code,i load the image in Documents and copy the image url and paste in src.But i didnt receive the images in my email ,just it shows text only........How to solve this?

 

     <img src=”https://na5.salesforce.com/servlet/servlet.ImageServer?id=01570000001G1nR&oid=00D70000000XXXX” alt=”My test image” height=”179” width=”702“/>

 

Thanks

==========

VenaktSforce

how to write test case for this code?

 

public Account retrieveOrganisation(String orgId) {
      Account retOrg = new Account();
        String strQuery = 'SELECT ';
        Map<String, Schema.sObjectField> mpFields = Schema.sObjectType.Account.fields.getMap();
        Set<String> geoFieldPrefixes = new Set<String>();
        for (Schema.sObjectField fld: mpFields.values()) if (fld.getDescribe().getName().contains('Longitude') || fld.getDescribe().getName().contains('Latitude')) geoFieldPrefixes.add(fld.getDescribe().getName().split('__',2)[0]);
        for (Schema.sObjectField fld: mpFields.values()) {
            String fldName=fld.getDescribe().getName();
            if (!geoFieldPrefixes.contains(fldName.split('__',2)[0])) strQuery+=fldName+',';
        }
        if (strQuery.endsWith(',')) strQuery = strQuery.substring(0, strQuery.length() - 1);
        strQuery+=' FROM Account WHERE Id=\''+orgId+'\' LIMIT 1';
        System.debug('### OUTPUT >>>>> retrieveOrganisation: strQuery: '+strQuery);
        retOrg = Database.query(strQuery);
        return retOrg;
    }

If I upload a csv file and I want to insert that csv file data s in to Account object, I create a code but i got some errors. If I load 2 columns in csv and add 5 columns in apex class but i got a exception Array Index Out of Bound Exception

 

Apex class

========

 

public class FileUploader
{
  String[] filelines = new String[]{};
  public List<Account> contoupload;
  public Blob contentFile { get; set; }
  public String nameFile { get; set; }

  public PageReference ReadFile()
  {
    System.Debug('Entry123');
    nameFile=contentFile.toString();
    System.Debug('nameFile123'+nameFile);
    filelines = nameFile.split('\n');
    contoupload = new List<Account>();
    for(Integer i=1;i<filelines.size();i++)
    {
        System.Debug('Values12313'+filelines.size());
        String[] inputvalues = new String[]{};
        inputvalues = filelines[i].split(','); 

            Account a = new Account();
            a.Name = inputvalues[0]; 
            System.Debug('InputValues'+a.Name);
            a.Phone = input values[1]; 
            a.Shipping Street = inputvalues[2];       
            a.ShippingCity = inputvalues[3];
            a.ShippingState = inputvalues[4];
            a.ShippingPostalCode = inputvalues[5];
            a.ShippingCountry = inputvalues[6];
            contoupload.add(a);
            System.Debug('Account Entry'+contoupload.size());

    }
    try
    {
     if(contoupload.size()>0)
     {
       insert contoupload;
       System.Debug('FileSize12311'+contoupload.size());
     }
    }
    catch (Exception e)
    {
        ApexPages.Message errormsg = new ApexPages.Message(ApexPages.severity.ERROR,'An error has occured. Please check the template or try again later');
        ApexPages.addMessage(errormsg);
    } 
     PageReference pg = new PageReference('https://csesparks-dev-ed--pack-saleforce.ap1.visual.force.com/apex/Fileupload');
     pg.setRedirect(true);
     return pg;
 }    
}

Error like this:

System.ListException: List index out of bounds: 2

 

n my SOject am having a encrypted(Encrypt_order) data type value and i create another one text(Decrypt_order) data type value ,after inserting the value in Encrypted(Encrypt_order) data ,i want to decrypt that encrypted value(Encrypt_order) and shown in that text(Decrypt_order) data type field value.......Any examples.....

 

 

 

Thanks

==========

VenkatSForce

In my SOject am having a encrypted(Encrypt_order) data type value and i create another one text(Decrypt_order) data type value ,after inserting the value in Encrypted(Encrypt_order) data ,i want to decrypt that encrypted value(Encrypt_order) and shown in that text(Decrypt_order) data type field value.......Any examples.....

 

 

 

Thanks

==========

VenkatSForce

Hi

 

    I want to add a subsection for section in a pagelayout?Is this possible to use Visuaforcepage items inside the layout with subsections....Any examples..............

 

 

Thanks

============.

VenkatSforce

Hi All
 
           I am using one custom object as Sample__c it contains three fields, the fields are:

             1.  Startdatetime__c(Date/Time datatype)
             2.  Value__c (Text)
             3.  NextDatetime__c(Date/Time datatype)----> Formulafield(Startdatetime__c+Value__c)-1

       when am inserting any records in salesforce Startdatetime__c = 27/03/2014 04:00 , Value__c = 4 then the NextDatetime__c is 30/03/2014 05:00. Am assigning Startdatetime__c = 27/03/2014 04:00 but in NextDatetime__c is 30/03/2014 05:00 it increases 1hour also if the Nextdatetime__c is as 29/03/14 04:00 it shows a correct time format from Startdatetime__c. If the date goes to 30th day and above means the time  increases by 1hour , if the date is in same month like 29 below means it shows the correct time format.... Is there any other way to solve this?

Organization timezone & User timezone are same GMT+00:00 (Europe/London)


Thanks
Venkatsforce


Hi All

           I am using one custom object as Sample__c it contains three fields, the fields are:

             1.  Startdatetime__c(Date/Time datatype)
             2.  Value__c (Text)
             3.  NextDatetime__c(Date/Time datatype)----> Formulafield(Startdatetime__c+Value__c)-1

       when am inserting any records in salesforce Startdatetime__c = 27/03/2014 04:00 , Value__c = 4 then the NextDatetime__c is 30/03/2014 05:00. Am assigning Startdatetime__c = 27/03/2014 04:00 but in NextDatetime__c is 30/03/2014 05:00 it increases 1hour also if the Nextdatetime__c is as 29/03/14 04:00 it shows a correct time format from Startdatetime__c. If the date goes to 30th day and above means the time  increases by 1hour , if the date is in same month like 29 below means it shows the correct time format.... Is there any other way to solve this?

Organization timezone & User timezone are same GMT+00:00 (Europe/London)


Thanks
Venkatsforce

I have a string named FAM and a list of users as shown below

 

 

List <user> use = [select name,EmployeeNumber from User];

 

string FAM = '0001';

 

 

 

I want to check if the Employeenumber in the list named use contains this FAM value.
How to do i check? Pls help

Hi

 

     Am new to Force.com site development, when i using Force.com site login page at that time i give the logincredentials of the PartnerPortal user login details and then it moves to portal page, i want to redirect the page to Force.com site page instead of  portal page...As I use this url as https://partnerportalurl?username&password/apex/vfpage but i got the error as Unable to load the Visualforcepage.i dont know how to redirect..Is there any possibilities?

 

 

Regards

========

VenkatSForce

Hi All

 

              Is this possible to In-Active(deactivate) the CustomerPortaluser using apex class?

 

Thanks

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

Venkatsforce

I am trying to write test method for below Class.

 

"

 

public with sharing class RemotingAddressesController_differential {



public RemotingAddressesController_differential(Axtria_controller_differential controller) {

}

 


public String getAccounts() {
return null;
}

public String userId = UserInfo.getUserId(); 

@RemoteAction
public static List<account> getAllAddresses(){

List <account> addresses = 
[SELECT id,name,Billingstreet,billingstate,billingpostalcode,billingcity,Location__Latitude__s,Location__Longitude__s FROM account WHERE Active__c='Yes' LIMIT 10000];
return addresses;
}


}

 

 

"

 

The test class for that is 

"

@isTest
public class TestAxtria_RemoteAddress{
public static testMethod void test(){
account account= new account(Billingstreet='PINNELL ST',billingpostalcode='25271',AxtriaCallPlan__Location__Latitude__s=38.43,AxtriaCallPlan__Location__Longitude__s=-82.13,Name='MICHAEL SHRAMOWIAT',AxtriaCallPlan__Active__c='yes',AxtriaCallPlan__Specialization_differential__c='PHA',AxtriaCallPlan__Account_First_Nmae__c='MICHAEL' ,AxtriaCallPlan__Account_Last_Name__c='SHRAMOWIAT',AxtriaCallPlan__Territory_Name__c='Richmond VA',AxtriaCallPlan__Approval__c='New',Billingcity='RIPLEY',Billingstate='WV',AxtriaCallPlan__Submit__c=True);
insert account;

Apexpages.StandardController stdController = new Apexpages.StandardController(account);
RemotingAddressesController_differential controller = new RemotingAddressesController_differential (stdController );

list<account>ocrs= controller .getAllAddresses();
System.assertEquals(1,ocrs.size());

}
}

"

 

 

Please correct the test class so that I can cover the class.

 

Thanks

Arun K

 

 

Hi

 

     This is my custom text template code,i load the image in Documents and copy the image url and paste in src.But i didnt receive the images in my email ,just it shows text only........How to solve this?

 

     <img src=”https://na5.salesforce.com/servlet/servlet.ImageServer?id=01570000001G1nR&oid=00D70000000XXXX” alt=”My test image” height=”179” width=”702“/>

 

Thanks

==========

VenaktSforce

trigger cloningopportunity on Opportunity (after insert) {

set<id> oid = new set<id>();
RecordType record =[select id from RecordType where name='1*2'];
for(Opportunity opp : Trigger.new)
{
if(opp.RecordTypeId == record.Id)
{
oid.add(opp.Id);
System.debug('cloningvalues:' + oid);
}

}
list<Opportunity> olist = [select id,Name,CloseDate,StageName,RecordTypeId from Opportunity Where Id in:oid];

for(Opportunity opps :olist)
{
Opportunity o = new Opportunity();
o.Name=opps.Name;
o.CloseDate=opps.CloseDate;
o.StageName=opps.StageName;
o.RecordTypeId =opps.RecordTypeId ;
System.debug('cloningvalues1:'+o.StageName );
insert o;


}

}

 

throws error

 

AfterInsert caused by: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY,

Hi

 

    I want to add a subsection for section in a pagelayout?Is this possible to use Visuaforcepage items inside the layout with subsections....Any examples..............

 

 

Thanks

============.

VenkatSforce

Why we use JSON in SalesForce?Any Explanations .....and when we use JSON in Salesforce?

Hi all,

 

I have been trying to integrate salesforce with java. 

 

I got the wsdl (enterprise wsdl ) file from my developer org and  i wish to use that wsdl file in eclipse to convert that to java class and accessing that class in my java application.

 

I have used salesforce session which speaks about the integration between salesforce and java as reference.

 

I am moving forward as per the thing discussed in that session. I have downloaded the wsdl file and make it in the src folder of my java application. 

 

On the way to parse the wsdl file , I have tried to create the external tool in eclipse , I have given the location and working directory in that perfectly and 

 

I dont what to do with arguement variable and i am facing the problem right here.

 

So it didn't let me to run the external tool so the wsdl file will be converted to java class.

 

Can anyone help me out of this.

 

Thanks in advance

Hi all,

 

This is driving me nuts, i believe what i need is a very simple VF page but can't seem to get anywhere

 

i need to create a custom edit button that would point to a VF page.

This VF page would then redirect back to the standard page but would append an extra value to the URL

 

 .....salesforce.com/a0wW0000000Dzl5/e?retURL=%2Fa0wW0000000Dzl5&x=somevalue

 

anyone seen/done something like this? I would really appreciate if you could post some code i could start with..

 

 

 

 

How can we connect to java with salesforce.

 

I want to write a utility where a java program will read an excel where all the field names of an object will  be present.

Then the java program will create an salesforce custom object.

 

Can anybody help me out.

  • March 23, 2013
  • Like
  • 0

I want to call the batchapex calss using visualforcepage on the time of clicking the button in visualforcepage.........

 

 

 

Thanks

==========

VenkatSforce

Hi, I need help to create a clone functionalities on account. Bascially the clone should clone some field. Can we do it with Onclick Javascript? My Visualforce skills in not good. Or if you give me a starting point, I will try to create a clone button. THere are many blogs on this but I didn't find a simple one.

 

Any help will be really appreciated.

 

Thanks

AB.

  • March 21, 2013
  • Like
  • 0

i want to insert a new data in custom object using ApexScheduler....AnyExampless..

 

 

Thanks

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

VenkatSforce

  1. Create a field called Account Size ( auto-populate based on value of status field)
    1. If status field value = ‘Ant’ then update Account Size =1.
    2. If status field value = ‘Squirrel’ then update Account Size =2.
    3.  If status field value = ‘Zebra’ then update Account Size =3.
    4. If status field value = ‘Elephant’ then update Account Size =4.

Is this possible to adding a colors for textfields in StandardPage view..Like Account object fields...

 

 

 

 

Thanks

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

VenkatSforce