• Dan Ramirez
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 4
    Replies
We have a flow that creates cases, then queries the case via a lookup node to get the value of a formula field on it, and displays a screen based on the output from the query; the decision is made through a decision node after the lookup node. For some reason the query will not pull in the info for users without a "View All" permission on cases even though we have a sharing rule that opens those cases back up to them. Any idea why this is? The user is able to view the case right away, and that field too, so I know he has access to it. It's almost as if he just didn't have access to the case from the flow via the lookup node. Any suggestions for way to get around this? It's a pretty complex formula field so I'm hoping to not have to recreate it inside the flow.
Hi! We currently use a formula field on the case object to assign numerical priority values to cases based on a multitude of variables, some of which are based on the user viewing the case. To put it simply, users view a list view sorted by the priority number and work from the top down so they are always working on the most pressing case; the priority value is different based on the person viewing the list and their skills, which is why we use a formula field instead of a workflow, PB, or Apex to set those values. However, we've found that we're now maxed out on formula field character limits and need to find a way to get around this since the prioritization formula needs to be more complex. Can we use any other sort of "automation" to set the value of a field dynamically based on case and user fields? Or can you recommend a way to get around the formula limits? I've posted our current formula to give you a better idea of what we're using it for. Thanks!
if( On_Hold_Future_Followup_Date__c = TRUE , 10, 

/***** Garbage Duty ******/ 
if( Case_To_Clean__c = TRUE, 
if( $User.Garbage_Duty__c = TRUE, 2.5, 
if( and( text( Priority) = "Immediate", Owned__c = FALSE), 1, 8)), 

/***** Unowned Cases ******/ 
if( OR( Owner:Queue.QueueName = "General Sales", Owner:Queue.QueueName = "Key Accounts"), 
if( text( Status ) = "New", 
if( Account.RecordType.DeveloperName = "Vendor_Account", 2, 
Case( text( Priority), 
"Low" ,7, 
"Medium", 5, 
"High", 3, 
1)),1), 

/***** Owned By Me ******/ 
if( Owner:User.Id = $User.Id , 
if( OR( text( Status ) = "New", contains( text( Status ), "Hold")) , 
Case ( text ( Priority ), 
"Low", 6, 
"Medium", 4, 
"High", 2, 
1), 
if( text( Status ) = "InProgress", 1, 
if( OR( text( Priority ) = "Low", text( Priority ) = "Medium"),2,1))), 

/***** Owned By Someone In the Office ******/ 
if( OR( Owner:User.Out_of_Office_Until__c <= today() , isblank( Owner:User.Out_of_Office_Until__c ) ), 
if( text( Status ) = "InProgress", 10, 
if( text( Status ) = "NewCustomerResponse", 8, 
if( contains( text( Status ) , "Hold"), 9, 
if( text( Priority ) = "Immediate", 6, /* need to bump this up after 2 hours OR at 4PM, whichever comes first */ 
7)))), 

/***** Owned By Someone Out Of Office ******/ 
if( OR( text( Status ) = "New" , text( Status ) = "InProgress"), 
Case( text( Priority), 
"Low" ,7, 
"Medium", 5, 
"High", 3, 
1), 
if( OR( text( Priority ) = "Low" , text( Priority ) = "Medium"), 1,0) + 
if( text( Status ) = "NewCustomerResponse", 1, 6)) 

)))))
We currently use an Apex Class that will generate opportunities from Orders that are imported nightly from an SSIS package. Originally the only orders that would generate opportunities were the ones that were of the Sales_Order type, but recently we changed the trigger to also include Service_Orders, so now we have to figure out how to modify our code so that it'll assign the correct opportunity record type based on the order type. The class was written by someone else and I'm REALLY new to coding so I'm hoping you guys can help me. Here is the class:
 
 

https://www.dropbox.com/s/dvotyvt765pv6we/Order_Helper.pdf?dl=0

(I had to do it this way because there's a charater limit.)

If I understand this correctly, the class puts all the orders on a list and runs through the Opportunity Number field. If it has a valid number it'll simply link the Order to the Opportunity with that number. However, if the Order does not have an Opportunity Number, or the number does not match an existing Opportunity's number, it'll generate a new opportunity through the Order Wrapper section. I'm pretty sure that the part that the part that currently sets the record type is the part that I've put in bold letters, my question is: why did they put that section there and not define it in the Order Wrapper section that sets the other Opportunity fields? And, I tried replacing that part with the loop below but got an error saying we had maxed out our SOQL inquiries, how can I rewrite this to work? Or, if you think there's a better way, how would you do it? 
list<Id> oppRT = new list<id>();
            String rtLabel = '';
            for(Order__c xxx:orders ){
            if(xxx.Order_Type__c=='Sales_order' ){
           
            for(RecordType rt : [SELECT Id, Name FROM RecordType WHERE IsActive = true AND SobjectType = 'Opportunity' AND DeveloperName = 'Standard_Quote_Order']){
                oppRT.add(rt.Id);
                         

                rtLabel = rt.Name;
            } 
            }
            else{
            for(RecordType rt : [SELECT Id, Name FROM RecordType WHERE IsActive = true AND SobjectType = 'Opportunity' AND DeveloperName = 'Service_Job']){
                       

                oppRT.add(rt.Id);
                rtLabel = rt.Name;
            } 
            }}
            integer o1=0;
            for(OrderOppWrapper oow : orderOppWrapList){
                if(acctMap.containsKey(oow.order.AccountId__c)){
                    if(oppRt != null){
                        oow.oppty.RecordTypeId = oppRt[o1];
                        o1++;
                    }
                    if(takerId.containsKey(oow.order.Taker__c)){
                        oow.oppty.OwnerId = takerId.get(oow.order.Taker__c);
                    }
                    else if(defaultUser instanceof Id){
                        oow.oppty.OwnerId = defaultUser;
                    }
                    else{
                        oow.oppty.OwnerId = acctMap.get(oow.order.AccountId__c).OwnerId;
                    }                   
                    upsertOpps.add(oow.oppty);
                }
            }
            if(upsertOpps.size() > 0 && isInsert){
                upsert upsertOpps;
            }

 
I am trying to create a Kanban view where i want to group by a custom lookup field.

I can see one custom Lookup field in Group By options and i cannot see another. Both fields are in the Page Layout.

Can someone please help with where am i going wrong.
Hello
I am working on a flow and one of the things it needs to do is query PriceBookEntry. For some reason the fast lookup is not finding any records, but when I test the same query with soql executed on workbench the record is found. I'm a bit stumped on what to do next. So hopfully someone out there has some ideas. 

Here is excerpt from the debug email that shows what the fast lookup is doing:
FAST LOOKUP: Get_Standard_PBE_PP
Find all PricebookEntry records where:
Platform__c Equals {!Pureprofile} (Pureprofile)
Pricebook2Id Equals {!varQuote.Pricebook2Id} (01s90000004YFPxAAO)
CurrencyIsoCode Equals {!varQuote.CurrencyIsoCode} (AUD)
Incidence_Rate__c Equals {!formulaIncidenceRate} (10.00)
Length_of_Interview__c Equals {!Length_of_Interview2} (20)
Assign those records to {!sovPBEM}.
Save these field values in the variable: Id
Result
Failed to find records.

And here is the soql that actually finds the record
SELECT 
    Id, 
    name, 
    currencyisocode 
FROM PricebookEntry 
where 
    Length_of_Interview__c = 20 and 
    Incidence_Rate__c = 10.00 and 
    Platform__c = 'Pureprofile' and 
    Pricebook2id = '01s90000004YFPxAAO' and 
    CurrencyIsoCode = 'AUD'

 
We currently use an Apex Class that will generate opportunities from Orders that are imported nightly from an SSIS package. Originally the only orders that would generate opportunities were the ones that were of the Sales_Order type, but recently we changed the trigger to also include Service_Orders, so now we have to figure out how to modify our code so that it'll assign the correct opportunity record type based on the order type. The class was written by someone else and I'm REALLY new to coding so I'm hoping you guys can help me. Here is the class:
 
 

https://www.dropbox.com/s/dvotyvt765pv6we/Order_Helper.pdf?dl=0

(I had to do it this way because there's a charater limit.)

If I understand this correctly, the class puts all the orders on a list and runs through the Opportunity Number field. If it has a valid number it'll simply link the Order to the Opportunity with that number. However, if the Order does not have an Opportunity Number, or the number does not match an existing Opportunity's number, it'll generate a new opportunity through the Order Wrapper section. I'm pretty sure that the part that the part that currently sets the record type is the part that I've put in bold letters, my question is: why did they put that section there and not define it in the Order Wrapper section that sets the other Opportunity fields? And, I tried replacing that part with the loop below but got an error saying we had maxed out our SOQL inquiries, how can I rewrite this to work? Or, if you think there's a better way, how would you do it? 
list<Id> oppRT = new list<id>();
            String rtLabel = '';
            for(Order__c xxx:orders ){
            if(xxx.Order_Type__c=='Sales_order' ){
           
            for(RecordType rt : [SELECT Id, Name FROM RecordType WHERE IsActive = true AND SobjectType = 'Opportunity' AND DeveloperName = 'Standard_Quote_Order']){
                oppRT.add(rt.Id);
                         

                rtLabel = rt.Name;
            } 
            }
            else{
            for(RecordType rt : [SELECT Id, Name FROM RecordType WHERE IsActive = true AND SobjectType = 'Opportunity' AND DeveloperName = 'Service_Job']){
                       

                oppRT.add(rt.Id);
                rtLabel = rt.Name;
            } 
            }}
            integer o1=0;
            for(OrderOppWrapper oow : orderOppWrapList){
                if(acctMap.containsKey(oow.order.AccountId__c)){
                    if(oppRt != null){
                        oow.oppty.RecordTypeId = oppRt[o1];
                        o1++;
                    }
                    if(takerId.containsKey(oow.order.Taker__c)){
                        oow.oppty.OwnerId = takerId.get(oow.order.Taker__c);
                    }
                    else if(defaultUser instanceof Id){
                        oow.oppty.OwnerId = defaultUser;
                    }
                    else{
                        oow.oppty.OwnerId = acctMap.get(oow.order.AccountId__c).OwnerId;
                    }                   
                    upsertOpps.add(oow.oppty);
                }
            }
            if(upsertOpps.size() > 0 && isInsert){
                upsert upsertOpps;
            }

 
I know I have to use query all or all rows or something but I can't figure it out. I always get the error: "MALFORMED_QUERY - ALL ROWS not allowed in this context". What does this mean?

I've tried with no luck:
SELECT Id, isDeleted FROM OpportunityLineItem WHERE isDeleted = true All ROWS
SELECT Id, isDeleted FROM OpportunityLineItem WHERE isDeleted = true QUERY ALL

Thanks,
Jason


  • August 27, 2008
  • Like
  • 0