• sai ram
  • 0 Points
  • Member since 2019

  • Chatter
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 28
  • 6
if((acc.Created_Date__c).Month()!=system.now().month() && acc.Created_Month__c != system.now().month())

this condition how to cover in apex class using test class.
how to generate rtf file from apex class and vf page
Hi any one have idea HL7
  • September 29, 2020
  • Like
  • 0
i want to display formula field value in vf page but it showing total formula in vf page
  • September 15, 2020
  • Like
  • 0
Hi how to work with 123 form builder in salesforce 
any one have idea please help me
I need to generate pdf based on condition using trigger and apex class
that should be same as printable view how to achieve ?
public with sharing class AccountPDFGenerator { public static final String FORM_HTML_START = '<HTML><BODY>'; public static final String FORM_HTML_END = '</BODY></HTML>'; public static void generateAccountPDF(Account account) { String pdfContent = '' + FORM_HTML_START; try { pdfContent = '' + FORM_HTML_START; pdfContent = pdfContent + '<H2>Account Information in PDF</H2>'; //Dynamically grab all the fields to store in the PDF Map<String, Schema.SObjectType> sobjectSchemaMap = Schema.getGlobalDescribe(); Schema.DescribeSObjectResult objDescribe = sobjectSchemaMap.get('Account').getDescribe(); Map<String, Schema.SObjectField> fieldMap = objDescribe.fields.getMap(); //Append each Field to the PDF for(Schema.SObjectField fieldDef : fieldMap.values()) { Schema.Describefieldresult fieldDescResult = fieldDef.getDescribe(); String name = fieldDescResult.getName(); pdfContent = pdfContent + '<P>' + name + ': ' + account.get(name) + '</P>'; } pdfContent = pdfContent + FORM_HTML_END; }catch(Exception e) { pdfContent = '' + FORM_HTML_START; pdfContent = pdfContent + '<P>THERE WAS AN ERROR GENERATING PDF: ' + e.getMessage() + '</P>'; pdfContent = pdfContent + FORM_HTML_END; } attachPDF(account,pdfContent); } public static void attachPDF(Account account, String pdfContent) { try { Attachment attachmentPDF = new Attachment(); attachmentPDF.parentId = account.Id; attachmentPDF.Name = account.Name + '.pdf'; attachmentPDF.body = Blob.toPDF(pdfContent); //This creates the PDF content insert attachmentPDF; }catch(Exception e) { account.addError(e.getMessage()); } } }

User-added image
Hi Iam facing 
"insufficient access rights on cross-reference id "
issue may i know what is the reason iam updating the record that time iam facing the issue based on login user that record created by superior in role hierarchy and modified superior now iam login with other user iam unable to update the record that is in event object.and having accountid and contact id as whaid and whoid.user doesnt have access.but same user able to update another record iam confusing.
hi iam developing one lwc component iam facing issue with 
Error: Value too long for field: Source maximum length is:131072

how to resolve this issue.
Hi I have one requirement in lwc i want to pass value from parent to child combobox.

example i want to pass name as sairam value from parent to child 
ParentNames combobox.
how to show value in combobox options.
Hi Iam working with lwc component i am reciving response in my parent component based on response i need to pass values from parent to child how can achieve this
List<u_AssetRequest__c> assetReqList = new List<u_AssetRequest__c>();
        List<Map<String, Object>> equipmentOrderList = new List<Map<String, Object>>();
        List<Object> equipOrderObjList = (List<Object>) deserializedJson.get('equipmentOrderList');
        system.debug('equipOrderObjList : '+equipOrderObjList);
        for (Object obj : equipOrderObjList) {
            equipmentOrderList.add((Map<String, Object>)obj);
        List<Asset_Request_Line_Item__c> assetReqLineItemList = new List<Asset_Request_Line_Item__c>();
        Map<String,List<Asset_Request_Line_Item__c>> assetReqListMap = new Map<string,List<Asset_Request_Line_Item__c>>();
        Map<string,u_VisitTimesRequest__c> visitTimeRequestMap = new Map<string,u_VisitTimesRequest__c>();
        List<u_VisitTimesRequest__c> visitTimeReqList = new List<u_VisitTimesRequest__c>();
        for(Map<String, Object> equipOrderMap : equipmentOrderList){
            Map<String, Object> equipAddressMap = (Map<String, Object>)equipOrderMap.get('equipAddressData');
            Map<String, Object> assetRequestMap = (Map<String, Object>)equipOrderMap.get('assetReqData');
            Map<String, Object> routingMap = (Map<String, Object>)equipOrderMap.get('routingScreenData');
            Map<String, Object> visitTimeMap = (Map<String, Object>)equipOrderMap.get('visiTimeReq');
            List<Object> prodMaterialList = (List<Object>)equipOrderMap.get('prodMaterialData');
            List<Object> accessoryList = (List<Object>)equipOrderMap.get('accessoryData');
            system.debug('prodMaterialData : '+prodMaterialList);
            u_AssetRequest__c assReq = new u_AssetRequest__c();
                assReq.u_CustomerName__c = string.valueOf(equipAddressMap.get('RecipientName'));
                assReq.u_CustomerNumber__c = string.valueOf(equipAddressMap.get('RecipientNumber'));
                assReq.u_AttentionName__c = string.valueOf(equipAddressMap.get('u_AttentionName__c'));
                assReq.u_HouseNumber__c = string.valueOf(equipAddressMap.get('u_HouseNumber__c'));
                assReq.u_SuiteBuilding__c = string.valueOf(equipAddressMap.get('u_SuiteBuilding__c'));
                assReq.u_Street__c = string.valueOf(equipAddressMap.get('u_Street__c'));
                assReq.u_City__c = string.valueOf(equipAddressMap.get('u_City__c'));
                assReq.u_District__c = string.valueOf(equipAddressMap.get('u_District__c'));
                assReq.u_State__c = string.valueOf(equipAddressMap.get('u_State__c'));
                assReq.u_ZipCode__c = string.valueOf(equipAddressMap.get('u_ZipCode__c'));
                assReq.u_Telephone__c = string.valueOf(equipAddressMap.get('u_Telephone__c'));
                assReq.u_Email__c = string.valueOf(equipAddressMap.get('u_Email__c'));
                assReq.u_Country__c = string.valueOf(equipAddressMap.get('u_Country__c'));
                assReq.u_Trade_Name__c = string.valueOf(equipAddressMap.get('u_TradeName__c'));
                assReq.u_SubTradeChannel__c = string.valueOf(equipAddressMap.get('u_SubtradeChannel__c'));
                assReq.u_ModelType__c = string.valueOf(assetRequestMap.get('u_ModelType__c'));
                assReq.u_RequestedModelGroup__c = string.valueOf(assetRequestMap.get('u_RequestedModelGroup__c'));
                assReq.u_SpecificModel__c = string.valueOf(assetRequestMap.get('u_SpecificModel__c'));
                assReq.u_ReasonForSpecificModel__c = string.valueOf(assetRequestMap.get('u_ReasonForSpecificModel__c'));
                assReq.u_B__c = string.valueOf(assetRequestMap.get('u_B__c'));
                assReq.u_R__c = string.valueOf(assetRequestMap.get('u_R__c'));
                assReq.u_F__c = string.valueOf(assetRequestMap.get('u_F__c'));
                assReq.u_CodeGroup__c = string.valueOf(assetRequestMap.get('u_CodeGroup__c'));
Hi i have country combobox and selected country combobox two combo box i have when i choose option in country combobox that selected value shown in selected country combobox.
eg;country have choose india option that india shown in selected country combobox
User-added imagefirst row i selected options from jan to  march second row shoul d be showing from april how to achieve this.

This page has an error. You might just need to refresh it. [LWC component's @wire target property or method threw an error during value provisioning. Original error: [fields is not defined]] Failing descriptor: {markup://c:createCaseLWC}

How to solve this issue previously it working fine what i need to change
I have multi dependent picklist iam getting from the salesforce org i need to submit the values when create the record.
    @wire(getObjectInfo, {objectApiName: CASE_OBJECT})
    @wire(getPicklistValues, { recordTypeId: '$caseInfo.data.defaultRecordTypeId', fieldApiName: RMAREASON_FIELD })
    RMAReasonFieldInfo({ data, error }) {
        if (data) this.RMAReasonValues = data;
    @wire(getPicklistValues, { recordTypeId: '$caseInfo.data.defaultRecordTypeId', fieldApiName: FUNCTIONALAREA_FIELD })
    functionalAreaFieldInfo({ data, error }) {
        if (data) this.functionalAreaValues = data;
    @wire(getPicklistValues, { recordTypeId: '$caseInfo.data.defaultRecordTypeId', fieldApiName: PRODUCTSUBTYPE_FIELD })
    prdouctSubTypeFieldInfo({ data, error }) {
        if (data) this.productSubTypeValues = data;
    @wire(getPicklistValues, { recordTypeId: '$caseInfo.data.defaultRecordTypeId', fieldApiName: PRODUCTTYPE_FIELD})
    prdouctTypeFieldInfo({ data, error }) {
        if (data) this.productTypeOptions = data.values;
based on this code iam getting value
i created lwc component uploadfile after uploading.inserted file i need to show that file in data table.this is working as expected in salesforce org.
But it is not working in community any one have idea how to achieve this
i need to create a field attachment in case object to upload file
    <lightning-record-edit-form object-api-name="Case">
        <lightning-output-field field-name="CaseNumber">
        <lightning-input-field field-name="Subject">
        <lightning-input-field field-name="PRODUCTSUBTYPE__c">
        <lightning-input-field field-name="PRODUCTTYPE__c">
        <lightning-input-field field-name="RMA__c">
        <lightning-input-field field-name="FunctionalArea__c">
        <lightning-button class="slds-m-top_small"
iam using above lines of code but iam unable create record
Hi any one have idea HL7
  • September 29, 2020
  • Like
  • 0
Hi how to work with 123 form builder in salesforce 
any one have idea please help me
I need to generate pdf based on condition using trigger and apex class
that should be same as printable view how to achieve ?
hi iam developing one lwc component iam facing issue with 
Error: Value too long for field: Source maximum length is:131072

how to resolve this issue.

Below is my class which is generating PDF for insert or update, BUT FOR A SINGLE RECORD ONLY

public with sharing class PDFGenerator
    public static final String FORM_HTML_START = '<HTML><BODY>';
    public static final String FORM_HTML_END = '</BODY></HTML>';

    public static void generateAccountPDF(Payment__c payment)
        for(Payment__c p:[select id, name,TransactionStatus__c from payment__c where id=:payment.id]){
                String pdfContent = '' + FORM_HTML_START;
            pdfContent = '' + FORM_HTML_START;
            pdfContent = pdfContent + '<H2>Account Information in PDF</H2>';
            pdfContent = pdfContent + '<P>' + 'Mayank' + ': ' + p.name + '</P>';
            pdfContent = pdfContent + '<P>' + 'Sharma' + ': ' + p.TransactionStatus__c + '</P>';
            pdfContent = pdfContent + FORM_HTML_END;
        }catch(Exception e)
            pdfContent = '' + FORM_HTML_START;
            pdfContent = pdfContent + '<P>THERE WAS AN ERROR GENERATING PDF: ' + e.getMessage() + '</P>';
            pdfContent = pdfContent + FORM_HTML_END;
    public static void attachPDF(Payment__c payment, String pdfContent)
            Attachment attachmentPDF = new Attachment();
            attachmentPDF.parentId = payment.Id;
            attachmentPDF.Name = payment.Name + '.pdf';
            attachmentPDF.body = Blob.toPDF(pdfContent); //This creates the PDF content
            insert attachmentPDF;
        }catch(Exception e)

Can anyone suggest me how to make this code work for bulk insert or update