• AthiSachi
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 21
    Replies
Hello all,

 My process builder autocreates an custom object which has lookup relationship. I am trying to populate that relation field with another text field(which hold record Id) using formula . however I get above error message?
How would I update lookuprelationship field  from text field

Thanks
Athi
Hello All,
It is related to below critical update

https://help.salesforce.com/articleView?id=000273124&type=1&language=en_US

It impacted our org with third party integration(C&P Temporary contact processing). In our org, Campaign OWD is private and it became unavailable for guest user after this update. After enabling campaign sharing rules for guest user, that part worked fine. 
However non admin user couldn't process temp contacts. C&P claims its not their issue and we were asked to contact saleforce. 
Now we wonder non-admins can't view guest user records.
My question here is What are all the permission removed during this critical update? Whether non-admins had access to guest user records before this critical updates and now is it removed ?
Little confused on this part. Any info please.
Hi all,
Long story short, In order to avoid bulkification in code, I am trying to send list of Ids to invocable method to read values from opportunity table.
Now comes another challenge,  Invocable method takes only list string and flow input variable only pass single paramter. 
I have list of ids as collection variable as well as concatenated string. I passed concatenated string to List of string input parameter. But that didn't work. Please help me how to pass the input in my scenario?

global class LookupOpp {


   @InvocableMethod

public static List<List<Opportunity>> getOppIds(List<String>Ids) {

      List<Opportunity> Opps = [SELECT Id,GiGis_Opportunity_Posted__c FROM Opportunity WHERE Id in :Ids];
     
  
          List<List<Opportunity>> listOfOpps = new List<List<Opportunity>>();
             System.debug('Map Opportunity Size '+ listOfOpps.size());
            System.debug('=== contents of opptymap: ' +listOfOpps);

      listOfOpps.add(Opps);
      return listOfOpps;
 
   }
}
We are using DLRS tools and has many roll up summary set up in calculatation mode. Lately we found out that Lookup Rollup Summary Schedule Items occupy lot of storage. Its a know issue in Github. However It is little confusing and follow the instruction mention there.  How should I cleanup existing and avoid table usage in future. Thanks for your help in advance.
Client want mass change on button click. There are some condition to check on selected records.
Example: If user select 100 records and click button,  it has to check if email is not null  and one more. Both are rollup fields. If any of that 2 fields empty, I want to let the user know and use appropriate view. Because in SF button is available in all list view.If i can make button visible to specific list view, my problem solved. unfortunately thats not that option right now. I need to restrict the user from using other view.
 I used andrew logic in below link and works perfectly .
https://andyinthecloud.com/2015/12/12/visual-flow-with-list-view-and-related-list-buttons/

Here comes the problem, flow couldnt take null value and throwing error. I tried to set the value to "not set"  in visualforce page, but i dont seem working. I tried debug log but in vien.


<apex:page standardController="Contact" tabStyle="Contact" recordSetVar="AllC" >
<!-- Add below each field you reference in your Flow -->
<apex:repeat value="{!AllC}" var="row"  rendered="TRUE">
{!row.Id}
{!IF(ISBLANK(row.Parent_Email__c), 'Not Set',row.Parent_Email__c) } </apex:repeat>
<!-- Runs your Flow -->
<flow:interview name="EmailToContacts" finishLocation="{!$CurrentPage.parameters.retURL}">
 <apex:param name="CVarCon" value="{!Selected}"/> </flow:interview> </apex:page>

This line not working 
{!IF(ISBLANK(row.Parent_Email__c), 'Not Set',row.Parent_Email__c) }

My expectation is: email set to "Not Set" so flow wont throw error and i can also check condition for "Not Set" and warn user to use appropriate view. OR I would like to throw error in visual page itself, that would be perfect.
I am stuck here. Please help.
 
Hello all,

 My process builder autocreates an custom object which has lookup relationship. I am trying to populate that relation field with another text field(which hold record Id) using formula . however I get above error message?
How would I update lookuprelationship field  from text field

Thanks
Athi
Hi all,
Long story short, In order to avoid bulkification in code, I am trying to send list of Ids to invocable method to read values from opportunity table.
Now comes another challenge,  Invocable method takes only list string and flow input variable only pass single paramter. 
I have list of ids as collection variable as well as concatenated string. I passed concatenated string to List of string input parameter. But that didn't work. Please help me how to pass the input in my scenario?

global class LookupOpp {


   @InvocableMethod

public static List<List<Opportunity>> getOppIds(List<String>Ids) {

      List<Opportunity> Opps = [SELECT Id,GiGis_Opportunity_Posted__c FROM Opportunity WHERE Id in :Ids];
     
  
          List<List<Opportunity>> listOfOpps = new List<List<Opportunity>>();
             System.debug('Map Opportunity Size '+ listOfOpps.size());
            System.debug('=== contents of opptymap: ' +listOfOpps);

      listOfOpps.add(Opps);
      return listOfOpps;
 
   }
}
We are using DLRS tools and has many roll up summary set up in calculatation mode. Lately we found out that Lookup Rollup Summary Schedule Items occupy lot of storage. Its a know issue in Github. However It is little confusing and follow the instruction mention there.  How should I cleanup existing and avoid table usage in future. Thanks for your help in advance.
Hi!

I have built a visual flow and hosted it on a public Force site (guest user is called "Teacher Profile").

The guest user has CREATE, READ and EDIT access to the custom object referred by the flow.

The guest user also has read and edit access to any field of the custom object.

When I run the flow, I keep getting the following error and I can't figure out why:

Error element Migrate_form_to_SF (FlowRecordCreate).
This error occurred when the flow tried to create records: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY: insufficient access rights on cross-reference id.


I understand this is about permissions, but again the guest user has permissions to all the fields listed in "Migrate form to SF".

thank for your help.
Stefano
I have a pretty simple process that is throwing an error when I try to use data loader or the data import wizard to add campaign members. It starts when a Campaign Member is created --> No criteria-just execute the actions! --> 2 immediate actions:

1. Update Lead First Campaign: 
User-added image
2. Update Contact First Campaign:
User-added image

Any ideas as to why this would throw a "too many SOQL queries" error? Here is the email with details: 


Error element myRule_1_A1 (FlowRecordUpdate).
This error occurred when the flow tried to update records: Too many SOQL queries: 101. For details, see API Exceptions.

This report lists the elements that the flow interview executed. The report is a beta feature.
We welcome your feedback on IdeaExchange.

Flow Details
Flow Name: Update_First_Asset_on_Lead
Type: Record Change Process
Version: 8
Status: Active

Flow Interview Details
Interview Label: Update_First_Asset_on_Lead-8_InterviewLabel
Current User: Stephanie Holt (00541000004Rm2r)
Start time: 3/16/2018 3:50 PM
Duration: 0 seconds

How the Interview Started
Stephanie Holt (00541000004Rm2r) started the flow interview.
Some of this flow's variables were set when the interview started.
myVariable_old = null
myVariable_current = 00v4100000RHJgBAAX

ASSIGNMENT: myVariable_waitStartTimeAssignment
{!myVariable_waitStartTimeVariable} Equals {!Flow.CurrentDateTime}
Result
{!myVariable_waitStartTimeVariable} = "3/16/2018 3:50 PM"

DECISION: myDecision
Executed this outcome: myRule_1
Outcome conditions: and
1. {!formula_myRule_1} (true) Equals true
Logic: All conditions must be true (AND)

RECORD UPDATE: myRule_1_A1
Find all Lead records where:
First_Campaign__c Is null true
Id Equals {!myVariable_current.LeadId} (00Q4100000kHPKzEAO)
Update the records’ field values.
First_Campaign__c = {!myVariable_current.CampaignId} (70141000000LFrIAAW)
Result
Failed to update records that meet the filter criteria.

Error Occurred: Too many SOQL queries: 101
 
Hi All,
Is there any alternative way to pass more than one parameters through visual flow to invocable method?
Client want mass change on button click. There are some condition to check on selected records.
Example: If user select 100 records and click button,  it has to check if email is not null  and one more. Both are rollup fields. If any of that 2 fields empty, I want to let the user know and use appropriate view. Because in SF button is available in all list view.If i can make button visible to specific list view, my problem solved. unfortunately thats not that option right now. I need to restrict the user from using other view.
 I used andrew logic in below link and works perfectly .
https://andyinthecloud.com/2015/12/12/visual-flow-with-list-view-and-related-list-buttons/

Here comes the problem, flow couldnt take null value and throwing error. I tried to set the value to "not set"  in visualforce page, but i dont seem working. I tried debug log but in vien.


<apex:page standardController="Contact" tabStyle="Contact" recordSetVar="AllC" >
<!-- Add below each field you reference in your Flow -->
<apex:repeat value="{!AllC}" var="row"  rendered="TRUE">
{!row.Id}
{!IF(ISBLANK(row.Parent_Email__c), 'Not Set',row.Parent_Email__c) } </apex:repeat>
<!-- Runs your Flow -->
<flow:interview name="EmailToContacts" finishLocation="{!$CurrentPage.parameters.retURL}">
 <apex:param name="CVarCon" value="{!Selected}"/> </flow:interview> </apex:page>

This line not working 
{!IF(ISBLANK(row.Parent_Email__c), 'Not Set',row.Parent_Email__c) }

My expectation is: email set to "Not Set" so flow wont throw error and i can also check condition for "Not Set" and warn user to use appropriate view. OR I would like to throw error in visual page itself, that would be perfect.
I am stuck here. Please help.
 

Hi, We have a VF page hosted in public sites, where the site guest user will enter the details. Once he save the data, we are running a trigger in the backend to send this data to Zuora. Using Zuora managed package utility classes. 

If System Admin or any other user logged in and execute this page, we are able to send the data successfully. When site guest user do the same, we are getting below error.
Error: SObject row was retrieved via SOQL without querying the requested field: zqu__Quote__c.zqu__Is_Parent_Quote__c

Steps:

1) Site Guest User clicks Save button in public VF page.
2) Trigger executed in the backend.
  
trigger Zuora_Quote_Trigger on zqu__Quote__c (after Update) {    
    if(Trigger.isUpdate){
        system.debug('In Quote  Trigger - after update '+trigger.new);
        set<Id> setQuoteIds = new set<Id>();
        map<String,String> mapQuoteAccountIds = new map<String,String>();
        for(zqu__Quote__c zq : Trigger.new){
            if(zq.zqu__ZuoraSubscriptionID__c == null && zq.zqu__ZuoraPaymentID__c != trigger.oldMap.get(zq.Id).zqu__ZuoraPaymentID__c ){
                mapQuoteAccountIds.put(zq.Id,zq.zqu__Account__c);
            }
        }
     if(mapQuoteAccountIds.keyset().size()>0) SendQuoteToZuora.sendQuote(mapQuoteAccountIds);
    }    
}

3) This trigger will call the SendQuoteToZuora class 
@future(callout=true)
    public static void sendQuote(map<string,string> Map_QuoteAccountID){
        List<zqu.zQuoteUtil.ZBillingQuoteCollection> quotes = new List<zqu.zQuoteUtil.ZBillingQuoteCollection>();
        
        for(string s: Map_QuoteAccountID.keyset()){
            system.debug('Map_QuoteAccountID......Key:'+s+'..value: '+Map_QuoteAccountID.get(s));
            zqu.zQuoteUtil.ZBillingQuoteCollection quote = new zqu.zQuoteUtil.ZBillingQuoteCollection();
            quote.sfdcAccountId = Map_QuoteAccountID.get(s);
            quote.zAccountId = 'new';
            quote.quoteRequests = new List<zqu.zQuoteUtil.ZBillingQuoteRequest>();
            zqu.zQuoteUtil.ZBillingQuoteRequest req = new zqu.zQuoteUtil.ZBillingQuoteRequest();
            req.sfdcQuoteId = s;
            quote.quoteRequests.add(req);            
            quotes.add(quote);
            
        }        
                    
        List<zqu.zQuoteUtil.zBillingResult> results = zqu.zQuoteUtil.sendToZBilling(quotes); // invoing managed package class
        for ( zqu.zQuoteUtil.zBillingResult result : results ) {
            System.debug('Result: QuoteId = ' + result.sfdcQuoteId + ', Success = ' + result.success + ', message = ' + result.message );
        }
    }

Any help is greatly appreciated. 

  • April 06, 2017
  • Like
  • 1
Hi All,

when i try to pass value it shows Formula Expression is required on the action attributes When checkbox clicked in UI

Visual Page

                   <apex:inputcheckbox value="{!allbranch}"> 
                        <apex:actionSupport event="onchange" action="{!selectedvalue}" reRender="out"/>
                    </apex:inputCheckbox> All Branch <br/>
                    <apex:inputcheckbox value="{!branch1}"> 
                        <apex:actionSupport event="onchange" action="{!selectedvalue}" reRender="out"/>
                    </apex:inputCheckbox> branch1<br/>

Apex

public boolean allbranch{get;set;}
 public boolean branch1{get;set;}​

public String selectedvalue(){
        String query = '';
        if(allbranch == true)
        {
          // System.debug('Ouput Value---------------------------- allbranch'+allbranch);
           query = '';
        }
        if(branch1== true)
        {
           //System.debug('Ouput Value---------------------------- '+branch1);
           query = 'Branch__c = XXXX';
        }
       System.debug('*************************************query Value ---'+query);
        return query;       
    }
       
    public PageReference pageLoad() {
       city = selectedvalue();
       //System.debug('Selected city:------------------------ '+city);
}

Can any one try to resolve this problem.

Thank you..
Within a flow, I'm trying to pass a collection variable as input to an Apex element.  However, when I configure the Apex element, the collection variable does not show up as a selectable value in the Source dropdown.  In fact, there is not even a section within the dropdown for Collection Variables.  Anyone know why?

Collection Variables not selectable as input

Here are some relevant details:
  • The @InvocableMethod method that's being invoked accepts a list of Strings as its parameter (even though the name of the param is 'idList').
  • In the flow, record lookups populate various variables with record Id values.  A collection variable has been declared with Data Type = Text and Input/Output Type = Input Only.  An assignment variable is used to add the values of a couple of the Id variables into the collection variable.
  • I have double-checked by searching for the collection variable by name within the Inputs dropdown, and have confirmed it is not found.
I've been referencing this article but so far can't find any explanation:  https://developer.salesforce.com/docs/atlas.en-us.salesforce_vpm_guide.meta/salesforce_vpm_guide/vpm_designer_elements_apex.htm

hi 

 

i trying to sort the columns in pageblock table.. 

i am getting the error.. unexpected token: Order

 

code in class:

 

public ApexPages.StandardSetController con{get; set;}

//SETS THE SORT DIRECTION FOR THE SORTING COLUMN
public String sortExpression{
get {
return sortExp;
}
set {
//if the column is clicked on then switch between Ascending and Descending modes
if (value == sortExp)
sortDirection = (sortDirection == 'DESC')? 'ASC' : 'DESC';
else
sortDirection = 'ASC';
sortExp = value;
}
}

//method returning sort direction value i.e ASC
public String getSortDirection(){
//if not column is selected
if (sortExpression == null || sortExpression == '')
return 'ASC';
else
return sortDirection;
}

//METHOD TO SORT THE SEARCH RESULT COLUMNS
public void sortData(){
if(searchQuery != null && searchQuery.length() > 0) {
String sortFullExp = sortExpression + ' ' + sortDirection;
system.debug('*****'+sortFullExp);
con = new ApexPages.StandardSetController(Database.getQueryLocator(searchQuery + ' Order By ' + sortFullExp + ' limit 5000'));
con.setPageSize(20);
}
}

 

page:

 

<apex:pageBlockTable value="{!canlist}" var="cc">
<apex:column headerValue="Candidate Name" value="{!cc.Name}">
<apex:facet name="header">
<apex:commandLink action="{!sortData}" value="Name{!IF(sortExpression=='Name',IF(sortDirection='ASC','▲','▼'),'')}" id="relOrg" status="splashStatus" reRender="searchResultPanel" onclick="setSubmit();">
<apex:param value="Name" name="Name" assignTo="{!sortExpression}" ></apex:param>
</apex:commandLink>
</apex:facet>
</apex:column>

<apex:column value="{!cc.Email__c}">
<apex:facet name="header">
<apex:commandLink action="{!sortData}" value="Email{!IF(sortExpression=='Email__c',IF(sortDirection='ASC','▲','▼'),'')}" id="relg" status="splashStatus" reRender="searchResultPanel" onclick="setSubmit();">
<apex:param value="Email__c" name="Name" assignTo="{!sortExpression}" ></apex:param>
</apex:commandLink>
</apex:facet>
</apex:column>

<apex:column value="{!cc.Number__c}">
</apex:column>
</apex:pageBlockTable>

We have created a flow that creates an Opportunity and we want the "finishlocation" of the flow, where they end up when they click "Finish", to be the newly created Opportunity. I know that we will have to create a VF page and controller to pass the OpptyID (once created) back to the VF page and set as the finishlocation, but can't figure out how to do it. Any ideas?

We have ONE object with 3 different record types:

 

1. Purchase Orders (PO)

2. Invoices (Inv)

3. Official Receipts (OR)

 

There are three different operating branches that uses these, example as below:

 

1. New York

2. Sydney

3. Paris

 

We want to have different auto-numbers for these 3 different record types for these 3 different branches. Example as follows:

 

NY-PO-1001

NY-PO-1002

SYD-PO-1001

SYD-PO-1002

PA-PO-1001

PA-PO-1002

NY-Inv-1001

NY-Inv-1002

SYD-Inv-1001

SYD-Inv-1002

PA-Inv-1001

PA-Inv-1002

NY-OR-1001

NY-OR-1002

SYD-OR-1001

SYD-OR-1002

PA-OR-1001

PA-OR-1002

 

Using Auto-Numbers in Salesforce produces the result below, which we DO NOT WANT:

 

NY-PO-1001

NY-PO-1002

SYD-PO-1003

SYD-PO-1004

PA-PO-1005

PA-PO-1006

NY-Inv-1007

NY-Inv-1008

SYD-Inv-1009

SYD-Inv-1010

PA-Inv-1011

PA-Inv-1012

NY-OR-1013

NY-OR-1014

SYD-OR-1015

SYD-OR-1016

PA-OR-1017

PA-OR-1018

 

What is the solution without APEX or triggers for this?

 

If there is no standard solution in Salesforce, what do we need to do for APEX / Triggers to resolve the above?

 

Hi.,
I want to place a custom button in custom object list view. I don’t want user to click this button from any other list view other than desired one.
There is no option to make list button visible only in desired list view, it will be there in all list view.
Finally I desired to throw a message to user, when they click that list button other than desired list view.
Here I need to check the List View Name, how can we get the list view name in Visual force page / extension apex class.
Where all list view names are stored, is that object / table is accessible / can we query that object in apex class.
E.g:
List View Name A, I want to place custom button A here.
User should not have access to button A in list View B, C and etc(We cannot make it this happen in standard list view) hence user clicks button A from List view B or C.
I want to throw message to user.
Note: PDF page will be render to me when I click on custom button A.

I have some code that sends out an email. If I run that code from inside salesforce it works fine. However, if I run that code as the public sites user I get the following SendEmailResult error.

 

SendEmail failed. First exception on row 0; first error: INVALID_CROSS_REFERENCE_KEY, invalid cross reference id: []

 

However, all the mailing objects ID's (who, what, template and orgwide) are exactly the same when I send it from inside salesforce and from the website so I don't understand how it could be giving an error in one case but not the other.

 

 Here's the code that sends the email:

 

Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); 

mail.setTemplateId(template);

mail.setwhatId(what);

mail.setTargetObjectId(who);

mail.setSaveAsActivity(true);

mail.setOrgWideEmailAddressId(orgwide);

Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail});

 

for(Messaging.SendEmailResult res : r){

if(res.isSuccess() == false)

System.debug(res.geterrors().get(0).getMessage());

}

 

 Am I misunderstanding the error or is there some other ID field that could be screwing up the email?

 

 

Message Edited by grigri9 on 11-17-2009 09:08 PM
   
In a testMethod, I have following code:

Account_Auditor__c Account_auditor = new Account_Auditor__c(Account__c = a.id, auditor__c = u.id, Audit_Type__c = 'Garbage');
insert Account_auditor;
The intent is to execute the following trigger and give the "Auditor" read rights to the Account .

The testMethod runs fine in developer org, it croaks in the org that it is being installed it - it croaks on the Insert statement with the message:

caused by: System.DmlException: Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id

trigger grantAuditorReadAccessToAccount on Account_Auditor__c (after insert) {

Account_Auditor__c[]  Account_auditor_list = trigger.new;

for (Account_Auditor__c Account_auditor: Account_auditor_list) {
AccountShare ashare = new AccountShare();
ashare.AccountAccessLevel = 'Read';
ashare.OpportunityAccessLevel = 'None';
ashare.CaseAccessLevel = 'None';
ashare.AccountId = Account_auditor.Account__c;
ashare.UserorGroupId = Account_auditor.Auditor__c;
Insert ashare;
}
}

I suspect it has something to do with the user rights - I am fetching an active user from the database in the test method (u.id). In the org that I am installing, I have two users, one is system admin, another is a test user I created, so that i could install. I assume I am installing as a