• Sanjana Rajasekar
  • NEWBIE
  • 20 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 1
    Likes Given
  • 11
    Questions
  • 7
    Replies

Hi, I am working on a 3 step approval Process Where User's Manager will Approve the Record. The Process works If the Lower level role User has Manager and If It doesnt have Manager, It shows error  "This approval request requires the next approver to be determined by the Manager field"
Now the Issue is, If one of USER A submits the record for Approval, It's manager is CEO who is top of the role and will never have manager. The  ceo user should approve and the approval process should stop at that step.
In my case, It is throwing the above error If Ceo approves.
 
Need some guidance to overcome this issue.
 
Thanks In Advance!
Hi ,
I have a case records with status as Resolved. The Last modified date is captured as we change the status. Considering this dateTime field, I need to run a schedule flow to update the status as Closed automaticaly after 3 business days from the Resolved status.

Formula of type Number  : NOW() - record.lastmodified date 
This will return number and check if greater than 3,and updateto  closed. But this is considering weekends.
How can I achieve this considering Business Days.
Thanks in Advance!
Hi , I have a usecase where If Sales Agreement record is edited, Its related Opportunity is Closed Won and Sales agreement  type is 'New Business' . Should prevent users to add products.

I tried this, But this Validation throws message If it Creating Sales agreement record.
AND(

ISPICKVAL( SalesAgreement.Sales_Agreement_Type__c , 'New Business'),
ISPICKVAL( SalesAgreement.Opportunity__r.StageName ,'Won' ),
NOT(ISNEW()),
NOT(ISBLANK( PricebookEntry.Product2.Name ))
)
Hi , I am using a batch class. I need to get the size of the records processed in a variable after all batches in finish method.  I dont want to use Database.stateful because I am hitting Batchable instance is too Big.
https://help.salesforce.com/s/articleView?id=000383707&type=1
Is there any other way we can Achieve it?

Thanks 
Hi,
How we pass record collection variable from LWC to Flow Collection Variable?
I have array of collection defined in LWC.
[{"Qty":"1","Id":"01u0P00000kjd8vQAA","Level":4},{"Qty":"4","Id":"01u520000090pFoAAI","Level":4}]
 
Need to pass this collection to Flow variable.
I added this in xml
        <property name="editableproductstoflow
" type="{T[]}" label="Passing Records to Flow" role="outputOnly" />
Js File
Hi,
I have created a screen flow with picklist field "Schedule Frequency" 
and a number field "Schedule Count"
The Picklist has options : Weekly, Monthy , Yearly , One-Time
When the user select One-Time , Schedule count should be always one.
How could I validate the Schedule Count field? 
User-added image
I came across Mass Update Account Forecasts Actions (https://help.salesforce.com/s/articleView?id=sf.admin_manufacturing_standard_invocable_actions.htm&type=5) which updates multiple values of a single metric of an account forecast.

So I am trying to update the last year's order quantity metric for a product on particular period in account forecast by a flow.

Error Occurred: Unexpected data type for periods: expected String[]

Able to get the records using the query but I am not able to view the PeriodIds in the UI.
 
SELECT Id, AccForecastPeriodMetricId, AccountProductForecastId, Name, PeriodId, PastOrdersQuantity
From AccountProductPeriodForecast
WHERE AccountProductForecastId = '0yB3t000000gGEKEA2'

 
I have Custom Object "Work_Order__c" . I want to send a email when the value field in this Object changed. How can I use 
Work_Order__c__History in the template.
And If the old value and updated value is not same , I need to highlight in red color.


<messaging:emailTemplate  recipientType="Contact" relatedToType="Work_Order__c">
<messaging:HtmlEmailBody >

<apex:outputPanel rendered="{!relatedTo.Job_Name_Text__c!= NULL}">
    <apex:outputLabel value="Job Name: " /> 
<font color="{!IF((relatedTo.Work_Order__c__History[0].OldValue.Job_Name_Text__c != relatedTo.Work_Order__c__History[0].NewValue.Job_Name_Text__c), 'red', 'black')}">
    <apex:outputText  value="{!relatedTo.Job_Name_Text__c}" />
    </font>
</apex:outputPanel> 

</messaging:HtmlEmailBody>
</messaging:emailTemplate>
I am trying to add a validation rule which says
User shouldn't be allowed to add Products in Sales Agreement Object that created from Closed won opportunity and Sales Agreement type = Commerical SA
 
How can I export all files available in org. Right now the export now option in Data Export is greyed out and will be available only after 48 hours from previous export. 
By Data Loader, It allows to export data from the org, in case exporting attachments user will be able to get as CSV file but no real attachments will be downloaded.

Is there any tool that exports include attachments files. Will Workbench helps ?
Thanks in Advance!

 
I have Created a Visual Force Page. When I preview it I could see the what I have created. I am trying to use the VF page to NodeJs .Wanted to see the same functionality in local server. I created a server running on port 3000. When I run the server, the page keeps on loading. Can someone help what is wrong in my code? Thanks in advance.
app.js
const express = require('express')
const jsforce = require('jsforce')
var fs = require('fs');
require('dotenv').config()
const app = express()
const PORT = 3000
const {SF_LOGIN_URL,SF_USERNAME,SF_PASSWORD,SF_TOKEN} = process.env
const conn = new jsforce.Connection({
    loginUrl : SF_LOGIN_URL
})
conn.login(SF_USERNAME,SF_PASSWORD+SF_TOKEN,(err, userinfo)=>{
if(err){
    console.log(err)
}else{
    console.log("user id : "+userinfo.id)
    console.log("Org id : "+userinfo.organizationId)
}
})
app.get('/',(req,res)=>{
    fs.readFile('./index.html', function (err, html) {
        if(err){
            console.log('Script Error'+err)
        }else{
            res.write(html);  
        }
       
    })
 
 
   
})
app.listen(PORT,()=>{
    console.log(`Server is Running at http://localhost:${PORT}`)
})
index.html
<script src="https://wellcorp--n28hcdev.sandbox.lightning.force.com/lightning/lightning.out.js"></script>
 
  <script>
    $Lightning.use("c:SchedulerApp",
        function() {                  // Callback once framework and app load
            $Lightning.createComponent(
                "c:SchedulerCmp",    // top-level component of your app
                { },    // attributes to set on the component when created
                "lexcontainer",    // the DOM location to insert the component
                function(component) {            // API name of the Flow
                   
                }
            );
        },    'https://wellcorp--n28hcdev.sandbox.my.salesforce.com/'  // Site endpoint
    );
</script>
Hi,
How we pass record collection variable from LWC to Flow Collection Variable?
I have array of collection defined in LWC.
[{"Qty":"1","Id":"01u0P00000kjd8vQAA","Level":4},{"Qty":"4","Id":"01u520000090pFoAAI","Level":4}]
 
Need to pass this collection to Flow variable.
I added this in xml
        <property name="editableproductstoflow
" type="{T[]}" label="Passing Records to Flow" role="outputOnly" />
Js File

Hi, I am working on a 3 step approval Process Where User's Manager will Approve the Record. The Process works If the Lower level role User has Manager and If It doesnt have Manager, It shows error  "This approval request requires the next approver to be determined by the Manager field"
Now the Issue is, If one of USER A submits the record for Approval, It's manager is CEO who is top of the role and will never have manager. The  ceo user should approve and the approval process should stop at that step.
In my case, It is throwing the above error If Ceo approves.
 
Need some guidance to overcome this issue.
 
Thanks In Advance!
Hi ,
I have a case records with status as Resolved. The Last modified date is captured as we change the status. Considering this dateTime field, I need to run a schedule flow to update the status as Closed automaticaly after 3 business days from the Resolved status.

Formula of type Number  : NOW() - record.lastmodified date 
This will return number and check if greater than 3,and updateto  closed. But this is considering weekends.
How can I achieve this considering Business Days.
Thanks in Advance!
Hi,
I have created a screen flow with picklist field "Schedule Frequency" 
and a number field "Schedule Count"
The Picklist has options : Weekly, Monthy , Yearly , One-Time
When the user select One-Time , Schedule count should be always one.
How could I validate the Schedule Count field? 
User-added image
I came across Mass Update Account Forecasts Actions (https://help.salesforce.com/s/articleView?id=sf.admin_manufacturing_standard_invocable_actions.htm&type=5) which updates multiple values of a single metric of an account forecast.

So I am trying to update the last year's order quantity metric for a product on particular period in account forecast by a flow.

Error Occurred: Unexpected data type for periods: expected String[]

Able to get the records using the query but I am not able to view the PeriodIds in the UI.
 
SELECT Id, AccForecastPeriodMetricId, AccountProductForecastId, Name, PeriodId, PastOrdersQuantity
From AccountProductPeriodForecast
WHERE AccountProductForecastId = '0yB3t000000gGEKEA2'

 
How can I export all files available in org. Right now the export now option in Data Export is greyed out and will be available only after 48 hours from previous export. 
By Data Loader, It allows to export data from the org, in case exporting attachments user will be able to get as CSV file but no real attachments will be downloaded.

Is there any tool that exports include attachments files. Will Workbench helps ?
Thanks in Advance!

 
We are facing an issue with respect to Health Cloud package for Registration API. Whenever we hit the Registration API, we insert a household account, contact, user and the Account Contact Relationship. While we insert account/contact using Registration API in the scope of Guest User we encounter the below error:

You don't have the level of access required to complete this action. Please contact your administrator for help.

We didn’t found any documentation associated with this trigger implementation. We have provided all object access, FLS for account, contact objects, Access to API for guest user. Also, the error message generated is not due to custom code of Registration API but from the code in HealthCloudGA.AccountTrigger.
 
We have a custom Object "Vendor Contract", We want to send a email alert when the value field in this Object changed.
When doing the VisualForce email template, we want to show the value changed from the OLD Value to New Value.
But when I use "Vendor_Contract__History", it says "Error: Invalid field Vendor_Contract__History for SObject Vendor_Contracts__c"

My Code is down below:
<messaging:emailTemplate subject="Vendor Contract {!relatedTo.Name} requires Approval" 
    recipientType="User" 
    relatedToType="Vendor_Contracts__c">

    <Messaging:htmlEmailBody >
        <html>
            <style type="text/css">
            body {font-family: Calibri; size: 12pt;}
            th {
            font-size: 10pt;
            border: solid;
            border-color: #FF8C00;
            border-width: 0.5px; 
            }
            
            td {
            font-size: 10pt;
            border: solid;
            border-color: #FF8C00;
            border-width: 0.5px;
            text-align: center;
            }
            
            tr {
            border: solid;
            border-width: 20px;
            vertical-align: top;
            text-align: left;
            width: 400px;
            }
            
            </style>
            <body>

            <p>Dear {!recipient.name},</p>
            The following Vendor Contract {!relatedTo.name} has a value change.<br/>
            Below is the information of the Contract.<br/>
            <br/>
            Period: From&nbsp;<apex:outputText value="{0, date, dd MMM yyyy}"><apex:param value="{!relatedTo.Start_Date__c}"/></apex:outputText>&nbsp;To&nbsp;<apex:outputText value="{0, date, dd MMM yyyy}"><apex:param value="{!relatedTo.End_Date__c}"/></apex:outputText><br/>
            <br/>
            Account: {!relatedTo.Account__r.Display_Name__c}<br/>
            <br/>
            Budget: {!relatedTo.Budget__r.Name}<br/>
            <br/>
            Contract Value: &nbsp;<Apex:outputText value="{0, number, currency}"><apex:param value="{!relatedTo.Contract_Value__c}"/></Apex:outputText><br/>
            <br/>
            Budget Remaining: &nbsp;<Apex:outputText value="{0, number, currency}"><apex:param value="{!relatedTo.Estimated_Budget_Remaining__c}"/></Apex:outputText><br/>
            <br/>
            <table border="0" >
                <tr>
                    <th>Description</th><th>New Value</th><th>Old Value</th>
                </tr>
                <apex:repeat var="vcl" value="{!relatedTo.Vendor_Contract__History}">
                <tr>
                    <td width="170">{!vcl.Line_Description__c}</td>
                    <td width="330"> New Value
                    <td width="80"> Old Value
                    </td>
                </tr>
                </apex:repeat> 
            </table>
            <br/>
            You can click the link below to get to the contract detail page to see more details<br/>
            <apex:outputLink Value="{!LEFT($Api.Partner_Server_URL_140,FIND('.com',$Api.Partner_Server_URL_140)+4)+relatedTo.ID}">{!relatedTo.Name}</apex:outputLink><br/>
            

            Kind regards,<br/>
            {!relatedTo.CreatedBy.Name}
                                 
            </body>
        </html>
      
    </Messaging:htmlEmailBody>

</messaging:emailTemplate>


 
The following formula will calculate the number of working days (inclusive) between 2 dates. A working day is defined as Monday to Friday. Even if the start or end dates are a weekend, these are accommodated.

IF(AND((5 - (CASE(MOD( Start_Date__c - DATE(1900, 1, 6), 7), 0, 0, 1, 5, 2, 5, 3, 4, 4, 3, 5, 2, 6, 1, 0)) < (CASE(MOD(  End_Date__c  - DATE(1900, 1, 6), 7), 0, 0, 1, 0, 2, 1, 3, 2, 4, 3, 5, 4, 6, 5, 0)) ),
((( End_Date__c  -   Start_Date__c ) + 1) < 7)),
((CASE(MOD(  End_Date__c  - DATE(1900, 1, 6), 7), 0, 0, 1, 0, 2, 1, 3, 2, 4, 3, 5, 4, 6, 5, 0)) - (5 - (CASE(MOD(  Start_Date__c  - DATE(1900, 1, 6), 7), 0, 0, 1, 5, 2, 5, 3, 4, 4, 3, 5, 2, 6, 1, 0)))),
(((FLOOR((( End_Date__c  -  Start_Date__c ) - (CASE(MOD(  Start_Date__c  - DATE(1900, 1, 6), 7), 0, 0, 1, 6, 2, 5, 3, 4, 4, 3, 5, 2, 6, 1, 0))) / 7)) * 5) +
(CASE(MOD(  Start_Date__c  - DATE(1900, 1, 6), 7), 0, 0, 1, 5, 2, 5, 3, 4, 4, 3, 5, 2, 6, 1, 0)) +
(CASE(MOD(  End_Date__c  - DATE(1900, 1, 6), 7), 0, 0, 1, 0, 2, 1, 3, 2, 4, 3, 5, 4, 6, 5, 0))))


The Start Date and End Date fields are custom in the above example and can be replaced as required. If use of a DateTime field is required then the DATEVALUE function will be required.

I also recommend a simple field validation rule is added to check that the End Date is after the Start Date.
  • January 05, 2009
  • Like
  • 9