• Dhanya N
  • SMARTIE
  • 932 Points
  • Member since 2015

  • Chatter
    Feed
  • 27
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 5
    Questions
  • 132
    Replies
I have an issue in the debug section it's saying that the ParentRecordType is an unexpected token for service appointments. 
global class ServiceAppointmentCancel implements Database.Batchable<SObject>, Schedulable
{ 
    global Database.QueryLocator start(Database.BatchableContext BC) 
    { 
        String subject = 'Reload,Pre-Trip report,Post-Trip report'; 
        String status = 'O'; 
        Date SchedEndTime = Date.today();
        String ParentRecordType = 'Work Order';
        String ID = 'WorkOrder.ID';
        String query = 'SELECT Subject,Status,SchedEndTime FROM ServiceAppointment WHERE subject = :subject AND status = :status AND SchedEndTime < :SchedEndTime' + 'SELECT ParentRecordType, FROM ServiceAppointment WHERE ParentRecordType = :ParentRecordType AND ID = ID'; 
        return Database.getQueryLocator(query); 
    } 

    global void execute(Database.BatchableContext BC, List<WorkOrder> serviceAppointments) 
    { 
        // Loop to iterate over the service appointments 
        for(WorkOrder service : serviceAppointments)
        
        { 
            service.status = 'C';
        } 
        for(WorkOrder work : serviceAppointments)
        {
            work.status = 'C';
        }
        // Preforming the DML operation 
        update serviceAppointments;
    } 

    global void finish(Database.BatchableContext BC) 
    { } 

    global void execute(System.SchedulableContext SC) 
    { 
        Database.executeBatch(new ServiceAppointmentCancel(), 200); 
    } 
}
Hello, 

I have 5 text fields that are required to be completed when a certain picklist value is chosen. 

The picklist api field name and value are: 

present__c, Yes

the 5 text field api field names are: 

choice_A__c
choice_B__c
choice_C__c
choice_D__c
choice_D__c

Any suggestions or knowledge article I can be referenced to would be great too!
  • September 20, 2019
  • Like
  • 0
Hi all,

I have 3 components. Parent, Child and Grandchild.

There's a aura:method on the Child component which invokes an action of the Grandchil.Controller
The Grandchild.Controller's action calls an apex method. 

What's the best way to call the Granchild.Controller's action from the Parent component?

Thanks in advance.
  • September 20, 2019
  • Like
  • 0
How write a trigger for opportunity stage cannot be move backward like if set 'qualification' not move to previous stage 'Prospecting'
Salesforce provided an example on how to do Data Table with Inline Editing (https://developer.salesforce.com/docs/component-library/documentation/lwc/data_table_inline_edit) capability.  When displaying a related field in the datatable column, it displays the ID instead of the relatedObject.Name.

For example, if I have a field Assignee__c that is related to the User object.  When displaying the Assignee__c field in the data table, it only displays the ID of the Assignee__c instead of the look up field that we can search and select a new user.

Does anyone know how to get around this?

Thanks,
Brianwx
Hello!!
In first field user will enter a time and second field will be picklist with value CST,MST,PST,IST according to user entered time, the four other  fields should be populated with CST time Value, PST time Value,MST time value and IST time value in formula..
The challenge is to search for the inserted record with an inline SOSL search, using Execute Anonymous.

This is what I did using Execute Anonymous Window
 
List<List<sObject>> searchList = [FIND 'Mission Control' IN ALL FIELDS 
                                  RETURNING Contact(FirstName, LastName,
                                  Phone, Email, Description)];
Contact[] searchContacts = (Contact[])searchList[0];
System.debug('Found the following contacts:');
for (Contact c : searchContacts) {
   System.debug('"'+c.LastName + ', ' + c.FirstName+'"');
}

But still there's an error when I check the challenge.

Challenge Not yet complete... here's what's wrong: 
Could not find the contact's name in the debug log. Be sure to run a query for your record, and to write your contact's name to the debug log using the System.debug() method.
I have a Junction Object = Linkage__c
When field Confidential_Link__c [Checkbox:Boolean] is updated I wish for the trigger to update another Checkbox field in a linked Object, TripReport__c.
I am not an experienced Apex programmer, so trying to keep it simple and have the following.

trigger Update_TR_ConfFlag on Linkage__c (after insert, after update){
for(Linkage__c c : Trigger.new)
TripReport__c.Confidential_Flg__c = c.Confidential_Link__c;
}

...but I get: "Error: Compile Error: Expression cannot be assigned at line -1 column -1"

Can anyone help?
hi , From trail head scenario is like this,


Create an Apex class that returns an array (or list) of formatted strings ('Test 0', 'Test 1', ...). The length of the array is determined by an integer parameter.
The Apex class must be called 'StringArrayTest' and be in the public scope.
The Apex class must have a public static method called 'generateStringArray'.
The 'generateStringArray' method must return an array (or list) of strings. Each string must have a value in the format 'Test n' where n is the index of the current string in the array. The number of returned strings is specified by the integer parameter to the 'generateStringArray' method.



and my code is,


Public Class StringArrayTest
{


 public static List<String> generateStringArray(integer n){
        List<string> srtList = new List<string>();
        for(integer i=0;i<n;i++){
            string s = string.valueOf(i);
            srtList.add('\'Test '+i+'\'');
        }
        system.debug('hhh'+srtList);
        return srtList;

}

}

i have run the code every this coming exactly but when i check the  chalange in trail head iam getting the error ,error is asfollows,

"
Challenge Not yet complete... here's what's wrong: 
Executing the 'generateStringArray' method failed. Either the method does not exist, is not static, or does not return the proper number of strings."   


Plesae any one tell me the suggestion.



Regards,
Siva 




 
When i am trying to complete the challenge, It asks me to Create an object with 'Campsite' as the Label and Object Name. The object must have the resulting API name of 'Campsite__c'.
When i am trying to action this the following error applies. If i try to submit with one underscore the challenge says it cannot locate it.

Error: The Object Name field can only contain underscores and alphanumeric characters. It must be unique, begin with a letter, not include spaces, not end with an underscore, and not contain two consecutive underscores.
Hi Everyone

I have wrtitten a test class for my apex class but i am able to coverage 65%.how to improve my code coverage ...
public with sharing class PicklistHandler 
{
    set<Id> setAccountId = new set<Id>();
    list<Account> lstAccount = new list<Account>();
  
    public void OnAfterInsert(list<Purchase_Order__c> lstDiscount) {
    
        for(Purchase_Order__c objDiscount : lstDiscount) {
        
            setAccountId.add(objDiscount.Company__c);
        }
        
        for(Account objAccount : [Select Id,Type From Account Where Id IN: setAccountId]) 
        {
            
            objAccount.Type = 'Customer';
            lstAccount.add(objAccount);
        }
        if(!lstAccount.isEmpty())
            update lstAccount;
    }
    
}
@isTest private class PicklistHandlerTestMethod
{
    static testMethod void TestPicklistHandler()
    {
        
   
    account a=new account(name='test',Region__c='East', Type='Prospect');
        insert a;
               Test.startTest();
        update a;
        Test.stopTest();
       
        
        Master_Product__c mp=new Master_Product__c(name='test name',Product_Code__c='c2');
        insert mp;
        
        contact c=new contact(firstname='Meenakshmi',lastname='Goswami',Designation__c='Developer',Accountid=a.id);
        insert c;


        Opportunity2__c op=new Opportunity2__c(Name='test1',Account__c=a.id,Master_Product__c=mp.id,Technical_Bid_date__c=date.Today(),Type_of_Business__c='Regular',Contact_Person__c=c.id);
        insert op;
        
        Opportunity_Product_Detail__c opd=new Opportunity_Product_Detail__c(Opportunity__c=op.id,Company__c=a.id,Quantity__c=10);
        insert opd;
        
        Quote__c qt=new Quote__c(Opportunity_Product_Detail__c=opd.id,Purpose_of_Sales__c='SEZ',Declaration_form_be_provided__c='No');
        insert qt;
        
        Purchase_Order__c sco=new Purchase_Order__c(Quote__c=qt.id,Opportunity__c=op.id);
        insert sco;
        Call_Up_Order__c cuo=new Call_Up_Order__c(name='test call up order',Quote__c=qt.id,Sale_Confirmation_Order__c=sco.id,Call_Up_Quantity__c=1);
        insert cuo;
        
        Invoice_Dispatch_details__c idd=new Invoice_Dispatch_details__c(Call_Up_Order__c=cuo.id,Purchase_Order__c=sco.id, Account_Lookup__c=a.id);
        insert idd;
        
        op.Approved_Artwork_Received__c=false;
        update op;
        
        
       
    }
}
User-added image

 
Hi Guys
I am facing one challenge for long time .I have two object Account and Discount__c with lookup relationship ,Account object have a picklist filed with value LEAD and CUSTOMER.

Now i have created a account record with picklist value LEAD. my requirment is when i am going to create a record on discount__c object the picklist value which was LEAD is converted to CUSTOMER autometically.that mean the parent object which have have child record then it will happens.how to achieve this solution ?
 
Hi All,

I want to display a value say 95.2% as 95%
I have written the below formula field :
TEXT(MyField__c * 100) & '%'

The above one gives me : 95.2%.

Thanks in Advance...!
Hello,

For a custom object i have around 100 custom fields.
I want to update some fields, i know that with Update my fucntion will work but i was wondering if the Upsert does the same work too.
I dont want to loose the earlier values.

Thank you for suggestions
trigger CTC_Update on Appraisal__c (after insert,before update ) {     List<appointment__c> AppList = New List<appointment__c>();     Set<Id> AppointIds = New Set<Id>();     For(Appraisal__c A : Trigger.New)     {         AppointIds.Add(A.ApplicantName__c);     }     List<appointment__c> AppointList = [Select Id,Current_CTC__c from appointment__c where id =: AppointIds];     For(Appraisal__c Aps : Trigger.New)     {         appointment__c A = new appointment__c();         For(appointment__c App : AppointList)         {             IF(Aps.ApplicantName__c == App.ID)             {                 A.Id = App.Id;                 IF(Aps.amount_of_Increment__c != 0 && Aps.amount_of_Increment__c != NULL)                 {                     A.Current_CTC__c = App.Current_CTC__c + Aps.amount_of_Increment__c ;                 }                 IF(Aps.Increment_Percentage__c != 0 && Aps.Increment_Percentage__c != NULL)                 {                     A.Current_CTC__c = App.Current_CTC__c + (App.Current_CTC__c * Aps.Increment_Percentage__c/100);                 }             }             AppList.Add(A);         }     }     IF(AppList != NULL)     {         Update AppList;     } }
HI

Can any one help me out in getting total count of opportunites between this years 2010 to 2016 which also needs accountname.

Thanks in Advance
select id, Name, (Select id, Accountid, Createddate, stageName From Opportunities) From Account where stageName = '6 - Closed Won' AND createdDate > 2010-01-01T00:00:00Z and createdDate < 2016-01-31T23:59:59Z

 
I want to display accounthistory or contacthistory records in a pageblock table when i select accounthistory or contactHistory from a picklist.
Example:: picklist values accountHistory , if i select this the account history records should display?How?..Can any one help me please..
 
Hi,

I am trying to implement lightning-datatable with checkbox and pagination. But I am facing problem while navigating from one page to another. 
If I select row2,3, in the first five records and click next it automatically select the row7,8 on the next five records.

Please help me to solve this problem.

Thanks,
Dhanya
 
Hi All,

List<Id> pricebookEntryIdList = new List<Id>().
Here I have record ids in the list pricebookEntryIdList which is in the order I want.

List<PricebookEntry> products = [SELECT Id, Product2.Name, Product2.ProductCode, Product2.recordtypeid, Product2.recordtype.name FROM PricebookEntry WHERE Id IN :pricebookEntryIdList]
Above query doesn't return the record details in the same order of pricebookEntryIdList list. 

For example : If pricebookEntryIdList  contains {def, abc, ghi}, products contains records in the order of {abc, def, ghi}

Please help me to solve this.

Thanks,
Dhanya
Hi All,

In my dev org, I am not able to find 'Email Notification Checkbox' section in Task page layout. 

Expected should be as shown in the image:
User-added image

Actaul is as shown below:

User-added image

Can anyone please let me know why I am not able to see those option in the Layout Properties?

Thanks,
Dhanya
Hi All,

When updating Contacts with the Data Import Wizard, and select "Match Contact by Name" the Contact Owner becomes the importing user. Even though contact owner is not added in the csv. Why it behaves so?

Thanks,
Dhanya 
Hi All,

If I schedule the export data to 10th of every month. When I will get an email notification?

Thanks in advance!
Hello, 
I am trying to display some information but everytime I have this following message error :
SObject row was retrieved via SOQL without querying the requested field: Contact.Client_a_risque__c

Here below is my code : 

<!--*********************************************************************************
Class Name      : CCF_CustomContactSearch
Description     : This page will be open by InIn on an Agent's browser, once a Case is 
                  assigned to the Agent. 
                  When loaded, the page will contain a list of Contacts 
                  possibly matching to a value (svalue) contained in the URL as a parameter
                  The Agent also has the option to search for a specific contact, using the
                  input field beside "Search Contact" button. The value provided in the input 
                  field will be searched in ALL fields in the Contact Object
                  For every listed Contact, the Agent has the option lo link it to the Case,
                  using "Link to Case" button
Created By      : Mihai JURIAN
Created Date    : 30-Jan-17
Modification Log:
================================================================================== 
Developer                   Date                   Description
==================================================================================        
Mihai Jurian            30-Jan-17                   Initial Version
*********************************************************************************-->
<apex:page controller="CCF_searchContactController" docType="html-5.0" action="{!search_onLoad}" title="{!$Label.InIn_Recherche_de_contact}">

    <apex:includeScript value="/support/console/28.0/integration.js"/>
    <script type="text/javascript">
        function openCaseDetails() {
            sforce.console.openPrimaryTab(undefined, '/{!caseId}', true, '{!caseNumber}');
            closeTab();
        }

        // The callback function that closeTab will call once it has the ID for its tab
        var callCloseTab = function callCloseTab(result) {
            sforce.console.closeTab(result.id);
        }
    
        function closeTab() {
            sforce.console.getEnclosingPrimaryTabId(callCloseTab);
        }
    
        var pageLoad = window.onload;
        window.onload = function() 
        {
            if (pageLoad) 
            {
                pageLoad();
            }
            sforce.console.setTabTitle('{!$Label.InIn_Recherche_de_contact}');
        }
    </script>
    <apex:form >
        <apex:actionFunction name="updateSortOrderBy1" action="{!updateSortOrderBy}">
            <apex:param id="updateOrderBy" name="updateOrderBy" value="" />
        </apex:actionFunction>
        <apex:actionFunction name="search_method" action="{!search_method}" />

        
        <apex:input value="{!searchValue}" id="searchValue"/>
        <apex:commandButton value="{!$Label.InIn_Trouver_le_Contact}" onclick="search_method(); return false;" />
        <apex:outputText id="searchWarning" value="Please enter at least 2 characters before searching." rendered="{!showSearchWarning}" />
        
       
        <apex:pageBlock title="Contacts" id="block">
            <apex:inputCheckbox value="{!excludeHasFilter}"  onclick="search_method();" />
            <apex:outputText >{!$Label.CCF_CustomSearch_IncludeAllRecords}</apex:outputText>
            <br/>&nbsp;
            <apex:pageMessages />
            <!-- the Pagination/Navigation buttons -->
            <apex:pageBlockButtons rendered="{!RenderNavigation}" location="bottom"> 
                <apex:commandButton value="{!$Label.navigationFirst}" action="{!first}" disabled="{!DisablePrevious}"/>
                <apex:commandButton value="{!$Label.navigationPrevious}" action="{!previous}" disabled="{!DisablePrevious}"/>
                <apex:commandButton value="{!$Label.navigationNext}" action="{!next}" disabled="{!DisableNext}"/>
                <apex:commandButton value="{!$Label.navigationLast}" action="{!last}" disabled="{!DisableNext}"/>
            </apex:pageBlockButtons>
            <!-- the table showing the Contacts -->
            <apex:pageblockTable id="contactList" value="{!conListToShow}" var="con">
                <apex:column >
                    <apex:facet name="header">
                        <apex:commandLink action="{!updateSortOrderBy}" value="{!$ObjectType.Contact.fields.Name.Label + IF(orderBy == 'Name', '▼', IF(orderBy == 'Name DESC', '▲', ''))}" >
                            <apex:param name="updateOrderBy" value="Name" assignTo="{!updateOrderBy}"/>
                        </apex:commandLink>
                    </apex:facet>
                    <apex:outputLink value="/{!con.Id}" id="theLink">{!con.name}</apex:outputLink>
                </apex:column>
                <apex:column >
                    <apex:facet name="header">
                        <apex:commandLink action="{!updateSortOrderBy}" value="{!$ObjectType.Contact.fields.Birthdate.Label + IF(orderBy == 'Birthdate', '▼', IF(orderBy == 'Birthdate DESC', '▲', ''))}" >
                            <apex:param name="updateOrderBy" value="Birthdate" assignTo="{!updateOrderBy}"/>
                        </apex:commandLink>
                    </apex:facet>
                    <apex:outputfield value="{!con.Birthdate}"/>
                </apex:column>
                <apex:column >
                    <apex:facet name="header">
                        <apex:commandLink action="{!updateSortOrderBy}" value="{!$ObjectType.Contact.fields.Phone_1__c.Label + IF(orderBy == 'Phone_1__c', '▼', IF(orderBy == 'Phone_1__c DESC', '▲', ''))}" >
                            <apex:param name="updateOrderBy" value="Phone_1__c" assignTo="{!updateOrderBy}"/>
                        </apex:commandLink>
                    </apex:facet>
                    <apex:outputfield value="{!con.Phone_1__c}"/>
                </apex:column>
                <apex:column >
                    <apex:facet name="header">
                        <apex:commandLink action="{!updateSortOrderBy}" value="{!$ObjectType.Contact.fields.Phone_2__c.Label + IF(orderBy == 'Phone_2__c', '▼', IF(orderBy == 'Phone_2__c DESC', '▲', ''))}" >
                            <apex:param name="updateOrderBy" value="Phone_2__c" assignTo="{!updateOrderBy}"/>
                        </apex:commandLink>
                    </apex:facet>
                    <apex:outputfield value="{!con.Phone_2__c}"/>
                </apex:column>
                <apex:column >
                    <apex:facet name="header">
                        <apex:commandLink action="{!updateSortOrderBy}" value="{!$ObjectType.Contact.fields.Phone_3__c.Label + IF(orderBy == 'Phone_3__c', '▼', IF(orderBy == 'Phone_3__c DESC', '▲', ''))}" >
                            <apex:param name="updateOrderBy" value="Phone_3__c" assignTo="{!updateOrderBy}"/>
                        </apex:commandLink>
                    </apex:facet>
                    <apex:outputfield value="{!con.Phone_3__c}"/>
                </apex:column>
                <apex:column >
                    <apex:facet name="header">
                        <apex:commandLink action="{!updateSortOrderBy}" value="{!$ObjectType.Contact.fields.Email_1__c.Label + IF(orderBy == 'Email_1__c', '▼', IF(orderBy == 'Email_1__c DESC', '▲', ''))}" >
                            <apex:param name="updateOrderBy" value="Email_1__c" assignTo="{!updateOrderBy}"/>
                        </apex:commandLink>
                    </apex:facet>
                    <apex:outputfield value="{!con.Email_1__c}"/>
                </apex:column>
                <apex:column >
                    <apex:facet name="header">
                        <apex:commandLink action="{!updateSortOrderBy}" value="{!$ObjectType.Contact.fields.Email_2__c.Label + IF(orderBy == 'Email_2__c', '▼', IF(orderBy == 'Email_2__c DESC', '▲', ''))}" >
                            <apex:param name="updateOrderBy" value="Email_2__c" assignTo="{!updateOrderBy}"/>
                        </apex:commandLink>
                    </apex:facet>
                    <apex:outputfield value="{!con.Email_2__c}"/>
                </apex:column>
                <apex:column >
                    <apex:facet name="header">
                        <apex:commandLink action="{!updateSortOrderBy}" value="{!$ObjectType.Contact.fields.Agency_PIN__c.Label + IF(orderBy == 'Agency_PIN__c', '▼', IF(orderBy == 'Agency_PIN__c DESC', '▲', ''))}" >
                            <apex:param name="updateOrderBy" value="Agency_PIN__c" assignTo="{!updateOrderBy}"/>
                        </apex:commandLink>
                    </apex:facet>
                    <apex:outputfield value="{!con.Agency_PIN__c}"/>
                </apex:column>
                <apex:column >
                    <apex:facet name="header">
                        <apex:commandLink action="{!updateSortOrderBy}" value="{!'Record Type' + IF(orderBy == 'RecordType.Name', '▼', IF(orderBy == 'RecordType.Name DESC', '▲', ''))}" >
                            <apex:param name="updateOrderBy" value="RecordType.Name" assignTo="{!updateOrderBy}"/>
                        </apex:commandLink>
                    </apex:facet>
                    <apex:outputfield value="{!con.RecordType.Name}"/>
                </apex:column>
                <apex:column >
                    <apex:facet name="header">
                        <apex:commandLink action="{!updateSortOrderBy}" value="{!$ObjectType.Contact.fields.Client_a_risque__c.Label + IF(orderBy == 'Client_a_risque__c', '▼', IF(orderBy == 'Client_a_risque__c DESC', '▲', ''))}" >
                            <apex:param name="updateOrderBy" value="Client_a_risque__c" assignTo="{!updateOrderBy}"/>
                        </apex:commandLink>
                    </apex:facet>
                    <apex:outputfield value="{!con.Client_a_risque__c}"/>
                </apex:column>
                <!-- the buttons "Link to Case" -->
                <apex:column headervalue="{!$Label.Link_to_Case}">
                    <apex:commandButton value="{!$Label.Link_to_Case}" action="{!linkContactToCase}" rerender="block" oncomplete="openCaseDetails()">
                        <apex:param name="theContactId" value="{!con.Id}" assignTo="{!contactId}"/>
                    </apex:commandButton>
                </apex:column>
            </apex:pageblockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>


THANK YOU VERY MUCH FOR YOUR HELP.
I have an issue in the debug section it's saying that the ParentRecordType is an unexpected token for service appointments. 
global class ServiceAppointmentCancel implements Database.Batchable<SObject>, Schedulable
{ 
    global Database.QueryLocator start(Database.BatchableContext BC) 
    { 
        String subject = 'Reload,Pre-Trip report,Post-Trip report'; 
        String status = 'O'; 
        Date SchedEndTime = Date.today();
        String ParentRecordType = 'Work Order';
        String ID = 'WorkOrder.ID';
        String query = 'SELECT Subject,Status,SchedEndTime FROM ServiceAppointment WHERE subject = :subject AND status = :status AND SchedEndTime < :SchedEndTime' + 'SELECT ParentRecordType, FROM ServiceAppointment WHERE ParentRecordType = :ParentRecordType AND ID = ID'; 
        return Database.getQueryLocator(query); 
    } 

    global void execute(Database.BatchableContext BC, List<WorkOrder> serviceAppointments) 
    { 
        // Loop to iterate over the service appointments 
        for(WorkOrder service : serviceAppointments)
        
        { 
            service.status = 'C';
        } 
        for(WorkOrder work : serviceAppointments)
        {
            work.status = 'C';
        }
        // Preforming the DML operation 
        update serviceAppointments;
    } 

    global void finish(Database.BatchableContext BC) 
    { } 

    global void execute(System.SchedulableContext SC) 
    { 
        Database.executeBatch(new ServiceAppointmentCancel(), 200); 
    } 
}
I have a custom object called Year__c which is related to the Opportunity object.
On the Opp object I have a custom picklist field Period__c where has values 1 to 10. 
What I am trying to do is to automatically create Year__c records based on the Period__c picklist field. So if a user selects the value "2" in the Period__c field then I would like 2 Year__c records to be created.
Along with this I have a Start Date and End Date on the Opportunity and on the Year__c object. I need the Start Date in Year 1 record to = the Start Date on the Opportunity, the end Date should be 12 months after the Start Date on Year 1. On Year 2 the Start Date should be the day of the End Date of Year 1 and the End Date of Year 2 should = the End Date of the Opportunity. 

Would anyone be able to help me with this?
Hi everyone,

I am totally newbie to salesforce and apex. As I already managed to find a way to render a visualforce page to pdf and attach it by class to the record. This runs perfect in Sandbox. I dont get it to production instance due to the fact I dont even know how to test it.

Can anybody help me out generating a test class for my class?
would be so great to get it running. Thx to all!

Here is my Code:

public class quotePDFExtension {
    ApexPages.StandardController controller;
    public Quote quote {get;set;}
    public PageReference rtn;
    public quotePDFExtension(ApexPages.StandardController c){
        quote = (Quote)c.getRecord();
        rtn = c.view();
    }
    public PageReference attachQuotePDF() {
        /* Get the page definition */
        PageReference pdfPage = Page.angebot;
        pdfPage.getParameters().put('id',quote.id);
        /* generate the pdf blob */
        Blob pdfBlob = pdfPage.getContent();
        /* create the attachment against the offer */
        Attachment a = new Attachment(parentId = quote.id, name=quote.Angebot_Nr__c + '.pdf', body = pdfBlob);
        /* insert the attachment */
        insert a;
        /* send the user back to the offer detail page */
        return rtn;
    }


}


 

I need a validation for Apostrophe usage is to the letters D, L, and O. (e.g., O’Brien, D'Artagnan...)
I am using pattern="[ A-Za-z-_’]*"
  • October 09, 2019
  • Like
  • 0
Hi All,

I have create custom ligthning component for console app, in which I am listing records of milestone(Custome object).
After click on record, It open record details page in subtab.

"I want to refresh data in custom component(List of records) whenever record update from detail page in subtab"

User-added image
Thanks In Advance
Hi All,

I want add mouse hover tool tip for the Anchor tag in the lightning component. below is my code. 

<a onclick="{!c.profilePage}">My Profile</a>

i tried with lighting helptext but it is displaying i symble  User-added image  beside My Profile link.
<lightning:helptext content="Cilick on My Profile to see your account details" />

How to show tooltip without i symbol.


Thanks,
Anil Kumar 
Hi,

I am trying to implement lightning-datatable with checkbox and pagination. But I am facing problem while navigating from one page to another. 
If I select row2,3, in the first five records and click next it automatically select the row7,8 on the next five records.

Please help me to solve this problem.

Thanks,
Dhanya
 
Hello, 

I have 5 text fields that are required to be completed when a certain picklist value is chosen. 

The picklist api field name and value are: 

present__c, Yes

the 5 text field api field names are: 

choice_A__c
choice_B__c
choice_C__c
choice_D__c
choice_D__c

Any suggestions or knowledge article I can be referenced to would be great too!
  • September 20, 2019
  • Like
  • 0
Here is the code:
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" access="global" >
    
    <lightning:recordEditForm objectApiName="Menu__c" >
    <lightning:messages />
    <lightning:inputField fieldName="Item_Name__c"/>
    <lightning:inputField fieldName="Item_Type__c"/>
    <lightning:inputField fieldName="Item_Category__c"/>
    <lightning:inputField fieldName="Price__c"/>
    <lightning:button type="submit" value="Save" label="save"/>
    </lightning:recordEditForm>
</aura:component>

User-added image
  • September 20, 2019
  • Like
  • 0
Hi all,

I have 3 components. Parent, Child and Grandchild.

There's a aura:method on the Child component which invokes an action of the Grandchil.Controller
The Grandchild.Controller's action calls an apex method. 

What's the best way to call the Granchild.Controller's action from the Parent component?

Thanks in advance.
  • September 20, 2019
  • Like
  • 0
<apex:page standardController="Opportunity"  renderAs="pdf">

 
  <h1>Packing Slip</h1>
  
  <p></p>
  <h2>Ship To</h2>
     <p><b><apex:outputText value="{!Opportunity.Account.Name}"/></b>
     <br><apex:outputText value="{!Opportunity.ia_crm__Ship_to__r.FirstName}"/><apex:outputText value=" {!Opportunity.ia_crm__Ship_to__r.LastName}"/></br>
      <br><apex:outputText value="{!Opportunity.ia_crm__Ship_to__r.MailingStreet}"/></br>
      <br><apex:outputText value="{!Opportunity.ia_crm__Ship_to__r.MailingCity}"/><apex:outputText value=", {!Opportunity.ia_crm__Ship_to__r.MailingState}"/><apex:outputText value=" {!Opportunity.ia_crm__Ship_to__r.MailingPostalCode}"/></br>
      </p> 
     
    <p>PO #:<b><apex:outputText value=" {!Opportunity.Name}"/></b>
    <br>Order Date: <apex:outputText value=" {!Opportunity.CloseDate}"/></br>
    <br>Ship Date: <apex:outputText value=" {!TODAY()}"/></br></p>

<p></p>
<p></p>
<p></p>
<p></p>


<apex:pageBlock id="products_list">


      <apex:pageblockSection title="Shipment Details" columns="3">
      
          <apex:pageBlockTable value="{!opportunity.opportunityLineItems}"  var="prd" width="600px">

              <apex:column headerValue="Product" value="{!prd.ProductCode}"/>
              <apex:column headerValue="Description" value="{!prd.Product2.Name}"/>
              <apex:column headerValue="Quantity" value="{!prd.Quantity}"/>

        </apex:pageBlockTable>
    </apex:pageblockSection>
</apex:pageBlock>


</apex:page>

I have the Visualforce page above, which allows me to create a packing slip that can be printed out for some of our opportunities. However, we want the list of Opp Products to be limited to inventory only, and we want to filter out the non-inventor items from this view. 
How can I filter the apex:pageBlockTable to only include specific items?
Hi,
My requirement is to get below color indicators on an field-
  • ETA Changed 1st Time – Green 
  • ETA Changed 2nd Time – Yellow
Anybody please assist 
I am new to Salesforce and preparing for Admin Certification. Please help me with the below module where I am stuck up.

Define a Sharing Rule
  1. In Setup, use the Quick Find box to find Sharing Settings. This is the same page used to define org-wide defaults.
  2. In the Manage sharing settings for drop-down list, choose Job Application.  Choosing an object in this drop-down-list allows you to focus in on the org-wide defaults and sharing rules for a single object at a time rather than looking at all of them in a long page—a useful thing if you've got a large org with multiple custom objects. Let’s use this Sharing Rules related list to create a sharing rule that applies to both the Job Application and the Review objects.
I am not able to see any option called Job Application. Can anyone please help. I tried looking on the forum and community help and google. But did not find anything related to this topic. 
Hi,
I was asked in an interview the below question:
There is a custom object X and there is an Account Object.
Account object and X object do not have any relationship.

Whenever I will create an account record, I need to populate a text field with a value of X object on acccount object. This needs to be acheived using configuration and no customization.

When someone takes the time/effort to repspond to your question, you should take the time/effort to either mark the question as "Solved", or post a Follow-Up with addtional information.  

 

That way people with a similar question can find the Solution without having to re-post the same question again and again. And the people who reply to your post know that the issue has been resolved and they can stop working on it.