• sf11
  • NEWBIE
  • 25 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 15
    Replies

During the change of account owner from one user to another, we get multiple options to check  like below

 

- Transfer open opportunities not owned by the existing account owner
- Transfer closed opportunities
- Transfer open cases owned by the existing account owner
- Transfer closed cases
- Keep Account Team
- Keep Opportunity Team on opportunities transferred to new owner.
- Send Notification Email

 

So while doing the same change in owner from API or a code , can we set the above two underlined options TRUE ? Is there such feature in Apex language or can be done through API ?

  • November 08, 2012
  • Like
  • 0

I would like to make content workspace files available on a force.com site page ( for un-authenticated user). Is this possible ?

 

If the answer is yes, then where and how do I set content workspace permission for un-authenticated user. In the workspace permission menu, I do not see an option to include unauthenticated user for view permission.

I do not want to use cutomer portal or  partner portal for this purpose. Thanks !

  • April 03, 2011
  • Like
  • 0

We have enabled email thread Id generation for outbound emails from case. Is there a way to suppress the email thread Id based on a criteria ?

 

My Use case is - . if case type = 'XYZ'  don't embed thread Id in the email ELSE generate the thread Id and embed into email 

 

Here is what we tried but didn't work...

 

We wrote a trigger on Email object to replace the thread Id with NULL (search and replace) in the body of the email, if case type != XYZ.  This does replace the thread Id with null string in the body text  , but the recipient still see thread Id in the email.  If we look at the email record in SFDC, we don’t see thread Id in body it seems like trigger does the job but SFDC inserts thread Id at some later stage just before sending the email .

 

Any thoughts on how to suppress the thread Id based on case condition (e.g. if case type = 'XYZ'  don't embed thread Id in the email)?

 

Regards,

  • September 16, 2010
  • Like
  • 0

Has anyone tried using a PDF template or PDF Form to use with VF page for PDF output? In our use case we have a very complex PDF insurance policy pages (multi page ) which we are producing from a VF page (render as PDF). This requires lots of HTML to render the page in the desire format.

 

These policy forms are available in fillable PDF files 9PDF Forms). I am just wondering if I can use such PDF forms as an input and fill the required fields in the form. This takes away all the effort for HTML coding.

 

Any thoughts and helps would be greatly appreciated. 

  • April 01, 2010
  • Like
  • 0

I was wondering if anyone has tried deleting the time based workflow actions in the workflow queue through Apex trigger or Apex methods (e.g. delete the outgoing email alerts scheduled for a future date) ?

 

I know we can accomplish this through App setup menu (Setup-->Admin Setup--> Monitoring--> Time based workflows--> select records and click delete) but can we do this using Apex code ?

  • January 25, 2010
  • Like
  • 0

I am invoking an approval process in an after update trigger which results in bunch of runtime errors. The approval process works flawlessly when submitted through default "Submit for Approval" button

 

below is my trigger code and the run time error messages 

 

trigger Approval_Process on SPA__c (after update){

for(SPA__c sp: Trigger.new){

if (sp.Submit_for_Approval__c){

Approval.ProcessSubmitRequest req1 = new Approval.ProcessSubmitRequest();

req1.setComments('Submitting request for approval.');

req1.setObjectId(sp.id);

req1.setNextApproverIds(new Id[] {UserInfo.getUserId()});

//req1.setNextApproverIds='005Q0000000IFNf';

Approval.ProcessResult result = Approval.process(req1);

System.assert(result.isSuccess());

System.assertEquals('Pending', result.getInstanceStatus(), 'Instance Status'+result.getInstanceStatus());

}

}

}

 The runtime errors I get are

CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY

NO_APPLICABLE_PROCESS

 

The detailed message is below

 

Error: Invalid Data. Review all error messages below to correct your data.Apex trigger Approval_Process caused an unexpected exception, contact your administrator:

Approval_Process: execution of AfterUpdate caused by: System.DmlException: Process failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY,

Approval_Process: execution of AfterUpdate caused by: System.DmlException: Process failed. First exception on row 0; first error: NO_APPLICABLE_PROCESS, No applicable approval process found.: [] Trigger.Approval_Process: line 11, column 45: []: Trigger.Approval_Process: line 11, column 45

 

 

 

 

 

  • January 21, 2010
  • Like
  • 0

Hi, 

I need to create a custom button on a child detail screen which will take user back to parent record. (from child__c detail page to parent__c detail page).

 

What would be the !URLFOR syntax for this ?  Thanks !

  • January 13, 2010
  • Like
  • 0

I am new to time trigger and have a question.

 

I created a custom object approval process which requires records to be submitted for approval within 48 hours from the record create date.

 

To implement this

 

1-   I created a workflow rule ( when a record created/edited...) to check the custom status field of the record . The workflow rule checks (status__c <>"Approved" OR status__c<>"Submitted"). This rule will always be true for a newly created record which is not submitted. The status__c field gets updated to "Submitted" if record is submitted for approval through a field update.

 

2- I added a time trigger to this workflow to send an warning email after 24 hours to the record owner to remind him/her to submit the record for approval. 

 

The Issue is ----- Even after a record is submitted for approval in let's say next 2 hours after creation, the time trigger still sends email after 24 hours. The rule is true at the time of first save but becomes false when status__c is changed to submitted.

 

How do I suppress the email alert which is queued to go out after 24 hour  when no rule is no longer applicable?

 

  • January 07, 2010
  • Like
  • 0

Hi folks,

I am new to VF. I am trying to create a VF page very similar to add campaign members functionality where one can select multiple contacts and attach them to campaign in one step.

 

Here is my use case,

1- I have a custom object (myObject__c) and

2- I would like users to click a button on myObject page layout .

3- This button will show a list of account records based on a simple query, with a checkbox (similar to enhanced list)

4- User will select one or more displayed account records by clicking checkbox and will click done.

5- The selected account Ids will be saved in a custom object (RelatedAcct__c).

 

Can we create "add campaign members" like fucntionality using VF page ?

 

Thanks! 

  • December 17, 2009
  • Like
  • 0

I would like to make content workspace files available on a force.com site page ( for un-authenticated user). Is this possible ?

 

If the answer is yes, then where and how do I set content workspace permission for un-authenticated user. In the workspace permission menu, I do not see an option to include unauthenticated user for view permission.

I do not want to use cutomer portal or  partner portal for this purpose. Thanks !

  • April 03, 2011
  • Like
  • 0

Current documents has no example on how to schedule apex jobs every 10 mins. I tried with unix cron job syntax style (like 0,10,20,30,40,50 slots), that doesn't work.

 

Any help would be appreciated.

 

Thanks

  • February 17, 2010
  • Like
  • 0

Wondering if anyone has run into a similar issue...I'll try to be brief with my explanation.

We are integrating 2 systems (SFDC and SAP) using custom ws and callouts - not outbound messaging.

 

When an "Order" (custom object) goes to a certain status, a process runs to send the Ordre to SAP.  First thing we do is create a SAP Order Id (another custom field).  We don't create the Id until the order is about to be sent to SAP because there is a limited # of Ids we can use (it's a range, so we don't want to loose ids for cancelled orders or orders that wont be integrated with SAP).

 

My code figures out what the next SAP Order Id should be and then sets it and does an "Update" on the List I'm holding the data in.

 

AFTER the update statement I make a callout to SAP where the order is created in SAP.

 

When SAP creates the Order, there is some backend processes on their side that run which in turn UPDATES the Order.  These updates are sent back to SFDC. We don't get stuck in a loop because UPDATES in SFDC are NOT sent to SAP.

 

Since Orders can be created in SAP, when SAP sends an Order or Order Update to SFDC, we use the SAP Order Id to match to an existing order.  If there isn't one, we assume it's new and create it.

 

This is where the problem comes in...it appears that my process that sets the SAP Order Id AND sends the Callout does not COMMIT the update to the SAP Ordre Id field until AFTER the Callout receives some sort of response from SAP. 

 

The problem is that it seems SAP sends an UPDATE to SFDC  BEFORE SFDC is finished processing the callout, so we are getting duplicate orders in SFDC - basically, SFDC decides that the SAP Order Id should be "XYZ", even though I say "UPDATE my Order" it waits until it hears a callout response.  In the mean time SAP has received the create call, done it's magic and sent an update BACK to SFDC  saying "there's an update to order XYZ" all before SFDC FINALLY updates the Order with the SAP Order Id.

 

I hope that all makes sense.

 

Basically, I need my SAP Order Id to be committed BEFORE a callout is made, but don't know how to do that since it's happening in the same class/call.  The reason I believe it's a timing thing is because the SAP Order Id that's showing in the duplicate Order is the one sent to SAP - SAP would create it's own order with a different range.

 

Any thoughts?

 

I would like to create an account triger so when a user access an account a triger will place a record in the SF database or simply write to a local file the Account Name.

 

Would someone please assist me as I know nothing about adding trigers or Apex code.

 

TIA,

Ira

Message Edited by Ira on 01-21-2010 10:34 AM
  • January 21, 2010
  • Like
  • 0

I am invoking an approval process in an after update trigger which results in bunch of runtime errors. The approval process works flawlessly when submitted through default "Submit for Approval" button

 

below is my trigger code and the run time error messages 

 

trigger Approval_Process on SPA__c (after update){

for(SPA__c sp: Trigger.new){

if (sp.Submit_for_Approval__c){

Approval.ProcessSubmitRequest req1 = new Approval.ProcessSubmitRequest();

req1.setComments('Submitting request for approval.');

req1.setObjectId(sp.id);

req1.setNextApproverIds(new Id[] {UserInfo.getUserId()});

//req1.setNextApproverIds='005Q0000000IFNf';

Approval.ProcessResult result = Approval.process(req1);

System.assert(result.isSuccess());

System.assertEquals('Pending', result.getInstanceStatus(), 'Instance Status'+result.getInstanceStatus());

}

}

}

 The runtime errors I get are

CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY

NO_APPLICABLE_PROCESS

 

The detailed message is below

 

Error: Invalid Data. Review all error messages below to correct your data.Apex trigger Approval_Process caused an unexpected exception, contact your administrator:

Approval_Process: execution of AfterUpdate caused by: System.DmlException: Process failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY,

Approval_Process: execution of AfterUpdate caused by: System.DmlException: Process failed. First exception on row 0; first error: NO_APPLICABLE_PROCESS, No applicable approval process found.: [] Trigger.Approval_Process: line 11, column 45: []: Trigger.Approval_Process: line 11, column 45

 

 

 

 

 

  • January 21, 2010
  • Like
  • 0

I need a trigger developed to autmoatically change the status of a case depending upon (primarily) who has responded - the customer or a support rep.

 

When the case is created, the status should be "New".

 

If the client adds a response (via email, self-service, etc.) and the status is "New", keep the status as "New". Otherwise, change the status to "Need to Respond".

 

If a support rep responds (by adding a public comment, email, etc.), the case status should be changed to"Waiting For Client Response".

 

I have a couple of additional status options which include "On Hold" - used by us to signify that the case is temporarily suspended but not closed, "Escalated" - used when the case has been escalated for an exec to review, and a couple of "Closed" options.

 

I'm not sure how complicated this is - I have no programming ability outside of HTML and some very basic PHP. I'd be willing to pay a small bounty just let me know.

 

Thanks.

  • January 20, 2010
  • Like
  • 0

Hi,

 

I have a requirement where I need to append text at the end of an email message. However, the email message is based on the template. If I try to get the email template body and send it as part of the email, the merge fields are not processed. Is there a good way to do this? 

I have a a time delayed workflow with the following items in place:

 

 

Conditions for workflow rule -

On Create:

Custom_DateTime_Field > Now

Custom_PicklistStatus__c = "Email Pending"

 

 

 

 

If true, take these actions:

 

->1 hour after a referenced Custom_DateTime_Field__c, send an email

->2 hours after the  Custom_DateTime_Field__c, Update picklist Custom_PicklistStatus__c, from value from "Email Pending" to "Email Sent"

 

 

The second Action does not activate.

 

 

I am guessing a circular reference on the Custom_PicklistStatus__c field is causing the problem, if so, is there a "simple" way around this using the same field? If the problem is not a circular reference, any thoughts as to the cause of the problem?

 

 

Ryan

Hi,

 

I have a test method for a Apex class.I'm getting more than 75 % coverage on test method. If i deploy the test method from sandbox to Production org then i'm getting the following Error.

 

'Apex Heap Size is too Large'.

 

Please suggest any solution for this.

 

Thanks in advance.

 

 

Hi folks,

I am new to VF. I am trying to create a VF page very similar to add campaign members functionality where one can select multiple contacts and attach them to campaign in one step.

 

Here is my use case,

1- I have a custom object (myObject__c) and

2- I would like users to click a button on myObject page layout .

3- This button will show a list of account records based on a simple query, with a checkbox (similar to enhanced list)

4- User will select one or more displayed account records by clicking checkbox and will click done.

5- The selected account Ids will be saved in a custom object (RelatedAcct__c).

 

Can we create "add campaign members" like fucntionality using VF page ?

 

Thanks! 

  • December 17, 2009
  • Like
  • 0
Hi Experts,

Quick advice! i have a WSDL2Apex class on my sandbox which i want to deploy to prod. My question is, do i need to write a test class for it before it can be successfully loaded to salesforce?



B