Skip to main content

Feed

Connect with fellow Trailblazers. Ask and answer questions to build your skills and network.
Hi Team

I have an application in Apex and Visualforce.

I would like to change an icon of my application from default HOME to my own icon.

How do I do this?

I tried installing the package "Custom Section Header Icon For VF Pages", still its not working, icon is not seen.

Thank you
3 answers
  1. Today, 5:26 AM

    Solution: Using Static Resources

    1. Upload Your Icon as a Static Resource
      • Go to Setup → Static Resources → Click New.
      • Upload your logo file (e.g., ayushLogo.png) and provide a Name (e.g., ayushLogo).
      • Click Save.
    2. Modify Your Visualforce Page 

      Add the following code to override the default header icon:

    <apex:page standardStylesheets="false" showHeader="true">

    <!-- Custom Section Header -->

    <apex:sectionHeader

    title="Your Application Name"

    subtitle="Your Subtitle"

    icon="{!URLFOR($Resource.ayushLogo)}"

    />

    <!-- Rest of your VF page content -->

    </apex:page>

0/9000
Hello,

 

I am wondering what I am doing wrong. I am trying to call a static image that I have uploaded in my salesforce instance from a visualforce page. However the image appears broken everytime. 

 

Can someone point me the right and most simple way to have an image displayed on my VF page? 

 

I am using the logic below. 

 

<img src="https://UrlForStaticImageIhaveUploaded" alt="" width="100" height="100"/>

 

I know this a developer question but I am having trouble logging into the developer success community for some reason. So just trying my luck here. 

 

 
4 answers
0/9000
Hi, i created a static resource to attach my logo in salesforce.then i copied the url and inserted in vf page .

i used the following code

<img src="https://ayush--recruitmen--c.visualforce.com/resource/1659528741000/ayushLogo?" style="width:250px;height:50px;" />.

My logo is not visible .it showing like this in preview . can anyone tell me why it is not visible. the image which i attached was jpeg format.

how to insert logo in vfpage?

thanks in advance
3 answers
  1. Aug 8, 2022, 9:33 AM
    Hi Suji,

    Please follow below concepts

    apex:image A graphic image, rendered with the HTML <img> tag.

    Example

    <apex:image id="theImage" value="/img/myimage.gif" width="220" height="55"/>

    The example above renders the following HTML:

    <img id="theImage" src="/img/myimage.gif" width="220" height="55"/>

    Resource Example

    <apex:image id="theImage" value="{!$Resource.myResourceImage}" width="200" height="200"/>

    The example above renders the following HTML:

    <img id="theImage" src="<generatedId>/myResourceImage" width="200" height="200"/>

    Zip Resource Example

    <apex:image url="{!URLFOR($Resource.TestZip, 'images/Bluehills.jpg')}" width="50" height="50" />

    The example above renders the following HTML:

    <id="theImage" src="[generatedId]/images/Bluehills.jpg" width="50" height="50"/>

    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

Of course. Here is a clear and concise description you can post to the Salesforce Trailhead community to ask your question.

Title: How does a Salesforce Agent access parameters passed from an Apex Invocable Action?

Hello Trailblazer Community,

I am looking at the Salesforce example code for invoking an agent from Apex, as provided in this article: Invoke a Custom Invocable Action from Apex.

The example code demonstrates how to pass parameters to the agent, like a userMessage and a CaseId:

// This is the example code from the Salesforce documentation

public class AgentIAInvoker {

public static void invokeJavaAction() {

try {

Invocable.Action action = Invocable.Action.createCustomAction('generateAiAgentResponse', 'Agentforce_Service_Agent_new');

action.setInvocationParameter('userMessage', 'Summarize my case');

action.setInvocationParameter('CaseId', '500VW0XXXXXXXXXXXX');

List<Invocable.Action.Result> results = action.invoke();

Invocable.Action.Result result = results[0];

if (result.isSuccess()) {

System.debug('Output Session Id: ' + result.getOutputParameters().get('sessionId'));

System.debug('Output Agent Response: ' + result.getOutputParameters().get('agentResponse'));

} else {

System.debug('Java action execution failed: ' + result.getErrors());

}

} catch (Exception e) {

System.debug('Error invoking Java action: ' + e.getMessage());

}

}

}

My question is: Once the CaseId is passed to the 'Agentforce_Service_Agent_new' agent, how does the agent actually access or use this value?

For example, how can I reference this incoming CaseId within the agent's prompt template or pass it to a tool that the agent uses? I'm trying to understand the mechanism within the Agent Builder for receiving and utilizing these parameters from an invocable action.

Any guidance or examples would be greatly appreciated!

Thank you. 

 

 

#Agentforce  #Salesforce Developer

1 answer
  1. Today, 5:18 AM

    Hi @lokesh singh thakur bondili

     

    Thank you for your question! Based on my understanding, you're asking how the CaseId passed to the Agentforce_Service_Agent_new agent can be accessed and utilized within the agent's prompt template or for passing it to a tool. Please correct me if I misunderstood. 

     

    In Agentforce, any variables declared as "Available for output" in an invocable action can be accessed within the Agent Action Builder. Here’s how you can use the CaseId: 

     

    Displaying the CaseId in the Agent Window: In the Agent Action Builder, you can enable the "Show in conversation" option for the CaseId variable. This will display the CaseId directly in the agent window, making it visible to the user. 

     

    Referencing the CaseId in a Prompt Template: To use the CaseId in a prompt template, you can reference it using the variable name. For example, if the variable is named CaseId, you can include it in your prompt like this: "Your case has been created successfully. The Case ID is {{CaseId}}." 

     

    Passing the CaseId to a Tool: If you want to pass the CaseId to a tool or another action, you can map the output variable (CaseId) from the invocable action to the input of the tool or action in the Agent Action Builder. 

     

    For example, let’s say a customer creates a case using the agent. The CaseId generated by the backend action can be returned to the customer as confirmation. Later, if the customer wants to check the status of their case, the agent can prompt them to provide the CaseId as a unique identifier to retrieve the case details. 

     

    I hope this clarifies your question! Let me know if you need further assistance.

0/9000

お世話になっております。 

初歩的なことかと思うのですが、お助けいただけましたら幸いです。 

 

新たにプロファイルを作成し、ログインしてみたところカスタムオブジェクトのレコードが一つも表示されない状況となっております。 

 

以下のように新たにプロファイルAを作成いたしました。 

ユーザーライセンス:

Salesforce Platform 

・既存プロファイル:標準Platformユーザー 

 

カスタムオブジェクトB権限は[すべてのレコードの参照][参照][作成][編集]となっており、カスタムオブジェクトB以外はチェックがついておりません。 

 

組織の共有設定は以下となっております。 

カスタムオブジェクトB 

デフォルトの内部アクセス権:公開/参照・更新可能 

デフォルトの外部アクセス権:非公開 

 

システム管理者Cでログインして、レコードが存在していること 

ユーザーでログインして、カスタムオブジェクトのリストビューがすべてのレコードになっていることは確認いたしました。 

レコード所有者はシステム管理者Cとなっております。 

 

何かお気づきの点がありましたら、ご教示いただけましたら幸いです。 

どうぞよろしくお願いいたします。 

 

 

4 answers
  1. Today, 5:14 AM

    @Takaaki Motohashi

     

    すみません、ありがとうございます。 

    解決いたしました。 

     

    リストビューがわたしのxxとなっており、管理者側で所有者を「すべてのxx」に変更したら、ユーザー側で表示されました。 

    大変初歩的なご質問となってしまいました、、ご教示いただきありがとうございます。

0/9000

Been reading about how everyone is having trouble with the "Add and Map a Formula Field" module; I am, too. This is frustrating. I've tried creating new Dev playgrounds as well. I've followed every step exactly as instructed. 

 

#Trailhead Challenges  #Trailhead

4 answers
  1. Today, 5:13 AM

    Hi @KEERTHI POTLAPALLI - I am facing the same issue. I have also created new Dev playgrounds and followed every step exactly as instructed. Still the issue persists. Raised case  on 17th June but haven't heard anything back. Now, My org also got expired. This is really disappointing. 

0/9000
Hello,

I am trying to add a logo to the top of a Visualforce PDF. I was originally able to do this using 

 <center><apex:image url="{!$Resource.PM_Invoice}" width="300" height="150"/></center>

However I now need the logo to show based on the logo on the Customer Account - as we use this PDF to generate orders for 2 clients.

I have created a custom URL field on the Account (Logo_URL__c) and a second field Logo Image with the formula below:

IF(LEN(Logo_URL__c)=0,"", IMAGE(Logo_URL__c,"Company Logo"))

This shows the logo on the accounts.

I have then referenced both these fields in my Apex Class Controller.

I am now struggling to get the logo to show on the invoice - I have tried using many variations of the below

<center><apex:image url="{!accountDetails.Logo_URL__c}" width="300" height="150"/></center>

and each time just have a greyed out box where the logo should show.

Does anyone have any ideas?

Thanks,

Kelsey

logo on Visualforce PDF

 
6 answers
  1. Today, 5:12 AM

    Hi Everyone, try this 

     

    <div class="header" style="text-align: center;">

    <img

    src="{!$Resource.ayushLogo}"

    alt="Company Logo"

    style="width: 25%; max-width: 200px; height: auto;"

    >

    </div>

0/9000

I want to clone OLIs before the decomposition start. It will happen if few of the product attribute conditions satisfied.

The product can be cloned upto maximum of 7-10 OLIs

What would be the ideal way to implement it?

#Trailhead #New Releases
2 answers
  1. Divya Chauhan (Kcloud Technologies) Forum Ambassador
    Today, 5:10 AM

    Hello @Kawal Kaur

     

    To clone OLIs(OpportunityLineItems) before decomposition based on product attribute conditions, follow this approach: 

    1 .Use a Before Insert/Update Trigger on OpportunityLineitem.  

    2. Chethe ck product attribute condition in the trigger logic. 

    3. Clone logic :Use.clone(false,true) to deep clone the OLI.  

    4. Limit clones: Add logic to restrict cloning to a maximum of 7-10 OLIs. 

    5 . Insert cloned OLIs before the decomposition logic runs. 

     Refer below sample code- 

    if(shouldClone && cloneCount <10){ 

    OpportunityLineItem newOLI=oldOLI.clone(false,true); 

    newOLI.OpportunityId=oldOLI.OpportunityId; 

    toInsert.add(newOLI); 

    }

0/9000

Hi everyone, trailblazers! I'm Italian and I'm preparing for the Marketing Cloud Administrator Email Specialist. I hope to take it by next month. Is there anyone who wants to join me?

#Trailhead #Marketing Cloud #Automation
1 answer
0/9000

We're trying to activate a held subscriber after their email bounced 4 times. I've tried unsubscribing the contact so that I can activate them, but the contact stays greyed out. Are there any reasons why we wouldn't be able to activate a subscriber? Could it be a setting on our side, or something on the subscriber's side? Thanks! 

2 answers
  1. Today, 5:02 AM

    Yep, I’ve worked with a couple of setups like that, and getting Paychex to push project-level payroll expense detail into QBO isn’t totally straightforward, but it can be done, with caveats. 

     

    Out of the box, Paychex doesn’t support native integration that maps expense lines directly to QBO Projects. In the past, we've built an intermediate step using a custom export from Paychex (you can usually get department/job-level splits if you ask them to turn on the GL mapping by labor codes). From there, we used a third-party tool for data integration to automate the transformation and load it into QBO as journal entries with the correct project tags. 

     

    The key is consistent mapping between Paychex job codes and QBO Project names.

0/9000