• Marco Pollastri 1
  • NEWBIE
  • 55 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 20
    Replies
Hi, I am creating a scheduled flow that is running once a day.

The aim of the flow is to get the oldest contact related to the account and update a contact field called contact role = 'Primary'

The flow is working but is updating all the contacts as primary. Flow StructureGet RecordUpdate
The get record is filtering all the contact related to the account and sorting by created date.
Any idea why all the contacts are updated instead of only the oldest
Hi, I am building a Process builder where I would like to create a formula that evaluates the country selected from the picklist Country on the lead object.

So my aim is to build this formula saying that if a country selected on the country picklist is China or Japan, then should trigger an action. How should I write the formula?
countries

OR(
ISPICKVAL([Lead].Country, China),

ISPICKVAL([Lead].Country,  Japan)

)


Thanks 
Hi, this is the trigger I have developed, I need to get accounts information, I need to reach a field called Type on the accont.


trigger Error_Opp on Opportunity (before insert) {
  for( Opportunity oppsupplier: trigger.new ){
       if(oppsupplier.Opp_Count__c == 1 && oppsupplier.type == 'Supplier')
        {
                 oppsupplier.addError('This is a Supplier Account, it can have only one Opportunity.');
       }
   }
}


Thanks 
Hi, I have tested my trigger, but the coverage of the code reached 66% even if the test of the class was successfully, how can I reach 75%? test 1ithis was the class:

@isTest
private class ErrorMessagetestclass {
    
    Static testmethod void myTest(){
        Opportunity opp = new Opportunity ();
        opp.Name = 'Test';
        opp.StageName = 'Qualification';
        opp.CloseDate = Date.parse('12/10/2021');
        opp.Type = 'Supplier';
                insert opp;
}
    }
Thanks 
Hi everyone, 
I am trying to create a Tigger to display a simple error message. 

I would like to block the user to create more than one Opp in a Supplier Account. So if the user is creating the second Opp related to a supplier account the System has to stop him to create the second Opp. 

This is the trigger I have created:

trigger Error_Opp on Opportunity (before insert) {
  for( Opportunity oppsupplier: trigger.new ){
       if(oppsupplier.Opp_Count__c>=1 || oppsupplier.type= 'Supplier')
        {
                 oppsupplier.addError('This is a Supplier Account, it can have only one Opportunity.');
       }
   }
}

The trigger works only with 'oppsupplier.Opp_Count__c>=1' condition, If i add thi condition ' || oppsupplier.type= 'Supplier' the system give me this error message:

'Error: Compile Error: Expression cannot be assigned at line 4 column 11'

How can I add an extra condition in the If?
Thanks


 
Hi,
I am trying to call a Flow with a trigger when the 'clone price book' field check box in the Pricebook object is marked as true.

trigger Clonepricebook on Pricebook2 (after insert) {
for(Pricebook2 Price: Trigger.new){
        If (Price.Clone_Price_Book__c == true ){
        flow.Interview.Clone_Client_Price_Book myFlow= new Flow.Interview.Clone_Client_Price_Book;        }
    }
}
Unfortunately, Salesforce does not allow to create actions from price book

So i think the trigger is the only solution to recall the Flow.

Thanks 
Hi, I am building a Process builder where I would like to create a formula that evaluates the country selected from the picklist Country on the lead object.

So my aim is to build this formula saying that if a country selected on the country picklist is China or Japan, then should trigger an action. How should I write the formula?
countries

OR(
ISPICKVAL([Lead].Country, China),

ISPICKVAL([Lead].Country,  Japan)

)


Thanks 
Hi, this is the trigger I have developed, I need to get accounts information, I need to reach a field called Type on the accont.


trigger Error_Opp on Opportunity (before insert) {
  for( Opportunity oppsupplier: trigger.new ){
       if(oppsupplier.Opp_Count__c == 1 && oppsupplier.type == 'Supplier')
        {
                 oppsupplier.addError('This is a Supplier Account, it can have only one Opportunity.');
       }
   }
}


Thanks 
Hi, I have tested my trigger, but the coverage of the code reached 66% even if the test of the class was successfully, how can I reach 75%? test 1ithis was the class:

@isTest
private class ErrorMessagetestclass {
    
    Static testmethod void myTest(){
        Opportunity opp = new Opportunity ();
        opp.Name = 'Test';
        opp.StageName = 'Qualification';
        opp.CloseDate = Date.parse('12/10/2021');
        opp.Type = 'Supplier';
                insert opp;
}
    }
Thanks 
Hi everyone, 
I am trying to create a Tigger to display a simple error message. 

I would like to block the user to create more than one Opp in a Supplier Account. So if the user is creating the second Opp related to a supplier account the System has to stop him to create the second Opp. 

This is the trigger I have created:

trigger Error_Opp on Opportunity (before insert) {
  for( Opportunity oppsupplier: trigger.new ){
       if(oppsupplier.Opp_Count__c>=1 || oppsupplier.type= 'Supplier')
        {
                 oppsupplier.addError('This is a Supplier Account, it can have only one Opportunity.');
       }
   }
}

The trigger works only with 'oppsupplier.Opp_Count__c>=1' condition, If i add thi condition ' || oppsupplier.type= 'Supplier' the system give me this error message:

'Error: Compile Error: Expression cannot be assigned at line 4 column 11'

How can I add an extra condition in the If?
Thanks


 
Hi,
I am trying to call a Flow with a trigger when the 'clone price book' field check box in the Pricebook object is marked as true.

trigger Clonepricebook on Pricebook2 (after insert) {
for(Pricebook2 Price: Trigger.new){
        If (Price.Clone_Price_Book__c == true ){
        flow.Interview.Clone_Client_Price_Book myFlow= new Flow.Interview.Clone_Client_Price_Book;        }
    }
}
Unfortunately, Salesforce does not allow to create actions from price book

So i think the trigger is the only solution to recall the Flow.

Thanks 
The call for service field description in the requirement is way different than what trailhead is actually validating.

User-added image
I'm on the "Visualizing Your Data" unit and I got down to the challenge which I believe I completed correctly but I get this error:

Challenge not yet complete... here's what's wrong: 
One or more of the following is incomplete in the Dashboard: no component uses the 'Cases by Status' report as a source report, your component does not have a 'Cases by Status' header, and/or your component does not have a 'New vs Closed' title.

I've checked this five or six times and have created the dashboard twice.  Not sure how to progress from here.  Any help will be greatly appreciated.
I am new to salesforce. I have a community for my users in sandbox.Community is in the preview mode.The login to the community site is working just fine, i can login to the community with the test user's credentials.The problem is when a user forgets their password and tries to reset it. It sends an email to the user with the template assigned to the Forgot Password community setting. The email template includes the {!Community_URL} merge field. Ideally the email received contains a link to the page with some type of reset token as a parameter(your_community_domain/communitiy_name/login?c=TOKEN),and it should be redirected to the change password page. But When the user clicks on the above link, it gets redirected to the link (your_community_domain/communitiy_name/secur/forgotpassword.jsp?r=some token) which redirects to login page and thus there is no way for them to reset their password. Interesting thing is as community is in preview mode ideally it should not be sending any forgot password mails, but in this case it is sending mail with wrong url.

So what should I do to fix this issue? Any kind of help will be appreciated.Thanks.
I am doing Trailhead "Reports & Dashboards - Visualizing your data" Challenger and keep getting above mssage

"Challenge not yet complete... here's what's wrong: 
The 'Cases by Status' report does not include the Owner and Account Name columns"


Here is the reprt few lines with header"

Case Owner Subject Date/Time Opened Age (Hours) Open Closed Account/Full Name Account Owner Alias Account Owner Account ID
Status: New (9 records)
                     
  Raza Syed Motor design hindering performance 1/21/2014 2:48 PM 14,708 [Checked] [Not Checked] United Oil & Gas Corp. RSyed Raza Syed 001i000000aGi87
  Raza Syed Electrical circuit malfunctioning 1/21/2014 2:48 PM 14,708 [Checked] [Not Checked] Express Logistics and Transport RSyed Raza Syed 001i000000aGi85
       
Can someone please help me what am i doing wrong.

Thanks
Hi All,

I have created a summary report named "Cases by Status" and included Case Owner and Account Name fields as columns. But still I am getting an error saying...
Challenge not yet complete... here's what's wrong:  The 'Cases by Status' report does not include the Owner and Account Name columns. Where am I going wrong?
Hi all, I'm getting this error message from the checker "Challenge not yet complete... here's what's wrong: 
The 'Basic Account User' profile did not have the appropriate object and field-level security for the Account object"
I think I've tried every possible way to set up the Basic Account User and Pofiles. I have tried allowing the filed in the profile but not in the permission set, and vice versa as well as a mix of the two. How am I supposed to set up the Basic Account User?? I have been editing the Account settings under the Standard Object Permissions section of the profile, but if there is something else I am supposed to be editing, please let me know. Thanks!
Trailhead Module 3:  Create a formula field that determines the number of days between today and the last activity date for a case's account.
Your support team has asked for improved visibility on account activity level at the time they’re helping with customer issues. Specifically, when they’re looking at a case, they’d like to see an at-a-glance view of the number of days since the case’s related account was last active. Create the formula using these requirements.The formula should be on the Case object.
The formula should be of return type Number.
The formula should be named 'Days Since Last Update' and have a resulting API Name of 'Days_Since_Last_Update__c'.
The formula should return the number of days between the account’s Last Activity Date and today.

I created the following:

I created a new custom formula field with return type number and called Days Since Last Update.
I created this formula: Account.LastActivityDate - TODAY()

I get this error message:

Challenge not yet complete... here's what's wrong: 
The 'Days_Since_Last_Update__c' formula field did not return the correct number of days between an Account’s Last Activity Date and today

Can you please assist what I did wrong?  I'm not sure if my formula is even correct with the challenge.  Please help!

Thank you.
Greetings, I cannot seem to get this to work. I have my var set to cs, as it only works with that, rather, as I attempt to set it, I get the error message of var not set correctly. Please advise. Here's the code. The apex code appears correct.

<apex:page controller="NewCaseListController">
    <apex:form >
        <apex:pageBlock title="Case List" id="Case_list">
         <apex:repeat value="{!NewCases}" var="cs">
         <table style="width:1000px;">
          
<tr>
 <apex:repeat value="{!NewCases}" var="cs">
        <apex:outputLink value="https://na16.salesforce.com/{!cs.Id}">{!cs.CaseNumber}</apex:outputLink>
         <apex:outputLink value="{!cs.CaseNumber}">{!cs.CaseNumber}</apex:outputLink>
        </apex:repeat> 
             </tr>
        </table>
             </apex:repeat>
        </apex:pageBlock>
    </apex:form>
</apex:page>
Hi 
I am trying to loing to register and login into site it always throughing  "That operation is only allowed from within an active site."


https://URL/apex/SiteRegister

Anything I am missing.
Thanks

  • May 13, 2014
  • Like
  • 0