-
ChatterFeed
-
0Best Answers
-
1Likes Received
-
0Likes Given
-
2Questions
-
0Replies
Update a custom field
I am using Tinderbox as my 3rd party contract proposal management software.
In order to create a document in TB, it has to reference a field from the Lead. So If I want to send "Blah" Proposal, I will need to have "Blah" in a specified field prior to submitting the request to TB. TB will then select the template based upon the string in the specified field.
I need to clear the text of the field about 5-10 seconds after submitting the request to TB. I have seen scripts out there that can help me with the delay, so I am not too worried about that, but I need to do something along these lines:
If Field contains text then wait 5 seconds and set the text back to nothing.
Here is what I have so far:
In order to create a document in TB, it has to reference a field from the Lead. So If I want to send "Blah" Proposal, I will need to have "Blah" in a specified field prior to submitting the request to TB. TB will then select the template based upon the string in the specified field.
I need to clear the text of the field about 5-10 seconds after submitting the request to TB. I have seen scripts out there that can help me with the delay, so I am not too worried about that, but I need to do something along these lines:
If Field contains text then wait 5 seconds and set the text back to nothing.
Here is what I have so far:
trigger ClearTempHook on Lead (before insert, before update) { //List<String> LeadNames = new List<String>{}; for(Lead myLead: Trigger.new){ if((myLead.temp_hook__c=='c')){ temp_hook__c == 'hello'; } } }
-
- Derrick Calderon
- January 25, 2016
- Like
- 1
- Continue reading or reply
Apex Deployment Error
The code works fine in Dev Environment, but it wont deploy to production.
Here is the error:
LeadConvert; null, Details: Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required; Average test coverage across all Apex Classes and Triggers is 0%, at least 75% test coverage is required.
Here is the code:
Can you assist?
Thank you
Derrick
Here is the error:
LeadConvert; null, Details: Test coverage of selected Apex Trigger is 0%, at least 1% test coverage is required; Average test coverage across all Apex Classes and Triggers is 0%, at least 75% test coverage is required.
Here is the code:
trigger LeadConvert on Lead (after insert,after update) { //Bulkified List<String> LeadNames = new List<String>{}; for(Lead myLead: Trigger.new){ if((myLead.isconverted==false) && (myLead.Ready_to_Convert__c == True)){ Database.LeadConvert lc = new database.LeadConvert(); lc.setLeadId(myLead.Id); lc.convertedStatus = 'Qualified'; //Database.ConvertLead(lc,true); lc.setDoNotCreateOpportunity(false); Database.LeadConvertResult lcr = Database.convertLead(lc); System.assert(lcr.isSuccess()); } } }
Can you assist?
Thank you
Derrick
-
- Derrick Calderon
- January 25, 2016
- Like
- 0
- Continue reading or reply
Update a custom field
I am using Tinderbox as my 3rd party contract proposal management software.
In order to create a document in TB, it has to reference a field from the Lead. So If I want to send "Blah" Proposal, I will need to have "Blah" in a specified field prior to submitting the request to TB. TB will then select the template based upon the string in the specified field.
I need to clear the text of the field about 5-10 seconds after submitting the request to TB. I have seen scripts out there that can help me with the delay, so I am not too worried about that, but I need to do something along these lines:
If Field contains text then wait 5 seconds and set the text back to nothing.
Here is what I have so far:
In order to create a document in TB, it has to reference a field from the Lead. So If I want to send "Blah" Proposal, I will need to have "Blah" in a specified field prior to submitting the request to TB. TB will then select the template based upon the string in the specified field.
I need to clear the text of the field about 5-10 seconds after submitting the request to TB. I have seen scripts out there that can help me with the delay, so I am not too worried about that, but I need to do something along these lines:
If Field contains text then wait 5 seconds and set the text back to nothing.
Here is what I have so far:
trigger ClearTempHook on Lead (before insert, before update) { //List<String> LeadNames = new List<String>{}; for(Lead myLead: Trigger.new){ if((myLead.temp_hook__c=='c')){ temp_hook__c == 'hello'; } } }
-
- Derrick Calderon
- January 25, 2016
- Like
- 1
- Continue reading or reply