• Gian Piere Vallejos
  • NEWBIE
  • 160 Points
  • Member since 2019
  • Salesforce Developer
  • Ex2 Outcoding


  • Chatter
    Feed
  • 6
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 19
    Replies
rows = [
    {'Name': 'Name 1', 'Date': '06-Aug', 'Jan': 150, 'Feb': None, 'March': None, 'Apr': None, 'May': None},
    {'Name': 'Name 2', 'Date': '07-Aug', 'Jan': None, 'Feb': 100, 'March': 110, 'Apr': None, 'May': None},
    {'Name': 'Name 3', 'Date': '07-Aug', 'Jan': None, 'Feb': None, 'March': 400, 'Apr': 500, 'May': None},
]

def get_formatted_data(rows):
    data = []

    # For each row of rows
    for row in rows:

        # Loop through each key, value pair of row
        for key, val in row.items():
            data_dict = {
                'Name': row['Name'],
                'Date': row['Date']
            }
            if key not in ('Name', 'Date') and val:
                data_dict['Month'] = key
                data_dict['Rate'] = val
                data.append(data_dict)
    return data
Hi All,

Help me this, how to display records in lightning web components.using <table> tag.. import from apex class..

Thanks, Sesha.
Hi everyone,

We have a 'Rune rate' field which needs to be locked after it has been populated. I've figured that out with this validation rule:

AND(
ISCHANGED(Run_Rate__c),
NOT(ISBLANK(PRIORVALUE(Run_Rate__c)))
)
​​​​​​
Now i'm trying to exclude the system admin profile from this. I've tried using 

NOT($Profile.Name = "System Administrator")

but I'm not sure where to put it as I keep getting the 'missing )' error. Any ideas?

(I'm very new to formulas!)

Hi everyone,

We have an Apex job/batch which executes each week and deletes all Contact records whith a certain condition (let suppose, ActivationDate__c older than 24-months).

How should I edit this Apex job in order to send automatically an Email to a Salesforce user whenever it finishes to comunicate the result (such as: success or failure/exception)?

 

Thank you so much,

Skender

Hi,

I have a requirement,in a object i have to restrict for  crearting records on below case:
Suppose I have created a records and on custom field(Test_code__c) I have put value:"ABC",and start date-->29/11/2019
End date:->29/12/2019

So in next records if I tried to create the record with same value 'ABC',the Start date and End should not be overlaped.
Hi,

Thanks in Advance,
I want to create a date format like this November 29th, 2019 from date/Time field using Apex class.
rows = [
    {'Name': 'Name 1', 'Date': '06-Aug', 'Jan': 150, 'Feb': None, 'March': None, 'Apr': None, 'May': None},
    {'Name': 'Name 2', 'Date': '07-Aug', 'Jan': None, 'Feb': 100, 'March': 110, 'Apr': None, 'May': None},
    {'Name': 'Name 3', 'Date': '07-Aug', 'Jan': None, 'Feb': None, 'March': 400, 'Apr': 500, 'May': None},
]

def get_formatted_data(rows):
    data = []

    # For each row of rows
    for row in rows:

        # Loop through each key, value pair of row
        for key, val in row.items():
            data_dict = {
                'Name': row['Name'],
                'Date': row['Date']
            }
            if key not in ('Name', 'Date') and val:
                data_dict['Month'] = key
                data_dict['Rate'] = val
                data.append(data_dict)
    return data
I am working on trying to convert a visualforce page to look like a lightning related list, I added the lightningStylesheets="true" to my page but it still looks like classic. I'm guessing it is the pageblock tags.

How would convert those to the lightning UI?
 
<apex:page standardController="Bids_Sent__c" lightningStylesheets="true" recordSetVar="bids" extensions="UpdateBids"
    showHeader="false"
    id="muopp"
    
   
>

    <apex:form >
        
        <apex:pageBlock title="Update Selected Bids" mode="edit"  >
            <apex:pageMessages />
            <apex:pageBlockSection  >
                <apex:inputField value="{!Bids_Sent__c.IsAddedToPDF__c}" id="stagename">
                    <apex:actionSupport event="onchange" rerender="muselectedlist"/>
                </apex:inputField>
            </apex:pageBlockSection>
            <apex:pageBlockButtons location="bottom"  >
                <apex:commandButton value="Save" action="{!save}" id="butsav"/>
                <apex:commandButton value="Cancel" action="{!cancel}" />
            </apex:pageBlockButtons>
        </apex:pageBlock>
        <apex:pageBlock title="Selected Bids for PDF" id="muselectedlist" >
            <apex:pageBlockTable value="{!selected}" var="bid" id="bidtab" >
                <apex:column value="{!bid.name}" id="bidname"/>
                <apex:column value="{!bid.IsAddedToPDF__c}" id="isbid"/>
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>



 
  • March 03, 2020
  • Like
  • 0
Hi All,

Help me this, how to display records in lightning web components.using <table> tag.. import from apex class..

Thanks, Sesha.
Hi All,

Any one can you please help me , how to write send email functionality in lightning web components


Thanks, sesha.
Hi everyone,

We have a 'Rune rate' field which needs to be locked after it has been populated. I've figured that out with this validation rule:

AND(
ISCHANGED(Run_Rate__c),
NOT(ISBLANK(PRIORVALUE(Run_Rate__c)))
)
​​​​​​
Now i'm trying to exclude the system admin profile from this. I've tried using 

NOT($Profile.Name = "System Administrator")

but I'm not sure where to put it as I keep getting the 'missing )' error. Any ideas?

(I'm very new to formulas!)

Hi everyone,

We have an Apex job/batch which executes each week and deletes all Contact records whith a certain condition (let suppose, ActivationDate__c older than 24-months).

How should I edit this Apex job in order to send automatically an Email to a Salesforce user whenever it finishes to comunicate the result (such as: success or failure/exception)?

 

Thank you so much,

Skender

I have a VF page that is basically created to generate a PDF document .
How do i add page breaks in this. 
The code is generating PDF and how ever i need a page break (need some content to be displayed in a fresh page).
How to do this.
Please suggest.
i found that i cant use @wire without setting cacheable=true.  But i dont want to cache the data... is there any solution?
I have an apex class which gets the values of device quantites coming up in the next few days. Im trying to build a display board with visualforce which works.

Im struggling to write a test class which covers the line however the test class is getting a tick in the status in the test logs on the developer console.

This is my class
 
public class LogisticsQuantity {
//Main class
    Date STARTDAY = Date.today();
    Date ENDDAY = STARTDAY.addDays(5);
    public Summary[] Summaries { get; set; }
    public LogisticsQuantity() {
        AggregateResult[] results = [
            SELECT Last_Date_for_Dispatch__c, Count(Id),
            SUM(Hard_Wired_Dash_Camera__c) hard,
            SUM(New_Unit_Qty__c) newUnit,
            SUM(Service_Unit_Qty__c) service
            FROM Unit_Request__c
            WHERE Last_Date_for_Dispatch__c >= :STARTDAY AND Last_Date_for_Dispatch__c < :ENDDAY AND Picked__c = FALSE
            GROUP BY Last_Date_for_Dispatch__c
            ORDER BY Last_Date_for_Dispatch__c ASC NULLS LAST
        ];
        Summaries = new List<Summary>();
        for (AggregateResult ar : results) {
            Summaries.add(new Summary(ar));
        }
    }

    // wrapper class for aggregate data
    public class Summary {
        public decimal NewQuantity { get; set; }
        public decimal SvcQuantity { get; set; }
        public decimal CamQuantity { get; set; }
        public date Name { get; set; }

        public Summary(AggregateResult ar) {
            CamQuantity = (decimal) ar.get('hard');
            NewQuantity = (decimal) ar.get('newUnit');
            SvcQuantity = (decimal) ar.get('service');
            Name = (date) ar.get('Last_Date_for_Dispatch__c');

        }
    }

}

My test class is looking like this im certain i must be missing something from it as im getting code coverage 0
@isTest
public class LogisticsQuantityTest {

    Date TODAY = Date.today();
    
    static testMethod void testLogsticsQuantity() {
    
    Unit_Request__c UR = new Unit_Request__c();
    UR.Date_Of_Job__c = Date.newInstance(2019,12,01);
    UR.Telenor_Elder__c = TRUE;
    UR.Company_Name_Text__c = 'Test Account';
    UR.Contact_Name_Text__c = 'Test Contact';
    UR.Contact_Telephone_Number__c = '01234456789';
    UR.Contact_Email_Address__c = 'test@test.com';
    UR.Unit_Request_to_Case__c = '5008E00000GEaqt';
    UR.LMU_2630_Loom_Standard__c = 1;
    UR.LMU_2630_Loom_Standard__c = 1;
    
    insert UR;
    test.startTest();
}
}

​​​​​​​
Hi,

I have a requirement,in a object i have to restrict for  crearting records on below case:
Suppose I have created a records and on custom field(Test_code__c) I have put value:"ABC",and start date-->29/11/2019
End date:->29/12/2019

So in next records if I tried to create the record with same value 'ABC',the Start date and End should not be overlaped.
Hi,

Thanks in Advance,
I want to create a date format like this November 29th, 2019 from date/Time field using Apex class.