• Lucas Duque 9
  • NEWBIE
  • 49 Points
  • Member since 2016

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 0
    Questions
  • 11
    Replies
I'm trying to create a Workflow Rule if the Oppportunity Amount is <= $299 then update 2 Contact Object picklist fields, one called Member Level , choosing the value of 'Current', and a 2nd picklist field called Member Status, choosing the value of 'Light'. Not sure if I should even try this with a Workflow Rule, or try to set it up in Process Builder. Does anyone have any suggestions? 

 
How can we add logic to prevent users from adding, editing, or removing lines on Quotes in Salesforce. We are integrated with third party application for quoting needs and all the changes should occur from third party application and will be pushed from there to the SF Quote via an integration user. What is a non-invasive way to accomplish this. Thanks.
Hi,

I am trying to create an enum datatype for relationships. Below is the code I am using:

public Enum Enum_RelationShipCode {Father, Mother, Brother, Sister, Uncle, Aunt, Brother-In-Law, Daughter-In-Law, Child}

However, I am getting compile errors when trying to save the class as below.

Expecting '}' but was: '-'
Unexpected Token ','.
Unexpected Token '}'

Can someone help? It appears that Salesforce enums are not supporting hyphens in them.
  • May 29, 2018
  • Like
  • 0
I am receivin this general error.
Error(s) occurred while submitting the page. The error details are:
An exception was encountered when attempting to populate default value: (System.TypeException)Illegal assignment from List<Account> to Account

This is in our sandbox environment. We were able to use our sandbox without any issues a few days ago. We didn't make any change to our code. Today, we received this error. We ran a debug log and couldnt find anything either. What is going on? 
There is a very interesting problem that I am seeing. The below soql 

select Id,name from CaseTeamRole returns 2 rows 


 IdName
10B71a000000PBGRCA4Contributor
20B71a000000PBGWCA4Read Only

where as 

the soql 

select Id,name from CaseTeamRole name = 'Contributor' returns 0 rows. 

The happens only our full sandbox and on production our queries execute perfectly fine. 
Has anyone faced such an issue ? Need help in resolving it.
 
Hello All,

I have run code scanner tool on my apex class and Visual force page. It give me FLS Create and FLS Update Issues.
I have solved these issues as per mention following URL

https://developer.salesforce.com/page/Testing_CRUD_and_FLS_Enforcement
https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_perms_enforcing.htm

Again I have run code scanner tool on my apex class and Visual force page. It gives me again FLS Create and FLS Update Issue.
Let me know, if anything I miss

Following are the sample code

Boolean isContFirstNameUpsertable = Schema.sObjectType.Contact.fields.FirstName.isCreateable() &&
                                Schema.sObjectType.Contact.fields.FirstName.isUpdateable();
Boolean isContLastNameUpsertable = Schema.sObjectType.Contact.fields.LastName.isCreateable() &&
                                Schema.sObjectType.Contact.fields.LastName.isUpdateable();

List<Contact> lstContact = new List<Contact>();
if(isContFirstNameUpsertable && isContLastNameUpsertable) {
    for(AgentWrapper aw : scope) {
        Contact c = new Contact(
                                    FirstName=aw.FirstName,
                                    LastName=aw.LastName);
        lstContact.add(c);
    }
    if(lstContact.size() > 0) {
        upsert lstContact;
    }
}

Thanks in Advance
I am using number of objects in my app which are inter-related to each other. Whereas the controllers have good frequency of methods around it. Every time i create a test class and test method for testing any controller method, i need to create new Records which are required for the execution of controller methods. Is there any way to create a class which provides me all types of required records. Something like a data factory class which can be used in every test class during test execution.
I need to create a button on contact related list so that I can send email to selected multiple contacts. What would be the best solution and best practices?
I'm trying to create a Workflow Rule if the Oppportunity Amount is <= $299 then update 2 Contact Object picklist fields, one called Member Level , choosing the value of 'Current', and a 2nd picklist field called Member Status, choosing the value of 'Light'. Not sure if I should even try this with a Workflow Rule, or try to set it up in Process Builder. Does anyone have any suggestions? 

 
Hello Everybody , 
Our team uses a set of standard project description which are copied and pasted into project description field each time they create a quote. This is time consuming.
Instead, I would like to create a picklist next to the description which would contain the subject line of the standard project description. So by selecting the picklist value the body of the project description is entered into description field. 
Could you please guide me on how this could be achieved. 
Thanks
Hi Guys please help me!

I have a custom picklist field in PRODUCT OBJECT. Which I want to show in my OPPORTUNITY PRODUCT OBJECT.

I tried cross object formula - TEXT(field.name) but its not working nor the workflow rule.

I dont want to use any code or trigger plz help me through formula. Please help me guys i really need help!!
trigger ClosedOpportunityTrigger on Opportunity (after insert,after update) {
List<task> carry=New List<task>();

  for(opportunity opp:trigger.new){
   if(opp.stagename=='closed own'){
    task t=new task(whatid=opp.id);
    carry.add(t); 
    }
   }
     insert carry;

 }

 The trigger will add a task to any opportunity inserted or updated with the stage of 'Closed Won'. The task's subject must be 'Follow Up Test Task'.The Apex trigger must be called 'ClosedOpportunityTrigger'
With 'ClosedOpportunityTrigger' active, if an opportunity is inserted or updated with a stage of 'Closed Won', it will have a task created with the subject 'Follow Up Test Task'.
To associate the task with the opportunity, fill the 'WhatId' field with the opportunity ID.
This challenge specifically tests 200 records in one operation.

I tried with the above code, task is not created.
I need to create a button on contact related list so that I can send email to selected multiple contacts. What would be the best solution and best practices?