• Novo_Artis
  • NEWBIE
  • 96 Points
  • Member since 2009

  • Chatter
    Feed
  • 4
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 11
    Replies

Hi,

Can someone please tell me how can i acess the sObjects that provoced the undelete trigger?

 

I know that new and old are useless in that case.

SO what is the solution?

Thank you!

  • June 15, 2010
  • Like
  • 0

After editing my apex class from within the Force.com IDE, i clicked "Save" button. Got an error "File saved locally, not to server". How can i get past this errror? Thanks!

We've created a webService method within an Apex class and downloaded the resulting WSDL.

 

How do we call this externally, for example using PHP and SOAP? I don't understand how we can login and maintain the web service session when the generated WSDL only contains info about the custom Apex webService method, not the enter WSDL.

 

Thoughts?

  • March 29, 2010
  • Like
  • 0

Hi all,

 

I want to pass optional/default parameter in apex method,same as java.

But it throws error.

 

Is there any special way to pass optional/default parameter in apex method?

 

Please help me.

 

Regards,

Manoj Jain 

 
03-19-2010 04:21 PM

I have been wondering if it is possible to relate objects without inserting the parent first.

 

I hope to achieve something similar to this...

 

List<Contact> cList = new List<Contact>();
cList.add(new Contact(FirstName = 'Jeff'));
cList.add(new Contact(FirstName = 'John'));
cList.add(new Contact(FirstName = 'Joe'));

Account a = new Account(contacts = cList);

insert a;

 

I know I could insert the account, reference it in each contact then insert the contacts.

The issue with that is I have to use more DML statements and it also forces me to write lots of loops to handle bulk inserting of new objects with children.

Account a = new Account();
Is it possible to expose a webservice written in Apex code in a way that it doesn't require an authenticated session to access?

eg. a developer can just pick up the wsdl and connect?

Here is my custom controller class, it saves OK untill I add the if statements (just goes below the %75 test threshold when i do.

[The queries have been made blank for the purpose of this pos]

public with sharing class DispatchAdvice {
private final Account account;
private final Orderc__c order;
private final List<Orderc__c> orderList;
private final String vendor;

public DispatchAdvice() {
vendor = 'fail';
account = [];
orderList = Database.query('');
order = Database.query('');

if(account.Name.contains('AAA')) vendor = 'BBB';
else if(account.Name.contains('CCC')) vendor = 'DDD';
}

public Account getAccount() {
return account;
}
public List<Orderc__c> getOrderList() {
return orderList;
}
public Orderc__c getOrder() {
return order;
}
public String getVendor() {
return vendor;
}
}

I have been searching the document/forums/internet and cant figure this out...
Most solutions point to creating a testing class like so.

@isTest
private class DispatchAdviceTester {
static testMethod void testConstructor(){
DispatchAdvice da = new DispatchAdvice();
system.assert(true);
}
}

But when I try save this class I get the error
"Save error: Unable to perform save on all files: An unexpected error has occurred. Please try again, or check the log file for details. DispatchAdviceTester.cls line 1 Force.com save problem"

 

Any help would be great, thanks.

 

Hi,

Can someone please tell me how can i acess the sObjects that provoced the undelete trigger?

 

I know that new and old are useless in that case.

SO what is the solution?

Thank you!

  • June 15, 2010
  • Like
  • 0

After editing my apex class from within the Force.com IDE, i clicked "Save" button. Got an error "File saved locally, not to server". How can i get past this errror? Thanks!

Does anybody know whether is it possible to switch off that annoying test coverage checking (at least for sandbox)? I understand that test driven development is a good thing and so on and so for ... But writing tests take time that sometimes I don't want to loose.

I am developing a Apex code which need to accept values from the XML Tags. The value are present in the Payload of XML.

 

Example :

 <Region>USA</Region>

 <Name> John Doe </Name>

 

My code shall read the XML and get the values and create a record on a Object.

 

Thanks in Advance

I have tried many different approaches, but no approach has worked successfully.  Can anyone prove out a way to obtain the Salesforce server an org is running on via Apex code? There will be no UI interaction. This will need to run purely as an Apex script to obtain the answer (e.g. "na1", "emea", "cs1")

  • April 23, 2010
  • Like
  • 0

what's the query limit within an Apex class called by the Apex Code Scheduler? 1000 or 10000?

  • April 19, 2010
  • Like
  • 0

We've created a webService method within an Apex class and downloaded the resulting WSDL.

 

How do we call this externally, for example using PHP and SOAP? I don't understand how we can login and maintain the web service session when the generated WSDL only contains info about the custom Apex webService method, not the enter WSDL.

 

Thoughts?

  • March 29, 2010
  • Like
  • 0

Hi all,

 

I want to pass optional/default parameter in apex method,same as java.

But it throws error.

 

Is there any special way to pass optional/default parameter in apex method?

 

Please help me.

 

Regards,

Manoj Jain 

 
03-19-2010 04:21 PM

Hi,

I am using apex scheduler functionality. In that apex class which implements the schedulble interface, I have written system.abortjob(sc.gettriggerId()) function to abort the scheduled job, based on some condition. While doing so, I am getting the following error:

 

java.sql.SQLException: ORA-20001: ORA-06512: at "DOPEY.CMETAACCESS", line 510 ORA-01403: no data found ORA-06512: at "DOPEY.CMETAACCESS", line 667 ORA-06512: at "DOPEY.CMETAACCESS", line 656 ORA-06512: at "DOPEY.CMETAACCESS", line 626 ORA-06512: at "DOPEY.CMETAACCESS", line 609 ORA-06512: at "DOPEY.UDDDMLCRONTRIGGER", line 68 ORA-06512: at line 1 : {call UddDmlCronTrigger.get_detail(?,?,?)}

 

I dont know what this error about. But it showing the line number where the abortJob function is written. 

Please give your suggestion on this.

thanks in advance,

  • February 15, 2010
  • Like
  • 0

Here is my custom controller class, it saves OK untill I add the if statements (just goes below the %75 test threshold when i do.

[The queries have been made blank for the purpose of this pos]

public with sharing class DispatchAdvice {
private final Account account;
private final Orderc__c order;
private final List<Orderc__c> orderList;
private final String vendor;

public DispatchAdvice() {
vendor = 'fail';
account = [];
orderList = Database.query('');
order = Database.query('');

if(account.Name.contains('AAA')) vendor = 'BBB';
else if(account.Name.contains('CCC')) vendor = 'DDD';
}

public Account getAccount() {
return account;
}
public List<Orderc__c> getOrderList() {
return orderList;
}
public Orderc__c getOrder() {
return order;
}
public String getVendor() {
return vendor;
}
}

I have been searching the document/forums/internet and cant figure this out...
Most solutions point to creating a testing class like so.

@isTest
private class DispatchAdviceTester {
static testMethod void testConstructor(){
DispatchAdvice da = new DispatchAdvice();
system.assert(true);
}
}

But when I try save this class I get the error
"Save error: Unable to perform save on all files: An unexpected error has occurred. Please try again, or check the log file for details. DispatchAdviceTester.cls line 1 Force.com save problem"

 

Any help would be great, thanks.

 

I have the following trigger that simply calls a function in a class that gets a pdf blob.

 

 

trigger updOpportSendEmail on Opportunity (after insert, before update) { EditOpp.saveoppnew(trigger.new[0].ID); }

 

 

@future public static void SaveOppNew(String ID){ Opportunity OppObj = [select ID,StageName,AccountID from Opportunity where ID=:ID limit 1]; system.debug('*****'+OppObj.ID);

PageReference pdf = Page.Invoice_Email; pdf.getParameters().put('id',OppObj.ID); system.debug('*****before blob'); Blob pdfBlob = pdf.getContent(); system.debug('*****after blob');

}

 

The Id is getting pulled correctly and if I manually go the the Invoice_Email page for that opportunity everything works fine. Does anyone have any idea why pdf.getContent() is giving me the following exception?

 

 

System.VisualforceException: java.lang.NullPointerException

 

 

--Greg