Skip to main content

#Lightning Experience10 personnes en discutent

i have lines of code in java which splits the pdf attachement ,. how to use this in salesforce,. 

below is the set of java code.

import org.apache.pdfbox.multipdf.Splitter;

import org.apache.pdfbox.pdmodel.PDDocument;

import java.io.File;

import java.io.IOException;

import java.util.List;

import java.util.Iterator;

public class SplitPages {

public static void main(String[] args) throws IOException {

//Loading an existing PDF document

File file = new File("C:/PdfBox_Examples/sample.pdf");

PDDocument document = PDDocument.load(file);

//Instantiating Splitter class

Splitter splitter = new Splitter();

//splitting the pages of a PDF document

List<PDDocument> Pages = splitter.split(document);

//Creating an iterator

Iterator<PDDocument> iterator = Pages.listIterator();

//Saving each page as an individual document

int i = 1;

while(iterator.hasNext()) {

PDDocument pd = iterator.next();

pd.save("C:/PdfBox_Examples/sample"+ i++ +".pdf");

}

System.out.println("Multiple PDF’s created");

document.close();

}

}

3 réponses
0/9000
<lightning:buttonMenu alternativeText="Toggle menu" iconSize="x-Small" onselect="{!c.handleMenuSelect}">
2 réponses
  1. 25 août, 14:10

    In my case I used empty attributes for active and inactive toggle as these were unwanted. It reduced the height

    <lightning-input

       type="toggle"

       label="All"

       message-toggle-active=""

       message-toggle-inactive="">

     </lightning-input> 

0/9000
Dear Team ,

Thank you for clearing my doubts !!!

Is it possible to create Lightning Web Component without installing Visual Studio code ? Through our salesforce account can we create LWC .

Thanks & Regards

Sachin Bhalerao
5 réponses
  1. 1 nov. 2019, 09:42
    Hi Sachin,

    Greetings to you!

    You cannot use the Developer Console to develop LWC. To experiment with Lightning Web Components, you can use the Lightning Web Components Playground: https://developer.salesforce.com/docs/component-library/tools/playground

    But there are some limitations:

    1. The playground doesn't provide Security with Lightning Locker.

    2. The playground can’t access Salesforce organizations, so it doesn’t support features that require data from Salesforce.

    https://developer.salesforce.com/docs/component-library/documentation/lwc/install_playground

    As per doc: https://developer.salesforce.com/blogs/2018/12/developer-tools-for-lightning-web-components.html

    There are other IDE as well for developing Lightning Web Component like Illuminated Cloud (https://plugins.jetbrains.com/plugin/10253-illuminated-cloud-2) but Salesforce recommends Visual Studio Code and the Salesforce Lightning Web Components Extension for VS Code. This combination provides powerful connections to the Salesforce CLI from within VS Code, plus additional features specific to developing Lightning web components for Salesforce.

    I hope it helps you.

    Kindly let me know if it helps you and close your query by marking it as solved so that it can help others in the future. It will help to keep this community clean.

    Thanks and Regards,

    Khan Anas

     
0/9000
Hi Devs,  I coded a Lightning Message Service channel in VS Code, deployed to Org, & then due to some issues later deleted it from the  Project AND Org.  But I think the LMS is STILL in the Org coz after cleaning up & deploying again it doesn't allow it and results in an error.

Here's my Q: do you know Where & How in Setup to: a) find Lightning Message Service channels, and b) completely delete them from the Org?

Thanks!! 

 
12 réponses
  1. 4 août, 16:03

    I don't know if anyone has found solution for this or not, only way to do this is open the Lightning messaging channel in VS code, right click from directory and select "Delete from project and org"

0/9000
I have a requirement wherein I need to send a quote record for approval using Salesforce standard approval process. I've maintained approver user in a custom field(user lookup) on my record. When I click on 'Submit for approval' from Sales portal it gets submitted successfully.

Problem : When I try to submit the 'same' record with a partner user from community portal, I get this error "another user recalled or responded to this request." 

Things that I have already tried:

1. Check if Approval process is active.

2. Check if Approver is active.

3. Create a fresh new record which is not submitted for approval yet. (Did not work for this either, No it was not already approved).

4. Logged in with the approver to check if he/she is able to access the quote record 'Read-Write'. (no sharing problem)

5. When I login as my user (Admin) to community and submit the record, Then I'm able to submit. (So, this cannot be community limitation either).

What am I missing??

Can anyone please help me here?

Thanks,

Priyal

 
4 réponses
  1. 3 août, 10:58

    Thanks for the direction,  Gustavo Silva . I checked your post, but still spent two days finding a solution! 

     

    For me, the Process Automation Settings for "Automated Process User Email Address" was still pointing to an old "No Reply" ID. When the org-wide address was removed/updated, it should have auto-updated to show or point to the latest one. That was my issue. 

     

    The case is now with Salesforce, and I'm hoping they can help by making the latest address available in the dropdown list — hopefully they can get this fixed. 

0/9000
I using mozilla firefox 66.0b5 (32-bit) version I add list button ( name of button : save) in list view. In Lightning I  select some records & then i am clicking save button but I am getting blank page after click save button. vf page action attribute onload not working in lightning but I am executing save button from classic it works properly. In google chrome working properly in lightning & classic side both. But in mozilla firefox 66.0b5 (32-bit) & (64-bit) not working.
  • Please refer following action attribute onload code : 

public PageReference createStandOpportunities()

    {

Set<String> numberSet = ParserHelper.getNumberSet();

List<Opportunity> insertOppList = getOpportunityList(numberSet);

        if(insertOppList.size() > 0){

          createOpportunities(insertOppList);           

        }

}

private List<Opportunity> getOpportunityList(Set<String> numberSet){

List<Opportunity> insertOppList = new List<Opportunity>();

for(String eachNumber : numberSet){              

                    Opportunity newOpp = new Opportunity();

                    newOpp.Name = 'Opp-'+eachNumber;                   

                    newOpp.Posted_Date__c = Date.today();

                    newOpp.Data_Id = eachNumber;

                    newOpp.StageName = 'Prospecting';

                    newOpp.CloseDate = Date.newInstance(2080, 1,1);

                    insertOppList.add(newOpp);               

            }

return insertOppList;

}

 private void createOpportunities(List<Opportunity> insertOppList){

try{

            if(!insertOppList.isEmpty()){

               insert insertOppList;

                System.debug('Opportunity inserted.....');

            }             

        }catch(Exception ex){

            System.debug('Ex = '+ex.getMessage()+ ' : '+ex.getLineNumber());

        }

}

 
1 réponse
  1. 6 févr. 2019, 10:59
           My Redirect code

            PageReference pageRef = new PageReference('/lightning/o/'+SOBJECT_TYPE_NAME+'/list?filterName=All');

            pageRef.setRedirect(true);   

            return pageRef;
0/9000
({

    doInit : function(component, event, helper) {

        

         /* Step 1*/

        var action=component.get('c.getContact');

        

        

        /*Optional*/  /* Step 1*/

        action.setParams({

            accountId : componenet.get

        });

        

         /* Step 4*/

        action.setCallback(this, function(response){

            var  responseValue =  response.getReturnValue();

            console.log('responseValue', responseValue);

            component.set('v.contactList',responseValue);

        },'SUCCESS');

        

         /* Step 3*/

        $A.enqueueAction(action,false);

    },

    doRedirect: function(component, event, helper){

        var events=event.getSource();

        var id=eventSource.get('v.name');

        alert(id);

    }

})

<aura:component controller="ContactList2"     

                implements="force:hasRecordId, flexipage:availableForAllPageTypes">

    <aura:attribute name="contactList" type="Contact[]"/>

    

    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>

     {!v.recordId}

    <div class="slds-p-around_xx-small">

    <aura:iteration items="{!v.contactList}" var="con">

        <lightning:card title="{!con.LastName}" footer="{!con.Email}" iconName="standard:contact">

            <aura:set attribute="actions">

                <lightning:button  name ="{!con.ID}" label="View Details" variant="brand" onclick="{!c.doRedirect}"/>

            </aura:set>

            <div class="slds-p-horizontal_xxx-small">

        {!con.FirstName} &nbsp;{!con.LastName} <br/>

        {!con.Email}  {!con.Phone}

                </div>

            </lightning:card>

    </aura:iteration>

    </div>

</aura:component>
4 réponses
  1. 19 juil. 2021, 04:25
    Hi Hemant,

    Please compare your code with 

    /*Optional*/ /* Step 1*/

    action.setParams({

    accountId : component.get('v.recordId')

    });

    if you need any assistanse, Please let me know!!

    Kindly mark my solution as the best answer if it helps you.

    Thanks

    Mukesh 
0/9000

Is there something I can add to my visualforce code to hide the Upload Files button. I made the relate list read only but that did not do anything #Visualforce  #Lightning Experience 

7 réponses
  1. 10 juil., 07:20

    If you have Files Related List on your page in Lightning Experience, then Upload File Button is governed by user permissions and not Visualforce. Having your Related List in ReadOnly mode will not hide this button. You might need to check for file upload permission, Page Layout, or think about custom implementation. If you have Files Related List on your page in Lightning Experience, then Upload File Button is governed by user permissions and not Visualforce. Having your Related List in ReadOnly mode will not hide this button. You might need to check for file upload permission, Page Layout, or think about custom implementation.  walmartgiftcard-balance com 

0/9000
How to make a group of button act as checkbox functionality with the changes in button color.
2 réponses
0/9000
Lightning SVG component not display in Internet Explorer 11?

I've starting not long ago development using AURA framework. One of the issues I have is that I can't "see" the SVG component (icon) in IE11 (Chrome and FireFox are fine, the component is explained everywhere on trailhead and blogs). I'm not sure whether IE11 can render the component, but I surely can see the sorting arrow (this is the one I was trying to dispaly) on Salesforce Lightning pages in Internet Explorer. My question is: what should I do to be able to render it in IE11?
4 réponses
  1. 21 juin, 06:03

    Great use case for automation. Similar logic can be useful in electricity billing systems, where customer categories or tariff types can be automatically assigned based on account information, reducing manual errors and improving accuracy. We use similar utility-related workflows at www.lesco.gov.pk.

0/9000