Skip to main content

#Salesfoce Developer토론 중인 항목 0개

Surya Rao (NTT Data) 님이 #Salesforce Developers에 글을 올렸습니다

Hello Experts,

 

I need your support on below issue.

I have filed on opportunity, where the input should flow from a trigger which is written on contentdocument link. If an opportunity holds a document on it the filed has to be cheked-in else blank(default value).

 

We have a trigger which is not working... could someone can help on this..

--------------------------------------------------

trigger ContentDocsLinkStatusUpdate on ContentDocumentLink (after insert, after update) {

 Set<Id> opportunityIdsToUpdate = new Set<Id>();

    for (ContentDocumentLink cdl :Trigger.new){

        if (cdl.LinkedEntityId.getSObjectType() == Opportunity.SObjectType){

            opportunityIdsToUpdate.add(cdl.LinkedEntityId);

        }

    }

    

    if (!opportunityIdsToUpdate.isEmpty()){

        List<Opportunity> opportunitiesToUpdate = [

            Select Id, Has_File__c,  

            (Select ContentDocumentId FROM ContentDocumentLinks WHERE LinkedEntityId = : opportunityIdsToUpdate)

                                                   FROM Opportunity WHERE Id IN : opportunityIdsToUpdate];

      

    for (opportunity opp : opportunitiesToUpdate){

        for(Opportunity ID :trigger.new){

        If(opp.Id !=null){

            Id.Has_Attachment__c = True;

        }

        else{

            Id.Has_Attachment__c = false;

        }    

    }

        update opportunitiesToUpdate;

    }

 }

}

     ---------------------------------------------------------------------------------------- 

 

#Salesforce Developers  #Salesfoce Developer

 

#Trailhead

 

#Sales Cloud #Service Cloud  #Apex

0/9000
sanskruti gudadhe 님이 #Salesforce Developer에 질문했습니다

Hi,

 

Can you help me in creating a flow. I want to create a flow which counts the total number of activities in the contact. 

 

I have created last activity date flow. Is it possible if I can create total activity flow in that only?

 

Thanks

 

#Salesforce Developer  #Salesforce Developers  #Salesfoce Developer  #Developer Forums

답변 3개
  1. 2025년 7월 19일 오전 6:23

     Yes, you can add a total activity counter to your existing flow. Just update it to increment a custom field each time a new activity is logged. Let me know if you need help setting it up! 

0/9000
sanskruti gudadhe 님이 #Salesforce Developers에 질문했습니다

Hi everyone,

 

I'm trying to add the price book in my products. But looks like first we need to create a standard price and then add to price book.

Why we need these two?

Is there anyway we can keep only one?

 

Confused between standard price book and add price book.If i delete the product sample, the product doesn't display in Product list. 

Is there anyway?

Also can we set standard price book default to zero?

 

Thank you in advance.

 

#Salesforce Developers  #Salesfoce Developer  #Developer Forums

답변 3개
  1. 2024년 5월 30일 오전 10:20

    Hi Sanskrut,

     

    Standard Price Book gets all the products you enter. For example, you have two completely different product lines, so you create to custom price books because those products will never cross over. The Standard Price Book will get all the products you enter...kind of a master list.

     Whenever I deal with multiple price books I always will make the Standard Price Book inactive. That way no one can use it on Opportunities.

     You cannot have more than one Is Standard Pricebook.

     For your scenario create two Price Books. One for each country. Then, as you wrote, make the Standard Price Book inactive and the other two active.

    https://salesforce.stackexchange.com/questions/194606/standard-vs-standard-price-book

    Thanks 

    Anand

0/9000
0/9000

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

素人質問で大変恐縮なのですが、SFが受信側だった場合に外部からRESTを経由してリクエストを受信する際は

@RestResourceアノテーションを利用したクラスを用意する以外に方法はありますでしょうか?

その他の方法が調べても出てきませんでしたので有識者の方にご教授をいただきたく存じます。

よろしくお願い申し上げます。

답변 4개
  1. 2024년 5월 14일 오전 3:32

    @Iori Koyama さん

     

    情報を返すだけでなくて、何らかの更新もできるREST APIは複数あると思います。

     

    厳密にはレコードでなくて、レポートなどのメタデータの操作ですが...

     

    Salesforce Reports and Dashboards REST API

     

    ナレッジの操作

    Knowledge REST API

0/9000

Do you use Static Resources in SF? If yes, how do you update this ahead of the redirection of force.com?

 

Thank you!

답변 4개
  1. 2024년 4월 26일 오후 6:38

    Hi @Eric Burté and @Divya Chauhan

    Thank you for the resources.

     

    I have tested using the actual URL that is given from Static Resources after the file is saved by adding it to a template that we use to send invoices/receipt. When I tested this, the link did not render the image, instead just a red X box. 

    So, I updated the start of the link with my enhanced domain name followed by /resource/ID/filename (the last portion from the Static Resource file location. 

     

    When you upload an image to Static Resource, did you use the exact URL it is generated when using the file elsewhere?

0/9000

I see that this is very reoccurring question with a plethora of solutions. The most simplest solution I've come across is here. However, this solution invokes the pop-up modal in an Aura button (not custom record button or overriding a standard button). 

 

Overall, I just want native/custom buttons on record pages and related lists to open LWCs and Flows in a pop-up modal. 

 

I've attempting to create a repeatable solution where devs can  pass in their Flow API Name and inputs like recordId into an Aura component, which then passes that information into an LWC (just link in the shared link). However, it fails at passes null as recordId. At the same time, the modal pops-up in a different screen

 

#Salesforce Developers  #Salesfoce Developer  #Developer Forums  #Platform Developer II

0/9000
답변 2개
  1. Divya Chauhan Forum Ambassador
    2024년 4월 11일 오후 12:15
0/9000

Hi All,

 

I'm trying to create a LWC component which will show CRUD Matrix(i.e. which object has which permission for each profile), check image for more details.

 

Unable to show sobject name in LWC tableFor some reasons, i'm not able to see Object name and Profile name.

Below is the code:

HTML:

<template>

    <div >

        <template if:true={matrixList}>

             <lightning-datatable

                     key-field="id"

                     data={matrixList}

                     columns={columns}>

             </lightning-datatable>

             

        </template>

        </div>

</template>

JS:

import { LightningElement,api,track,wire } from 'lwc';

import getMatrix from '@salesforce/apex/CrudMatrixCls.getMatrix'

export default class CRUDMatrix extends LightningElement {

    @track columns = [

        { label: 'ObjectName', fieldName: 'sObjectType'},

        { label: 'ProfileName', fieldName: 'Parent.Profile.name'},

        { label: 'Create', fieldName: 'PermissionsCreate',type: 'text'},

        { label: 'Read', fieldName: 'PermissionsRead',type: 'text'},

        { label: 'Edit', fieldName: 'PermissionsEdit',type: 'text'},        

        { label: 'Delete', fieldName: 'PermiPermissionsDelete',type: 'text'},

        { label: 'ModifyAll', fieldName: 'PermissionsModifyAllRecords',type: 'text'},

        { label: 'ViewAll', fieldName: 'PermissionsViewAllRecords',type: 'text'}

        

    ];

   @track matrixList;

    @wire(getMatrix) wiredMatrix({data,error}){

        if(data){

            this.matrixList=data;

            console.log(data);

        }

        else if(error){

            console.log(error);

        }

    }

}

Class:

public with sharing class CrudMatrixCls {

    @AuraEnabled(cacheable=true)

     public static List<ObjectPermissions> getMatrix() {

     return [SELECT sObjectType, Parent.Profile.Name,Parent.ProfileId, PermissionsCreate, PermissionsRead, PermissionsEdit, PermissionsDelete, PermissionsModifyAllRecords, PermissionsViewAllRecords FROM ObjectPermissions where Parent.Profile.Name != null order by sObjectType];

     }

}

 

 

#Salesfoce Developer

답변 5개
0/9000

Hi everyone.

Lead ConvertI have a requirement that is 

1. If the record type is A and there is no ID filled in the data then it shouldn't convert the lead and throw an error. 

2. The default value of the record type should be B. 

 

Can you help me with it, I'm new to salesforce.

 

Thank you.

 

#Salesfoce Developer

답변 6개
0/9000