apex-code

Getting WSDL parse error while generating Apex code from WSDL in Salesforce

坚强是说给别人听的谎言 提交于 2019-12-14 02:52:04
问题 Getting the following error while parsing the Amazon Product Advertising API. Error: Failed to parse wsdl: simpleType->element Name can not be null. 1295 WSDL Link : http://webservices.amazon.com/AWSECommerceService/AWSECommerceService.wsdl Are there any workarounds? 回答1: I pulled the WSDL down and made the following changes on lines 1292 and 1295. Note the new name attributes on both the inner simpleTypes. <xs:simpleType name="positiveIntegerOrAll"> <xs:union> <xs:simpleType name=

How do i get a list of fields in alphabetical order in SF

谁说我不能喝 提交于 2019-12-14 02:41:12
问题 I am trying to get all the fields in an object to comeup in a alphabetical order. i have tried using apex explorer to get the fields, though most of the fields come up in an order, there are few fields which do not come up in the right order. Getting the field names in a particular order might not affect the code working, but as a part of standards used in our project, it is expected that we use them in alphabetical order. Thanks Prady 回答1: This recipe will work: List<Contact> contacts =

Set and read cookies using two different domain using javascript

≡放荡痞女 提交于 2019-12-13 21:53:59
问题 I want to set cookies in url like salesforce apex page url using javascript[document.cookie] and get those cookies in another domain in same browser.using javacript but not able to get. Actually my Apex page which i load in iframe and that time i set that cookies and get those cookies in another page which is out side of salesforce domain. Any body have any idea how to set and get cookies using different domains. 回答1: It isn't possible to read cookies created by another domain for security

Populate Lookup Field with Record Created From Trigger

血红的双手。 提交于 2019-12-13 17:29:25
问题 I am trying to create a trigger that does the following: Once an Account has been created, create an unrelated record (called a "Portal Content" record) that bears the same name, assuming the default RecordTypeId Take the ID of the newly created "Portal Content" record, and insert it into a lookup field on the originally created Account My current code does item 1 successfully, but when I added new code to complete item 2, I received the following error: Line: 6, Column: 1 System.DmlException

Automated upload of a Salesforce file to Box.com record-linked folder

杀马特。学长 韩版系。学妹 提交于 2019-12-13 12:42:35
问题 I have a Box for Salesforce intregration app installed and it works great when a user manually adds a file to a SFDC record. I have an Apex class that creates a PDF file that needs to be linked to a SFDC record. I am able to upload the record through the box-api to an existing folder that is linked to the record. But I cannot figure out an automated way to create a folder that is linked to a SFDC record. Did anyone find a solution to this scenario? Thanks, Jose 回答1: We don't currently have a

Adding rows in visualforce page in PageBlocktable dynamically

血红的双手。 提交于 2019-12-13 04:27:09
问题 i am creating a dummy visualforce page whose code is <apex:page controller="sampleCon"> <apex:form> <apex:pageMessages id="message" /> <apex:pageBlock> <apex:pageBlockTable value="{!wrap1}" var="item" id="hello"> <apex:column headerValue="String" value="{! item.x}"></apex:column> <apex:column headerValue="Action"><apex:commandButton value="{!if(item.i == size-1,'Add','Delete')}" onclick="AddOrDelete({! item.i});" rerender="message"></apex:commandButton></apex:column> </apex:pageBlockTable> <

How can I extract only the error message from xml result

半腔热情 提交于 2019-12-13 03:29:18
问题 How can I extract the value from the label VertexApplicationException and User login failed. from below xml result? Inside my package, i am using 'make request api' call to get tax value calculated from vertex, sometimes i am getting error as response for my api call, now i need to store the response in table but only i need the error message ex: VertexApplicationException and User login failed. from the belowgiven xml response tag <S:Envelope xmlns:S="http://schemas.xmlsoap.org/soap/envelope

Custom Button to copy data from Opportunity into a related custom object

好久不见. 提交于 2019-12-12 21:17:02
问题 I have a custom object that is used for product setup that is mapped to an opportunity. It's a one to many relationship - one opportunity maps to many setup objects, but one setup object is only mapped to one opportunity. Opportunity has some setup fields that need to act as defaults for the related custom object. Unfortunately, I cannot just specify them in a formula - getting an error. What I would like to do is have a custom button that would allow user to click and copy all of the related

Regex to match only till first occurence of class match

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-12 19:23:07
问题 I'm looking to construct a regex which will help me identify the first occurrence of a match. My current regex is "(.*)[Cc][Aa][Ss][Ee][^a-zA-Z\\d]*(\\d\\d*)[^a-zA-Z\\d]*(.*)" What I am trying to do is to find if the input string contains the word "case" (case insensitive), followed by any number of special characters, followed by a number; I want to retrieve 3 parts of the text. Say my input string is "RE: FW: case:-1234: there is some description" Using this regex, I am able to retrieve,

Google Drive HTTP 403 “Access Not Configured” error

梦想的初衷 提交于 2019-12-12 17:14:05
问题 I'm attempting to install the DrEdit sample app for Salesforce onto GAE. The app runs, but saving or opening a file results in an HTTP 403 "Access Not Configured Error". I have also attempted to use the values for API Access>Client ID for web applications. The Google Drive SDK> OAuth Client ID has also been set variously to the Drive SDK and web app Client IDs. but, After enabling both (Api, SDK) in Api access service i am still getting same error. 回答1: Can you make sure that you register