• Tolga Sunar
  • NEWBIE
  • 305 Points
  • Member since 2015
  • SFDC Consultant
  • Intech Consulting


  • Chatter
    Feed
  • 7
    Best Answers
  • 3
    Likes Received
  • 1
    Likes Given
  • 19
    Questions
  • 90
    Replies
Hi,
I have two objects A and B, A is the parent to B, both objacts have status fields, when ever Aobject Status is changed from "Inprogress" to "Complete"then all child B object status changed to "Complete".
Please send me the sample trigger.
hi all,

I have overridden View button in a custom object, so whenever I click on a record in SF1 list view, a visualforce page is called which executes a callout to an external system and populates all the fields of the record before navigating to the detail page of it. The problem is that, when I click on the back button (top left corner of screen), I go to the visualforce page again, and I become stuck at "Please Wait" statement which it displays. My intent is to navigate back to the list view directly from the detail page, skipping the visualforce page.

I tried putting a sforce.one navigation element that redirects to the list above the sforce.one.navigateToURL but I couldn't get it to work. Anyone else got any other ideas on how I can overcome this issue?
 
<apex:page StandardController="PR_PO_Approvals__c" extensions="WSPRPOApprovals">
  <apex:form>
           <h1>Please wait...</h1>
           <apex:actionFunction name="CallDetailPRApexMethod" action="{!GetDetailPR}"
                            oncomplete="Call('{!ErrorMsg}');"/>
           <apex:actionFunction name="CallDetailPOApexMethod" action="{!GetDetailPO}"
                            oncomplete="Call('{!ErrorMsg}');"/>
 </apex:form>
<script type="text/javascript">
    try 
    {
        if ('{!PR_PO_Approvals__c.RecordType.DeveloperName}' == 'PR_LineItem'){
            CallDetailPRApexMethod();}
        else {
            CallDetailPOApexMethod();}
    } 
      catch(e) { 
      alert(e);
}
function Call(a)
{
 
    if(a)
    {
        alert (a);
    }

        if((typeof sforce != 'undefined') && sforce && (!!sforce.one)) 
        {

            sforce.one.navigateToURL('/{!PR_PO_Approvals__c.Id}?nooverride=1');
            
        }
        else 
        {          
            window.location.href = '/{!PR_PO_Approvals__c.Id}?nooverride=1';                                          
        }
          
}
</script>
</apex:page>
Hello,

I would like to limit the fields that appear at list view filtering. 

In SF1 (mobile interface), when I click the "Filter" action on a list view page, I want not all but a few fields to be available for filtering. Same modification should be applicable in web interface (Classic). Is there any way to accomplish this?
User-added image
User-added image
Regads,
Serhat Aygun
Does anyone have a way to make a Long Text Area or Rich Text Area field unique?  We have a custom field on a custom object that is slightly longer than a regular text field but I still want to block duplicates.
The picklist I have set up for the Subject fields of Tasks and Events are not showing up in the Salesforce mobile app.  They work fine on the desktop version.  The only option on the mobile app is the default value.  Thanks in advance for any advice!
I am attempting to upload records into Sales Force with Data loader and get this error message for each item record type missing for: Patients.  Not sure how to fix this all the fields are mapped properly and seem to be fine. 
I have a phone field and I want add the following rules to that field.
1. If the length of the field is less than 9. It should throw an error.
2. It should not accept numbers like 111-111-1111
3. It should not contain any characters (A-Z) (a-z)
4. It should not contain special characters except "("    ")"    "-"  and "+"

Can anyone help help me with this. Thanks?
This is the documentation of API call: https://developer.salesforce.com/docs/atlas.en-us.loyalty.meta/loyalty/connect_resources_transaction_ledger.htm

I am doing everything certainly by the book, yet this API returns this:
{
        "errorCode": "NOT_FOUND",
        "message": "The requested resource does not exist"
    }
This API endpoint is fairly new, since it's been available since Summer 23 (v58). I am suspecting some mistake in the deployment of this API.

Anyone managed to get successful response from that API? 
Hi, I was excited when I saw a new Lightning component blog on Salesforce developer portal three days ago, but did not had the time to read it and bookmarked it for later. I've just rechecked the developer blog list and the blog is not there. Apparently it is removed.

Aforementioned blog: https://developer.salesforce.com/blogs/2018/04/how-variable-types-operate-in-the-lightning-component-framework.html

My queries:
  1. Why was the blog removed?
  2. Where can I find a copy or archive of the blog?
Regards,
Tolga
 
Hello,

As fas as I know, Visualforce pages are hosted on a seperate domain which name goes by <instance name>.c.visual.force.com. Recently, one org encountered a problem in which a very critical Visualforce page started throw "time limit exceeded" for all users, and whole operation came to a halt. After a while, the issue mysteriously disappeared, and VFP load times went back to their normal level.

I suspect that there was a problem with Salesforce VF servers (if such thing exists). When I check the said org's instance page in trust.salesforce.com, everything is green. However, I'm not sure if there were really an issue with VF servers and that would have been displayed in the trust page. Please correct me if I got the facts wrong and show me where I can consult when I encounter a mass VF problem.

Thanks in advance. 
Hey,

Campaign management design requires that a parent campaign can have "campaign items" child records, and child campaigns should not, instead, their layouts will display the parent's campaign items records.

I am trying to apply this via Lightning App Builder; I put a "related list" standard component, select "parent campaign" record, and select "campaign items" related list. However, I can't seem to display any related list of parent campaign. Whatever related list of parent campaign I set to, I get this text instead: "We can't display this information because the record has no parent or you don’t have access. Ask your admin for help.".

Child campaign layout

Below screenshot is the Lightning Page of above layout. You can see the parent's campaign items related list detail:

User-added image 

I am definitely sure that I have campaign items related list placed on the standard layouts on both child record type and parent record type. And the child campaign I view has its "ParentId" field populated. There can't be any visibility / permission issue since my profile is System Administrator.

In Lightning App Builder, I do several experiments such as changing the parent record on related list component, and everything except for parent campaign, the related list displays normally. This issue is exclusive to parent campaign.

I couldn't find anything related to this issue on boards and Salesforce pages. Anyone else have experienced this? This is becoming frustrating for me.

Regards,
Tolga
My code development environment conists of Apple MBP, Google Chrome browser and Salesforces native Developer Console tool. With the Google Chrome v56 update, scrolling up/down in developer console becomes extremely jumpy and it makes my experience extremely painful. I have to go on Safari and develop there as a workaround.

Is anyone else here experiencing this issue? Here's the related StackExchange topic. I would like to hear any solutions to this problem if there's any.
I am trying to preview the email template inside a Visualforce page, and for this purpose, I query for the EmailTemplate record's body inside JavaScript, and then I let the standardcontroller do rest of the job by merging the referenced fields in email template - at least that's my intention.

The email template body is: 
Flight No: {!Flight__c.Name}
The visualforce page is (embedded into a publisher action):
<apex:page standardController="Flight__c">

    <apex:includeScript value="/soap/ajax/35.0/connection.js"/> 

    <apex:form id="myForm">
        <apex:pageBlock id="myPageblock">

            <apex:outputText>
                <script type="text/javascript">
                sforce.connection.sessionId='{!GETSESSIONID()}';
                var query = sforce.connection.query("SELECT Id, Name, Body FROM EmailTemplate WHERE Name = 'myTemplate'");
                var records = query.getArray("records"); 
                alert(records);
                var body = '';
                body = records[0].Body;
                document.write(body);
                </script>       
            </apex:outputText><br/>
            <apex:outputText>
                <script>
                document.write('Flight No: {!Flight__c.Name}');
                </script>
            </apex:outputText>
        </apex:pageBlock>
    </apex:form>  

</apex:page>

And the rendered VF page is:

renderedVFresult
What am I doing wrong? It seems like the {!Flight__c...} statements need to be present as hardcoded inside VF for standardcontroller to merge them. Maybe I should follow a different path there, looking forward to your insights.

Thanks in advance.
I have developed a VF form and put it in a quick action & assigned it to case page layout. I am refreshing the current case tab by using console integration toolkit at submit button's oncomplete event (note that I have 30 of this command because I was unable to obtain enclosing tab id from inside quick action VF, so I refresh all open tabs)
var primaryTabId_0 = 'scc-pt-0';
            sforce.console.refreshPrimaryTabById(primaryTabId_0, true);
The problem is; console components of page layout and detail view of record refreshes successfully, but the feed actions remain unrefreshed. This VF form links an account to the case, and I cannot see this account prepopulated in one of "update case" quick actions, in the account lookup field. When I manually refresh the page or tab, this field is prepopulated.

Has this issue acknowledged as a bug yet, or is there any other code I can add that will allow me to refresh the feed view as well?

Cheers
I have created an apex trigger that is defined on User Service Presence object, but I have no idea how to get even one line of it covered for deployment. This trigger simply detects when an user logins or logouts to a specific omni-channel presence, and updates a field on User object. Since User Service Presence object does not support DML calls and -as far as I know- it is not possible to simulate omni-channel presence login / logout event in a testmethod, I cannot cover any line of this trigger.

Any information about a workaround or a trick is greatly appreciated.
Hey,

When I do this query, I am able to get ID's on EmailMessage parent case's standard account lookup field: 
SELECT Parent.AccountId FROM EmailMessage
User-added image

However, when I want to reference a field inside Account, no field returns. Tried standard Account and PersonAccount fields, along with custom fields, bu to no avail.
SELECT Parent.Account.PersonEmail FROM EmailMessage
User-added image

By the way, Account records in this org are Person Accounts. Could be this the reason? Or this is due to some kind of limitation / bug?

Thanks in advance




 
I would like to know if it is possible to use OR logic in Live Agent prechat doFind event. I'm aware that you can enter multiple criteria there, and they will be linked with AND logic together. I can't find anything on online sources regarding using OR in doFind.
I tried below, but it did not work. Simply, I use two seperate doFind for each field that is subject to OR. I aim for constructing a query as "FirstName AND Last Name AND (PersonEmail OR Phone)". Form with matching firstname, lastname and email was successful but that with matching firstname, lastname and phone did not work.
 
<input type="hidden" name="liveagent.prechat.findorcreate.map.doFind:Account" value="PersonEmail,true;FirstName,true;LastName,true;" />
<input type="hidden" name="liveagent.prechat.findorcreate.map.isExactMatch:Account" value="PersonEmail,true;" />

<input type="hidden" name="liveagent.prechat.findorcreate.map.doFind:Account" value="Phone,true;FirstName,true;LastName,true;" />
<input type="hidden" name="liveagent.prechat.findorcreate.map.isExactMatch:Account" value="Phone,true;" />
Any clarification & help is greatly appreciated.
Thanks
 
Hey,

I have the following method in which SOAP webservice is consumed created by wsdl2apex (only necessary part is shown):
 
public class SendOrder {
    
    public void SendOrder(string OrderId) {

        // Query for Order
        EFES_Order__c Order = [SELECT 	Id,
                               Ship_To_SAP_Code__c,
                               Sold_To_SAP_Code__c,
                               Currency__c,
                               Purchase_Order_Number__c,
                               Requested_Shipping_Date__c,
                               Original_Requested_Shipping_Date__c,
                               Shipping_Date_Change_Reason__c,
                               Incoterm__c,
                               Payment_Type__c,
                               Vehicle_Type__c,
                               Palette_Type__c,
                               Additional_Docs__c,
                               Logistics_Company_Phone__c,
                               Logistics_Company_Email__c,
                               Logistics_Company__c,
                               Order_SAP_Code__c,
                               Source_Country_Code__c,
                               Integration_Id__c,
                               Status__c
                               FROM Order__c 
WHERE Id=:OrderId];
        
.
.
.
.

        
        // Assign request parameters
.
.
.

        inputIM_Header.INCOTERMS 	= 	[SELECT Name FROM List_Of_Values__c WHERE Display_Value__c=:Order.Incoterm__c AND Type__c='INCOTERM' LIMIT 1].Name;
        inputIM_Header.PMNTTRMS 	= 	[SELECT Name FROM List_Of_Values__c WHERE Display_Value__c=:Order.Payment_Type__c AND Type__c='PAYMENT_TYPE' LIMIT 1].Name;          
        system.debug(inputIM_Header.PMNTTRMS);
        
.
.
.
.

    
        }
    	

}

I have also created a test class for this code, in which I first create a dataset and then call the above class inside it (again, only necessary part is shown):
 
@isTest(SeeAllData=true)
private class EFES_SendOrder_Test {

    static testMethod void OrderTest() {
        
        List_Of_Values__c ListOfValue2 = new List_Of_Values__c();
        ListOfValue2.Name = 'INCO';
        ListOfValue2.Display_Value__c = 'Incoterm';
        ListOfValue2.Type__c = 'INCOTERM';
        insert ListOfValue2;
        system.debug('listofvalue2 id = '+ListOfValue2.id);
        
        List_Of_Values__c ListOfValue3 = new List_Of_Values__c();
        ListOfValue3.Name = 'PMNT';
        ListOfValue3.Display_Value__c = 'Payment';
        ListOfValue3.Type__c = 'PAYMENT_TYPE';
        insert ListOfValue3;
	system.debug('listofvalue3 id = '+ListOfValue3.id);
        
.
.
.
.

                
        Order__c Order = new Order__c();
        Order.ShipTo_Account__c = ShipToAccount.Id;
        Order.Currency__c = 'USD';
	Order.Source_Country_Code__c = 'TURKEY';
	Order.Requested_Shipping_Date__c = system.today();
	Order.Original_Requested_Shipping_Date__c = system.today();
	Order.Incoterm__c = 'Incoterm';
	Order.Payment_Type__c = 'Payment';        
        insert Order;
        system.debug('order id = '+Order.id);
        
.
.
.
.
               
        Test.startTest();
        
        SendOrder SendOrderx = new SendOrder();
		SendOrderx.SendOrder(Order.Id);
        
        Test.stopTest();

.
.
.
.

    }
}

According to the test data, inputIM_Header.INCOTERMS and inputIM_Header.PMNTTRMS queries should not return blank, because I create exact data for both of them. However, when I run the test, INCOTERMS is populated, while PMNTTRMS query does not see the test data and I get the error specified in the title. 

I've made a lot of research about that;
  • I had already SeeAllData on, turning it off was no help,
  • I'm on SystemAdmin user so I have all the permissions,
  • I debug all the test data and make sure they all are created on test class,
  • Debugging PMNTRMS returns a data when executed from execute anonymous (testing with org data),
  • Payment_Type__c FLS is OK for SystemAdmin
The fact that bug me most is that INCOTERMS is fine while PMNTTRMS could not be queried.

P.S. I know you are going to tell me to use List instead of a single sObject; you are right, but I am getting NO record from query at this point. I want to solve it first.

Any help is greatly appreciated. Thanks in advance.
 
Hello,

I have recently stumbled upon a rather interesting problem on my end. I have set up an integration with external system, and it responds me with a Base64 encoded Hex code of a PDF document whenever I make a call with a single input string. I'm supposed to obtain the Hex code after Base64 decoding, then cast the hex code into a blob & save it as an attachment body.

The problem here is: The Hex code itself and its length does not match when I debug. The string is one character less from the size, and the conversion from hex to blob fails because of odd numbered size of input string - it turns out that the size is correct here.

Below is the code:
//Proforma response = Base64 encoded hex string
Blob afterblob = EncodingUtil.base64Decode(proformaResponse);

string HexCode = afterblob.toString();

Debug.Proforma2__c = HexCode;

Debug.Debug1__c = string.valueOf(Hexcode.length());

update Debug;

Note that I use a custom debug object because of sandbox environment's incapability on debugging webservice calls...

When I make the call, HexCode string length is 52312, and Debug1 field value is 52313. Later I submit the HexCode to the EncodingUtil class' ConvertFromHex function, but it fails while saying "input string char count is an odd number"... When I discarded the endmost string of HexCode, it worked, but that's not an approach I want to adopt.

I appreciate any clarification on this issue.
Hey,

I have overridden the "View" button of an object with a Visualforce page, in which a webservice that populates a record's most fields executes, then navigates the user into the record detail page. In order to stop the expected loop behavior, I navigate as follows (in mobile):

sforce.one.navigateToURL('/{!MyObject__c.Id}?nooverride=1');

This halts the loop behavior and redirects the user after fields are populated, it's OK to this point. However, when navigating back from the detail page to this visualforce page (via device button in Android and app button in iOS), the javascript portion in it does not execute. It does when testing on desktop, but on SF1, it behaves differently as I observed in my own developer org.

I have developed a workaround for desktop so users can skip the callouts the visualforce page executes when going back from detail page to list view, but because of the reason I described above, I had to follow a totally different routine in SF1, and I'm not very comfortable with it as it leaves behind a design flaw.

Anyone else have faced this or a similiar issue? If so, how did you overcome this?

Regards
Hello,

I have a security related issue here. Let me explain how I tried to reproduce the issue in my developer org I faced during a project:

I defined two users, one with CEO role and other with Worker role. Obviously, the CEO is above the Worker in hierarchy. 

I defined three simple objects; ObjectA is the child of both ObjectX and ObjectY. I created the Master-Detail relationship between ObjectX and ObjectA first, therefore I expect ObjectA records to inherit the ownership from ObjectX according to SFDC documentation. Moreover, ObjectX and ObjectY possess a Private org-wide sharing setting.
  • Test 1: CEO creates ObjectX record. Worker creates ObjectY record. CEO creates ObjectA record (Worker can't create because it won't see the ObjectX record created by CEO). I expect the Worker to not see the ObjectA record, and I couldn't see. That's OK.
  • Test 2: Worker creates ObjectX record. CEO creates ObjectY record. CEO creates ObjectA record. I expect the Worker to see the ObjectA record, and I couldn't see. This is unexpected, I should have had access to the ObjectA record.
The sayings in documentation regarding ownership inheritance in junction objects simply contradicts with this test outcome here. Could anyone point me out the possible mistake in my methodology here? Am I missing something? 

Thanks in advance.
 
Hello,

I've read that upsert operation accepts the standard ID field as the matching field, or any external ID field if present. However, when I attempt to export some Lead records and directly upsert the generated .csv file into SF, I get the below error:
User-added image

When I open the .csv file with an editor, ID field is present:

User-added image

Moreover, when I do the same operation for Account object which has an external ID field, the matching field window has the text "no external ID found, dataloader will use the Id field". But below that text, the external field is selected as the matching field and is greyed out.

Why does DataLoader ignore my standard ID fields? I tried a custom object, and standard ID field is still ignored.

Thanks in advance.
Hello,

I want to know something about Visual workflows:

Say, I have a process that triggers when A field value changes from X to Y. This process launches a flow that starts with a wait element for 3 absolute days. After 3 days have passed, I want the flow to look at B field value when wait event is over; if it has a certain value, then do a record update.

I would like to know if it is possible. I am going to pass the B field's value from process to flow, but what will be the B field's value during the decision phase after wait event is over; will it be the value at process trigger event, or the value after 3 days following the trigger (when the wait event is over)?

I know I can test it myself, but I am quite limited by means of time. Also, please do not advise me using process builder's scheduled action instead, I am aware of that as well.

Thanks in advance.
Hello,

In Contact object, I have a numeric "A" field that changes when a child record is inserted by integration. If that numeric field hasn't changed in the last 45 days, create a Case. It sound simple, but it's the opposite when you think implementing it. I have scanned almost the whole online documentation and boards, but couldn't find any solution. 

One solution is I've found online is that: Create a date type "B" field on Contact object. First workflow sets this date value to TODAY() when numeric "A" field updates. The second workflow operates under "created and when edited to meet the criteria", and has a criteria B field = TODAY(). It also has a time-based action to create a Case after 45 days from now. However, this method will fail as in the following days the criteria will return false and it will be removed from queue after any arbitrary edit action. Note that first workflow is a workflow rule, and the second is a process builder workflow.

I would like to hear the solutions from people who had the exact requirement. 

Thanks in advance.
Hello,

In the Admin Advanced --> Advanced Formulas --> Using Picklists in Formulas module, the challenge requirment is as follows:

"Create a validation rule formula that does not allow a user to mark a case as escalated unless the priority is set to 'High', the case was not Closed when Created, and the case isn’t closed."

I am setting up a valid formula (did a bunch of tests on Case object so I'm sure it is valid and I'm not going to post it here to let this remain as a challenge). I am using four fields, which are IsClosed, IsClosedOnCreate, Priority and Status, as understood from the challenge description.

However, checking the challenge gives me this error. Apparently, despite the description, we gotta use IsEscalated field instead of IsClosed:
User-added image

After I change IsClosed field with IsEscalated in the formula, I get this error:
User-added image

I am reproducing this scenario in a Case record and validation rule triggers.

Did anyone manage to pass this challenge? If not, could the Trailhead Dev Team have a look at wording of this challenge please? 

Thanks in advance.



 
Hello,

I am developing a custom object-specific quick action for letting users approve or reject a record which has a pending approval request, on SF1. I've set up a VF and controller, and they work as intended; upon clicking on quick action, record becomes approved.

However, I am trying to make the quick action button to redirect back to record detail page. Instead, it simply brings the comment insertion page with "Save" button greyed out and no comment textbox. I have to click "cancel" to navigate back to record detail page that is not refreshed (fields come out as not updated by approval actions etc...)

Here is my Visualforce code:
<apex:page standardController="PR_PO__c" extensions="ApproveActionVfc" action="{!redirect}">
    <script> 
    try { sforce.one.navigateToURL('/{!PR_PO_ID}'); } 
    catch(e) { window.location.href = '/{!PR_PO_ID}'; }
    </script> 
</apex:page>
PR_PO_ID here is the record ID that is fetched inside and transferred from the extension.
On desktop interface, redirection is successful, however on SF1 I have this problem. 

Screenshots (record detail page and the page upon clicking (the popup saying "Record is Approved" appears shortly after this page shows up).
User-added image

User-added image

Any help or idea is greatly appreciated. I think this is unfixable because of SF1 design, but I hope that someone already encountered this problem and found a solution...

Thanks in advance.
I have developed a VF form and put it in a quick action & assigned it to case page layout. I am refreshing the current case tab by using console integration toolkit at submit button's oncomplete event (note that I have 30 of this command because I was unable to obtain enclosing tab id from inside quick action VF, so I refresh all open tabs)
var primaryTabId_0 = 'scc-pt-0';
            sforce.console.refreshPrimaryTabById(primaryTabId_0, true);
The problem is; console components of page layout and detail view of record refreshes successfully, but the feed actions remain unrefreshed. This VF form links an account to the case, and I cannot see this account prepopulated in one of "update case" quick actions, in the account lookup field. When I manually refresh the page or tab, this field is prepopulated.

Has this issue acknowledged as a bug yet, or is there any other code I can add that will allow me to refresh the feed view as well?

Cheers
I would like to know if it is possible to use OR logic in Live Agent prechat doFind event. I'm aware that you can enter multiple criteria there, and they will be linked with AND logic together. I can't find anything on online sources regarding using OR in doFind.
I tried below, but it did not work. Simply, I use two seperate doFind for each field that is subject to OR. I aim for constructing a query as "FirstName AND Last Name AND (PersonEmail OR Phone)". Form with matching firstname, lastname and email was successful but that with matching firstname, lastname and phone did not work.
 
<input type="hidden" name="liveagent.prechat.findorcreate.map.doFind:Account" value="PersonEmail,true;FirstName,true;LastName,true;" />
<input type="hidden" name="liveagent.prechat.findorcreate.map.isExactMatch:Account" value="PersonEmail,true;" />

<input type="hidden" name="liveagent.prechat.findorcreate.map.doFind:Account" value="Phone,true;FirstName,true;LastName,true;" />
<input type="hidden" name="liveagent.prechat.findorcreate.map.isExactMatch:Account" value="Phone,true;" />
Any clarification & help is greatly appreciated.
Thanks
 
This is the documentation of API call: https://developer.salesforce.com/docs/atlas.en-us.loyalty.meta/loyalty/connect_resources_transaction_ledger.htm

I am doing everything certainly by the book, yet this API returns this:
{
        "errorCode": "NOT_FOUND",
        "message": "The requested resource does not exist"
    }
This API endpoint is fairly new, since it's been available since Summer 23 (v58). I am suspecting some mistake in the deployment of this API.

Anyone managed to get successful response from that API? 
Hey,

Campaign management design requires that a parent campaign can have "campaign items" child records, and child campaigns should not, instead, their layouts will display the parent's campaign items records.

I am trying to apply this via Lightning App Builder; I put a "related list" standard component, select "parent campaign" record, and select "campaign items" related list. However, I can't seem to display any related list of parent campaign. Whatever related list of parent campaign I set to, I get this text instead: "We can't display this information because the record has no parent or you don’t have access. Ask your admin for help.".

Child campaign layout

Below screenshot is the Lightning Page of above layout. You can see the parent's campaign items related list detail:

User-added image 

I am definitely sure that I have campaign items related list placed on the standard layouts on both child record type and parent record type. And the child campaign I view has its "ParentId" field populated. There can't be any visibility / permission issue since my profile is System Administrator.

In Lightning App Builder, I do several experiments such as changing the parent record on related list component, and everything except for parent campaign, the related list displays normally. This issue is exclusive to parent campaign.

I couldn't find anything related to this issue on boards and Salesforce pages. Anyone else have experienced this? This is becoming frustrating for me.

Regards,
Tolga
Hi,

Can someone help me in understanding the difference between below mentioned two statements. You can see that its the same SOQL query being used in both the statements. But it's the collection to store the SOQL results that differs. How does List and Map behave in these two statements?

List<Account> acctsWithOpps = [SELECT Id,(SELECT Id,Name FROM Opportunities) FROM Account WHERE Id IN :Trigger.New];

AND

Map<Id, Account> AcctWithOpps = new Map<Id, Account>([SELECT Id,(SELECT Id FROM Opportunities) FROM Account WHERE ID IN:Trigger.New]);

Thanks & Regards,
B Archana
My code development environment conists of Apple MBP, Google Chrome browser and Salesforces native Developer Console tool. With the Google Chrome v56 update, scrolling up/down in developer console becomes extremely jumpy and it makes my experience extremely painful. I have to go on Safari and develop there as a workaround.

Is anyone else here experiencing this issue? Here's the related StackExchange topic. I would like to hear any solutions to this problem if there's any.
Hello,

I am trying to complete the challenge for the Use Org & Session Cache module on Salesforce Trailhead. Here are the instructions:

In this challenge, you’ll write an Apex class that writes and reads a bus schedule from the org cache. Your method for reading the cache has to handle cache misses.
  • Create a partition called BusSchedule with 0 MB for the size of org cache and session cache. The 0 MB allocation enables you to test cache misses.
  • Create a public Apex class called BusScheduleCache.
  • Add this variable to the class: private Cache.OrgPartition part;
  • In the constructor, create a new instance of Cache.OrgPartition by passing it the partition name (local.BusSchedule). Assign this object to the class variable (part).
  • Add two public methods. a. The first method, putSchedule(), returns void and takes these parameters: String busLine, Time[] schedule. b. The second method, getSchedule(), returns a bus schedule as a time array (Time[]) and takes this parameter: String busLine.
  • Implement the putSchedule() method so that it stores the passed-in values in the org cache by using the partition class variable (part).
  • Implement the getSchedule() method so that it returns the schedule for the specified bus line by using the partition class variable (part).
  • Add logic to the getSchedule() method to handle cache misses. If null is returned for the cached value, getSchedule() should return the following default schedule as a Time array with two Time objects: one Time object value of 8am and another of 5pm. Use the Apex Time.newInstance() method to create the Time objects.
Here is my current code:
 
public class BusScheduleCache {   
    // Get partition
    private Cache.OrgPartition part;
    String partitionName = 'local.BusSchedule';
    
    public BusScheduleCache(String partitionName) {
		Cache.OrgPartition newpart = Cache.Org.getPartition(partitionName);
        part = newpart;
    }
    
    public static void putSchedule(String busLine, Time[] schedule) {
        Cache.Org.put(busline, schedule);
    }
        
    public static Time[] getSchedule(String busLine) {
        Time[] schedule;
        
        // Get a cached value
		Object obj = Cache.Org.get(busLine);
		// Cast return value to a specific data type
		Time t2 = (Time)obj;
        if (t2 != null) {
        	schedule.add(t2);
        }
        else {
            Time t3 = Time.newInstance(8,0,0,0);
            schedule.add(t3);
            Time t4 = Time.newInstance(17,0,0,0);
            schedule.add(t4);
        }        
        return schedule;
    }  
      
}



Here is the error I am receiving:

Challenge Not yet complete... here's what's wrong: 
The Apex Class BusScheduleCache is not properly implemented. Please follow the requirements and ensure everything is setup correctly

Can someone please help?
Hello,

I have this error when I try to check challenge:

Challenge Not yet complete... here's what's wrong: 
Could not find an account named 'Blackbeards Grog Emporium' created from Workbench with the Description 'The finest grog in the seven seas.'


In the next picture you can see what I send by the Workbench

User-added image

The result is succes and in my Developer Org I can see the Account created correctly, but the challenge isn't passed.
I have created an apex trigger that is defined on User Service Presence object, but I have no idea how to get even one line of it covered for deployment. This trigger simply detects when an user logins or logouts to a specific omni-channel presence, and updates a field on User object. Since User Service Presence object does not support DML calls and -as far as I know- it is not possible to simulate omni-channel presence login / logout event in a testmethod, I cannot cover any line of this trigger.

Any information about a workaround or a trick is greatly appreciated.
Hey,

I have the following method in which SOAP webservice is consumed created by wsdl2apex (only necessary part is shown):
 
public class SendOrder {
    
    public void SendOrder(string OrderId) {

        // Query for Order
        EFES_Order__c Order = [SELECT 	Id,
                               Ship_To_SAP_Code__c,
                               Sold_To_SAP_Code__c,
                               Currency__c,
                               Purchase_Order_Number__c,
                               Requested_Shipping_Date__c,
                               Original_Requested_Shipping_Date__c,
                               Shipping_Date_Change_Reason__c,
                               Incoterm__c,
                               Payment_Type__c,
                               Vehicle_Type__c,
                               Palette_Type__c,
                               Additional_Docs__c,
                               Logistics_Company_Phone__c,
                               Logistics_Company_Email__c,
                               Logistics_Company__c,
                               Order_SAP_Code__c,
                               Source_Country_Code__c,
                               Integration_Id__c,
                               Status__c
                               FROM Order__c 
WHERE Id=:OrderId];
        
.
.
.
.

        
        // Assign request parameters
.
.
.

        inputIM_Header.INCOTERMS 	= 	[SELECT Name FROM List_Of_Values__c WHERE Display_Value__c=:Order.Incoterm__c AND Type__c='INCOTERM' LIMIT 1].Name;
        inputIM_Header.PMNTTRMS 	= 	[SELECT Name FROM List_Of_Values__c WHERE Display_Value__c=:Order.Payment_Type__c AND Type__c='PAYMENT_TYPE' LIMIT 1].Name;          
        system.debug(inputIM_Header.PMNTTRMS);
        
.
.
.
.

    
        }
    	

}

I have also created a test class for this code, in which I first create a dataset and then call the above class inside it (again, only necessary part is shown):
 
@isTest(SeeAllData=true)
private class EFES_SendOrder_Test {

    static testMethod void OrderTest() {
        
        List_Of_Values__c ListOfValue2 = new List_Of_Values__c();
        ListOfValue2.Name = 'INCO';
        ListOfValue2.Display_Value__c = 'Incoterm';
        ListOfValue2.Type__c = 'INCOTERM';
        insert ListOfValue2;
        system.debug('listofvalue2 id = '+ListOfValue2.id);
        
        List_Of_Values__c ListOfValue3 = new List_Of_Values__c();
        ListOfValue3.Name = 'PMNT';
        ListOfValue3.Display_Value__c = 'Payment';
        ListOfValue3.Type__c = 'PAYMENT_TYPE';
        insert ListOfValue3;
	system.debug('listofvalue3 id = '+ListOfValue3.id);
        
.
.
.
.

                
        Order__c Order = new Order__c();
        Order.ShipTo_Account__c = ShipToAccount.Id;
        Order.Currency__c = 'USD';
	Order.Source_Country_Code__c = 'TURKEY';
	Order.Requested_Shipping_Date__c = system.today();
	Order.Original_Requested_Shipping_Date__c = system.today();
	Order.Incoterm__c = 'Incoterm';
	Order.Payment_Type__c = 'Payment';        
        insert Order;
        system.debug('order id = '+Order.id);
        
.
.
.
.
               
        Test.startTest();
        
        SendOrder SendOrderx = new SendOrder();
		SendOrderx.SendOrder(Order.Id);
        
        Test.stopTest();

.
.
.
.

    }
}

According to the test data, inputIM_Header.INCOTERMS and inputIM_Header.PMNTTRMS queries should not return blank, because I create exact data for both of them. However, when I run the test, INCOTERMS is populated, while PMNTTRMS query does not see the test data and I get the error specified in the title. 

I've made a lot of research about that;
  • I had already SeeAllData on, turning it off was no help,
  • I'm on SystemAdmin user so I have all the permissions,
  • I debug all the test data and make sure they all are created on test class,
  • Debugging PMNTRMS returns a data when executed from execute anonymous (testing with org data),
  • Payment_Type__c FLS is OK for SystemAdmin
The fact that bug me most is that INCOTERMS is fine while PMNTTRMS could not be queried.

P.S. I know you are going to tell me to use List instead of a single sObject; you are right, but I am getting NO record from query at this point. I want to solve it first.

Any help is greatly appreciated. Thanks in advance.
 
Hello,

I have recently stumbled upon a rather interesting problem on my end. I have set up an integration with external system, and it responds me with a Base64 encoded Hex code of a PDF document whenever I make a call with a single input string. I'm supposed to obtain the Hex code after Base64 decoding, then cast the hex code into a blob & save it as an attachment body.

The problem here is: The Hex code itself and its length does not match when I debug. The string is one character less from the size, and the conversion from hex to blob fails because of odd numbered size of input string - it turns out that the size is correct here.

Below is the code:
//Proforma response = Base64 encoded hex string
Blob afterblob = EncodingUtil.base64Decode(proformaResponse);

string HexCode = afterblob.toString();

Debug.Proforma2__c = HexCode;

Debug.Debug1__c = string.valueOf(Hexcode.length());

update Debug;

Note that I use a custom debug object because of sandbox environment's incapability on debugging webservice calls...

When I make the call, HexCode string length is 52312, and Debug1 field value is 52313. Later I submit the HexCode to the EncodingUtil class' ConvertFromHex function, but it fails while saying "input string char count is an odd number"... When I discarded the endmost string of HexCode, it worked, but that's not an approach I want to adopt.

I appreciate any clarification on this issue.
Hi,

I have got JSON response from an exernal system and it consists of some data that needs to be saved in salesforce.
Using some tool i have deserialized the JSON data into apex class.
and how do i save that data to salesforce. I mean it needs to be saved in Account and Contact SOjects in salesforce.

How to do This...!
  • March 26, 2016
  • Like
  • 0
Recently I tried logging into an Org that had TLS 1.0 disabled without me knowing it. I thought I'd be fine when TLS 1.0 was disabled, but I guess not. I am using Windows 10 as my operating system, and Chrome as my browser. The version of Chrome is Version 49.0.2623.108 m, much higher than the required 37 or 38. Here's a screenshot of the Related security settings:
User-added image
Then here's the error screen:
User-added image
If anyone has even any kind of long shot speculative guess of how or why this is happening (or any suggestions as to how to solve it), I'd greatly appreciate it.

Thanks in advance,
Parker

Is there any way to add an error to an record being updated in a trigger and send an email. The trigger needs to send an email (one per batch). The email works fine if the processing generates no errors and I do not use the addError method. If I use the addError method to pass a message back to the user then the email is not sent.

 

So is there a way to send an email and use addError in the same trigger code? If not is there another mechanism that can be used to pass a message back to the user interface (standard salesforce UI).

 

Thanks

 

Dave

  • December 08, 2009
  • Like
  • 0
Hi all!

I'm a beeginner and I need a formula field to add the first 3 sales recorded of an account.

I don't have already the sales field in my account fields.

Hope you can help me