• ccolt
  • NEWBIE
  • 25 Points
  • Member since 2010

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 7
    Replies

Hi,

 

I need to get the api names of the items of an object.

 

I can get the Name and Value with the getMap() method. But how i can get the API name.

I have a prefix problem with managed packets, so I need this thing.

 

e.g.

custom item in Contact >> married.

API name with prefix

prefix__married_c

 

how can i get this thing?

 

i can get with getMap() or getLabel() the married__c but not with prefix.

 

thanks for help.

 

greetings.

  • August 02, 2010
  • Like
  • 0

Hello,

 

does sendEmail from APEX to an Email Service with an APEX-Inbound handler count to the Outbound Email limit ?

 

My APEX function send an Email to my Email-Service (e.g. myservice@xxxxx.salesfoce.com). does it count to the limit ?

 

 

Greetings

  • June 07, 2010
  • Like
  • 0

Hi,

 

I've a problem with my Batch-Apex.

 

I want to send out Information through a callout. But this Information must send after and after. So I create two Batchjobs (because of two diffrent SOQL and parser-functions) and want to start them in a row.

 

Batch1

- do it´s work

- at finish-functions start Batch2

 

So I started them and ..... Limit Exception. Cannot start a Batch from a Batch.

How can I solve the problem ? I don´t want to write a while-statment and wait till the first job is done to do the next. It is possible to start the second Batch from the first one ? (I don´t want to schedule, or is this the alternative solution for the problem ?)

 

thanks

 

  • June 04, 2010
  • Like
  • 0

Hi,

 

I want to update my Contacts with APEX.

I call a WebService and recive a set of contacts (XML). After parsing this information in Objects I want to update this contacts.

 

Working code:

 

... definition of customdata arrays and counter

sObject[] output = new Contact[]{};

for(Integer i = 0; i < counter; i++)
{
sObject con = new Contact();

con = [SELECT id FROM Contact WHERE id = :a];

con.put('customfield1__c', customdata1[i]);
con.put('customfield2__c', customdata2[i]);
con.put('customfiled3__c', customdata3[i]);

output.add(con);
}
update output;

 

this code works fine, but after execute ... SQL limit 100 reached.

I know I can do it in a Batch APEX, but I want to do this on a buttonevent.

 

Why this code fails ?

 

... definition of customdata arrays and counter

sObject[] output = new Contact[]{};

for(Integer i = 0; i < counter; i++)
{
sObject con = new Contact();

con.put('id', customid[i]);

con.put('customfield1__c', customdata1[i]);
con.put('customfield2__c', customdata2[i]);
con.put('customfiled3__c', customdata3[i]);

output.add(con);
}
update output;

 

customid is a normal contact id, that I transfer from my salesforce to my other system.

 

Error Message: System.SObjectException: Field id is not editable

 

why the same schema works, when I usw the WebService API, but not the APEX ?

 

thanks for help

 

so long

 

  • May 21, 2010
  • Like
  • 0

Hi,

 

i want to call a function over XML-RPC.

I read the thread http://th3silverlining.com/2009/10/25/flickr-jquery-force-com-awesome5-part-1/#more-348 , but it didn´t work.

 

simple call (is dynamic on more than one server, but on each it´s a isAlive function):

 

 

public String isAliveMSG { get; set; }

    public PageReference XMLRCP_isAlive(String URL) {
    
        Httprequest request = new HttpRequest();
        request.setMethod('POST');
        request.setEndpoint(URL);

        String XML = '<methodCall><methodName>isAlive</methodName></methodCall>';
        request.setBody(XML);
        
        Http http = new Http();
        HttpResponse response = http.send(request);
        
        
        isAliveMSG = response.getBody();
        
        return null;
    }

 isAliveMSG is a Textarea.

the function isAlive has no parameters and the response is XML with true or false.

 

My response is

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<fault>
  <value>
    <struct>
      <member>
        <name>faultCode</name>
        <value><int>105</int></value>
      </member>
      <member>
        <name>faultString</name>
        <value><string>XML error: Invalid document end at line 1</string></value>
      </member>
    </struct>
  </value>
</fault>
</methodResponse>

 

 

From .NET (with XML-RPC.NET) or an online XML-RPC debuggers it call true back.

 

 

Can somebody help me ?

 

thanks

  • May 17, 2010
  • Like
  • 0

Hi,

 

I need to get the api names of the items of an object.

 

I can get the Name and Value with the getMap() method. But how i can get the API name.

I have a prefix problem with managed packets, so I need this thing.

 

e.g.

custom item in Contact >> married.

API name with prefix

prefix__married_c

 

how can i get this thing?

 

i can get with getMap() or getLabel() the married__c but not with prefix.

 

thanks for help.

 

greetings.

  • August 02, 2010
  • Like
  • 0

Hi,

 

I've a problem with my Batch-Apex.

 

I want to send out Information through a callout. But this Information must send after and after. So I create two Batchjobs (because of two diffrent SOQL and parser-functions) and want to start them in a row.

 

Batch1

- do it´s work

- at finish-functions start Batch2

 

So I started them and ..... Limit Exception. Cannot start a Batch from a Batch.

How can I solve the problem ? I don´t want to write a while-statment and wait till the first job is done to do the next. It is possible to start the second Batch from the first one ? (I don´t want to schedule, or is this the alternative solution for the problem ?)

 

thanks

 

  • June 04, 2010
  • Like
  • 0

Hi,

 

I want to update my Contacts with APEX.

I call a WebService and recive a set of contacts (XML). After parsing this information in Objects I want to update this contacts.

 

Working code:

 

... definition of customdata arrays and counter

sObject[] output = new Contact[]{};

for(Integer i = 0; i < counter; i++)
{
sObject con = new Contact();

con = [SELECT id FROM Contact WHERE id = :a];

con.put('customfield1__c', customdata1[i]);
con.put('customfield2__c', customdata2[i]);
con.put('customfiled3__c', customdata3[i]);

output.add(con);
}
update output;

 

this code works fine, but after execute ... SQL limit 100 reached.

I know I can do it in a Batch APEX, but I want to do this on a buttonevent.

 

Why this code fails ?

 

... definition of customdata arrays and counter

sObject[] output = new Contact[]{};

for(Integer i = 0; i < counter; i++)
{
sObject con = new Contact();

con.put('id', customid[i]);

con.put('customfield1__c', customdata1[i]);
con.put('customfield2__c', customdata2[i]);
con.put('customfiled3__c', customdata3[i]);

output.add(con);
}
update output;

 

customid is a normal contact id, that I transfer from my salesforce to my other system.

 

Error Message: System.SObjectException: Field id is not editable

 

why the same schema works, when I usw the WebService API, but not the APEX ?

 

thanks for help

 

so long

 

  • May 21, 2010
  • Like
  • 0

Hi,

 

i want to call a function over XML-RPC.

I read the thread http://th3silverlining.com/2009/10/25/flickr-jquery-force-com-awesome5-part-1/#more-348 , but it didn´t work.

 

simple call (is dynamic on more than one server, but on each it´s a isAlive function):

 

 

public String isAliveMSG { get; set; }

    public PageReference XMLRCP_isAlive(String URL) {
    
        Httprequest request = new HttpRequest();
        request.setMethod('POST');
        request.setEndpoint(URL);

        String XML = '<methodCall><methodName>isAlive</methodName></methodCall>';
        request.setBody(XML);
        
        Http http = new Http();
        HttpResponse response = http.send(request);
        
        
        isAliveMSG = response.getBody();
        
        return null;
    }

 isAliveMSG is a Textarea.

the function isAlive has no parameters and the response is XML with true or false.

 

My response is

<?xml version="1.0" encoding="UTF-8"?>
<methodResponse>
<fault>
  <value>
    <struct>
      <member>
        <name>faultCode</name>
        <value><int>105</int></value>
      </member>
      <member>
        <name>faultString</name>
        <value><string>XML error: Invalid document end at line 1</string></value>
      </member>
    </struct>
  </value>
</fault>
</methodResponse>

 

 

From .NET (with XML-RPC.NET) or an online XML-RPC debuggers it call true back.

 

 

Can somebody help me ?

 

thanks

  • May 17, 2010
  • Like
  • 0