• King Koo
  • NEWBIE
  • 105 Points
  • Member since 2012
  • Senior Developer
  • Third Wave Consulting Inc.


  • Chatter
    Feed
  • 3
    Best Answers
  • 4
    Likes Received
  • 0
    Likes Given
  • 67
    Questions
  • 81
    Replies
Hi there

I have an object which is the child to Account in a master-detail relationship.

In the REST API, when creating the child record for an existing account (with external ID AAA), this is the JSON I use.
 
{
  "batchRequests": [
    {
      "method": "PATCH",
      "url": "v35.0/sobjects/Account_Child__c/External_Id__c/ABCDE",
      "richInput": {
        "Account__r": {
          "External_Id__cc": "AAA"
        },
        "Other_Field__c": "whatever"
      }
    }
  ]
}

This is fine when I'm inserting.  However, when I'm updating the content for "Other_Field__c", if I include "Account__r" then I get the infamous error message:  
Unable to create/update fields: Account__c. Please check the security settings of this field and verify that it is read/write for your profile or permission set.
So I'm forced to not include Account__c.

The thing is, if the integration developer is using a tool to send the JSON over to Salesforce (from SAP in this case), he will not know whether the child object record exists or not.  I'm hoping I could use the SAME structure for both insert and update in this upsert.

Is my only solution to set the "Child records can be reparented to other parent records after they are created" checkbox?  

If so I'm just amazed how you could do that before this checkbox was introduced (whcih was only less than 4 years ago).

Thanks a lot
King




 
Hi there

It may be a dumb question but is there any transaction control capability with REST API?

I have SAP sending data over to my Salesforce instance over some middleware, calling REST API.  I don't have any web services exposed or anything.  The middleware basically just simply pumps data from SAP into Salesforce calling REST API (/composite/batch resource).

I'm wondering what if the batch is sending me 20 records (say one account followed by 5 contacts, 5 opportunities and 9 orders).  If any of the record fails, is there a way for the REST API to rollback this set of 20 records?

Is there also a place in Salesforce that I can view the REST API log?

Thanks
King
Hi there

I've been trying to understand if I'm mistaken or not.

According to the help, (https://developer.salesforce.com/docs/atlas.en-us.securityImplGuide.meta/securityImplGuide/fields_about_encrypted_fields.htm), 

Encrypted text fields:
Are not available for: Salesforce Classic Mobile, Connect Offline, Salesforce for Outlook, lead conversion, workflow rule criteria or formulas, formula fields, outbound messages, default values, and Web-to-Lead and Web-to-Case forms.

However, I tried and I am able to send out encrypted text fields in my outbound message.  It is true I can't use it in workflow rule criteria or formula, but I can send out those encrypted fields.

Is it the documentation that hasn't been updated yet?

Thanks
King
Hi there
I have a contact record called "King Koo" with email address king.koo@test.com.

I set up a Matching Rule on Contact - Matching Criteria is
(Contact: LastName
FUZZY: LAST NAME
MatchBlank = FALSE) 
AND 
(Contact: Email
EXACT
MatchBlank = FALSE)

And I set up Duplicate Rule to allow on create with Alert and Report, tying it to the Matching Rule above.

I then created a Lead with the same info as the Contact, and then on Convert, I get to a screen like the following.  

My confusion is that the "Convert to Existing Contact" gives me an empty list, when I was expecting to see the info of the matching Contact record.  With no records showing there, obviously the "Convert to Selected" doesn't make sense.

As far as I'm concerned, the duplicate management is not doing anything.

Am I missing some steps?

Thanks
King

User-added image
I can't complete the Salesforce connect trailhead, the command to run heroku locally, DATABASE_URL=`heroku config:get DATABASE_URL` PGSSLMODE=require npm start, throws a syntax error:"The term 'DATABASE_URL' is not recognized as the name of a cmdlet,function, script file, or operable program. 
Hi there

Got a bug today and was debugging it to death, but still at no avail.  Hope someone can help.  This is regarding <apex:actionStatus>.

I made my example really short.  So here is the controller:
public class ActionStatusController
{
    public String testVariable {get; set;}
    public pagereference donothing()
    {
        return null;
    }
}

And here is the VF page that uses the controller
<apex:page controller="ActionStatusController">
<apex:pageBlock id="pb">
<apex:form >
    <apex:selectList value="{!testVariable }" size="1">
        <apex:selectOption itemValue="" itemLabel="" />
        <apex:selectOption itemValue="a" itemLabel="a" />
        <apex:selectOption itemValue="b" itemLabel="b" />
        <apex:selectOption itemValue="c" itemLabel="c" />
        <apex:actionSupport event="onchange" reRender="testVariableDiv"/>
    </apex:selectList>
    <apex:commandButton action="{!doNothing}" value="Click" status="showStatus" rerender="pb"/>
</apex:form>
<apex:outputPanel id="testVariableDiv">
    <apex:outputText value="selected value is {!testVariable }" />
</apex:outputPanel><br/>
<apex:actionStatus id="showStatus">
<apex:facet name="start">
the value is "{!testVariable }"
</apex:facet>
</apex:actionStatus>
</apex:pageBlock>
</apex:page>

When the page loads, you see the picklist and then the statement that says "selected value is".

Once you pick, say, "c", then the statement becomes "selected value is c", which is expected.

However, when you then press the button, which in the facet/start is supposed to display the same value, it says "the value is ".

Now, if I press it again, then it displays "the value is c".  

It seems like the actionStatus is lagging by one step.  What must I change in order for the display to say "the value is c" as soon as I press the "Click" button?


Thanks
King


 

Hi there

In the past whenever I add a VF to a profile or a permission set, I always also add the associated controller or controller extension to the same profile and permission set.

This morning (22 May 2015) I omitted to add the controller for my VF page to the profile, but I found out the VF page still renders for the profile I was testing.

Am I missing something here?  Or is it something new?
 

Thanks
King

Hi there

Have a very simple sample here
 
<apex:page standardController="Contact">
    <apex:form >
        <apex:pageMessages/>
        <apex:pageBlock mode="inlineEdit">
            <apex:pageBlockButtons >
                <apex:commandButton action="{!edit}" id="editButton" value="Edit" style="display: none;"/>
                <apex:commandButton action="{!save}" id="saveButton" value="Save" style="display: none;"/>
                <apex:commandButton onclick="resetInlineEdit()" id="cancelButton" value="Cancel" style="display: none;"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection >
                <apex:outputField value="{!contact.date__c}">
                    <apex:inlineEditSupport showOnEdit="saveButton, cancelButton" 
                        hideOnEdit="editButton" event="ondblclick" 
                        changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/>
                </apex:outputField>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>


As you can see there is a Date field which supports inline edit.

When you double click the field, the Save and Cancel buttons show.  Now if I enter some bad data into the Date field, such as "abc", and click Save, it'll fail the validation rule.

It's obvious because the error displays in the <apex:pageMessages/> tag, but I cannot find a way to show the "Save" and "Cancel" buttons anymore.

Anyone knows what I'm missing here?
Thanks
King
HI there

I have a dashboard showing a donut.  When clicking a wedge on the donut, I have set it up so that the user will be brought forward to the filtered report showing detail information about the clicked wedge.

Is there any way so that I don't let user access the report directly?  That is, the only way they can get to the report is via the dashboard, so what they will get is always the "filtered report", not the whole report?

I tried to create a report folder with no sharing to the user profile, but when I signed in as the user, I got the "The data you were trying to access could not be found. It may be due to another user deleting the data or a system error." error.

ANy ideas?
Thanks
King
Hi there

I'm tryng to help implement a system that tracks patients and physician information (and other stuff).  I really hope someone that has experiecnes implementing Person Accounts can help me here.

My client has enabled Person Account.

Person accounts are used to model patients, business accounts are used to model physician's office, and then Contacts are used to model physicians.  In fact, I have renamed Accounts to Patients, and Contacts to Physicians, so now you see "Patients" tab and "Physicians" tab.

So for example, I am a patient, King Koo, so there is a person account.  I have a doctor called "Dr Wong" - which takes up a contact record, and finally, his clinic is called "Dr Wong Clinic" which takes up a business account.

Now, this is the part where I'm having some challenges.  

1) The Account now has person accounts (Patients) and business accounts (Clinics).  So that led me to wonder, should I have renamed Accounts to Patients?  Can I have two Account tabs, one for showing the person accounts, and one for showing the business accounts?

2) I have originally renamed "Account Name" to "Patient Name" so that when I'm looking at the record for "King Koo", I'll see Patient Name is King Koo.  

However, when I go to the physician record for "Dr Wong", (which is a Contact record, and as you know Account Name is a required field for Contact), you now again see "Patient Name", but that's where I meant to input "Dr Wong Clinic". The fact that the physician record showing a field called "Patient Name" just does not make sense.

I would really like to see "Patient Name" in the form for patients, and like to see "Clinic Name" in the form for physicians.

Is it do-able?

Thanks a lot
King
Hi there

It's been very frustrating because I cannot post questions with Windows 8 on this discussion forum after it's been renovated.

Also when I typed a few keywords and the search results pop up, I click on any of the search results but there won't be anything happening to it.

I have to use my desktop (which is Windows XP) in order to post stuff on to this forum.

I wonder if anybody has the same issue?  I'm running Windows 8, Chrome.    (I understand this is probably not the right place to post this question but I don't know who to ask)

Thanks
King
Hi there

This is weird..  Never thought I've encountered that before.  Is it new...?

The following code works, just as you would expect.

<apex:page standardController="account">
    <apex:repeat value="{!account.contacts}" var="CONTACT">
        <apex:outputField value="{!CONTACT.name}" />
    </apex:repeat>
</apex:page>

However, if I change the outputField to this (only hanged the apex:outputField line),

<apex:page standardController="account">
    <apex:repeat value="{!account.contacts}" var="CONTACT">
        <apex:outputField value="{!contact.name}" />
    </apex:repeat>
</apex:page>

I got this error mssage:
Error: Unknown property 'AccountStandardController.contact'

This is really against what I have believed for a long time that VF is case insensitive.

Has anyone else seen this before?

Note:  I originally had var="Contact".  My above code, var="CONTACT", is simply for illustrations.

Thanks
king

Today we’re excited to announce the new Salesforce Developers Discussion Forums. We’ve listened to your feedback on how we can improve the forums.  With Chatter Answers, built on the Salesforce1 Platform, we were able to implement an entirely new experience, integrated with the rest of the Salesforce Developers site.  By the way, it’s also mobile-friendly.

We’ve migrated all the existing data, including user accounts. You can use the same Salesforce account you’ve always used to login right away.  You’ll also have a great new user profile page that will highlight your community activity.  Kudos have been replaced by “liking” a post instead and you’ll now be able to filter solved vs unsolved posts.

This is, of course, only the beginning  and because it’s built on the Salesforce1 Platform, we’re going to be able to bring you more features faster than ever before.  Be sure to share any feedback, ideas, or questions you have on this forum post.

Hats off to our development team who has been working tirelessly over the past few months to bring this new experience to our community. And thanks to each of you for helping to build one of the most vibrant and collaborative developer communities ever.
 

Hello All,

 

I am trying to complete this lab (8-1 Creating a Custom SOAP Web Service) from 501 Labs.

 

When I did this with the assigned org during our training, I did not have any issues.

 

When I tried doing the same exercise in my own developer edition I am seeing this error.

 

Objective of the exercise : To allow insertion of job candidate and application via webservice API.In this the webservice is called from a VF page.

 

webservice name =

CandidateKeyWebService

and it has a method called "submitEmployeeReferral"

 

This is the contents from the pop up window

 

=========

 

AJAX Toolkit Shell
Features: autocompletion of property names with Tab, multiline input with Shift+Enter, input history with Up/Down Values and functions: ans, print(string), props(object), blink(node), clear(), load(scriptURL), scope(object)


Request: server- /services/Soap/package/CandidateKeyWebService
<textarea cols=80 rows=5 wrap=hard>&lt;se:Envelope xmlns:se="http://schemas.xmlsoap.org/soap/envelope/"&gt;&lt;se:Header xmlns:sfns="http://soap.sforce.com/schemas/package/CandidateKeyWebService"&gt;&lt;sfns:SessionHeader&gt;&lt;sessionId&gt;00D90000000qFRD!AREAQMLtrkAQzPhCsf_KMIB5rE5rnPPap0YFtJyDdsz_3GcQs_fom5q7dGXJyBdG1TGaMY83V7CI0.gU.93nw49Bdt5hDKnx&lt;/sessionId&gt;&lt;/sfns:SessionHeader&gt;&lt;/se:Header&gt;&lt;se:Body&gt;&lt;submitEmployeeReferral xmlns="http://soap.sforce.com/schemas/package/CandidateKeyWebService"&gt;&lt;a&gt;a009000000PLJx8AAH&lt;/a&gt;&lt;b&gt;&lt;type&gt;Candidate__c&lt;/type&gt;&lt;First_Name__c&gt;a&lt;/First_Name__c&gt;&lt;Last_Name__c&gt;b&lt;/Last_Name__c&gt;&lt;Phone__c&gt;&lt;/Phone__c&gt;&lt;Mobile__c&gt;&lt;/Mobile__c&gt;&lt;Email__c&gt;a@a.com&lt;/Email__c&gt;&lt;/b&gt;&lt;/submitEmployeeReferral&gt;&lt;/se:Body&gt;&lt;/se:Envelope&gt;</textarea>


Response : status - 500
<textarea cols=80 rows=5 wrap=hard>&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"&gt;&lt;soapenv:Body&gt;&lt;soapenv:Fault&gt;&lt;faultcode&gt;soapenv:Client&lt;/faultcode&gt;&lt;faultstring&gt;No such parameter a defined for the operation, please check the WSDL for the service.&lt;/faultstring&gt;&lt;/soapenv:Fault&gt;&lt;/soapenv:Body&gt;&lt;/soapenv:Envelope&gt;</textarea>


faultcode    soapenv:Client
faultstring    No such parameter a defined for the operation, please check the WSDL for the service.

====================

 

Q : I am new to webservices debugging etc and since this error did not come during our training, I am at a loss to understand where and how to start debugging.

 

Can someone point me out in a right direction or give me a clue as to what could be wrong ?

In the User's Guide there is a sample http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_test.htm?CSHID=apex_methods_system_test.htm#TestLoadDataExampleSection

of how to use the Test.loadData method to load a csv file with Accounts.

 

I cannot see any documentation nor samples showing how to load records with references (lookup or master-detail) to parent records - e.g. if I want to load Contacts, which refer to Accounts.

 

Anyone who knows. I suppose I am not going to "invent" record IDs????

I'm deploying a series of Apex classes using the Force.com Migration Tool (i.e. ANT). However, when I specify an explicit test class I get all errors for classes that already exist (the target instance is a sandbox), and have no bearing on the Apex classes I'm deploying. In short, it seems to be running all tests.
 
The classes I'm deploying aren't packaged, and neither are the existing classes which produce the errors.
 
Here's is my ANT task:
 
Code:
    <target name="deployWebSvcPkg">
      <sf:deploy username="${dest.username}" password="${dest.password}" serverurl="${dest.serverurl}" deployRoot="webSvcPkg">
        <runTest>WebSvcTest</runTest>
      </sf:deploy>
    </target>

 
Any ideas as to why these other (existing) classes end up being tested run I run the above task?