Skip to main content
15 votes
Accepted

Property 'tab' not valid in version 42.0

Noting this here for reference in case others run into the issue - the "tab" XML attribute has been renamed to "tabs" in Spring '18. So just change the tag name and you're good to go: <?xml ...
berry120's user avatar
  • 701
7 votes

Method does not exist or incorrect signature: void format(String) from the type Date

Date does not have a format() method accepting a string. That method is available only on DateTime. You can create a DateTime from a Date and simply use a format string that does not include time-...
David Reed's user avatar
  • 93.2k
6 votes
Accepted

How to use BuildRowSetFromXML with an "attribute-id" in SFMC?

The online documentation for the BuildRowSetFromXML function isn't very clear on how to reference attribute values, but if you pay attention to the table at the bottom of the page, you'll notice that ...
Mark G's user avatar
  • 1,559
6 votes
Accepted

Can I prettify a XML string using Apex?

The answer is probably "yes, but I don't think it would be worth the effort." You would need to manually loop through all of the XML nodes and build the output string manually (so you would ...
Derek F's user avatar
  • 62.7k
5 votes
Accepted

XML parsing in Apex

You can use the Document and XmlNode classes in the DOM namespace to parse XML. String xml = '<?xml version="1.0" encoding="utf-8"?><response><task id="56639c84-7f73-4ace-b7ab-...
Adrian Larson's user avatar
  • 151k
5 votes
Accepted

How to control the property name of a serialised object using Apex

If you want to use reserved keywords as keys in your JSON payload, the simplest solution is to just use Map<String, Object> rather than a concrete type. system.debug(JSON.serialize(new Map<...
Adrian Larson's user avatar
  • 151k
5 votes
Accepted

make LWC's targetConfig's property mandatory

Unless I'm missing something with your question, why can't you just add the required attribute to your property? e.g. <targetConfigs> <targetConfig targets="lightning__RecordPage"&...
Nick C's user avatar
  • 6,790
4 votes
Accepted

partial formatting in excel cell using xml spreadsheet in salesforce

An excel cell row which have partial worlds in bold should look like this: <Cell> <Data ss:Type="String"> <Font html:Color="#000000" xmlns="http://www.w3.org/TR/REC-...
Ashwani's user avatar
  • 22.6k
4 votes

List<string> how much values/Size can it store?

A list can store many thousands of items and the total space used by the items and list can be several megabytes. But to convert a list into a string that represents all the items in the list, you ...
Keith C's user avatar
  • 136k
4 votes
Accepted

How to download a file created by APEX

You would need to set up a download action. Arguably, this is probably most easily done with a download link: <!-- visualforce --> <a href="data:application/vnd.adobe.xdp+xml;base64,{!...
sfdcfox's user avatar
  • 497k
4 votes
Accepted

Pass null to webservice number field?

You should be able to specify null with xsl:nil: <ns0:Number_Field__c xsl:nil="true" />
sfdcfox's user avatar
  • 497k
4 votes
Accepted

How to assign a right curly bracket } as attribute value inside the markup of a lightning component?

You can replace } with unicode \u007D and it is working. I just tried. <lightning:button label="{! 'label {1' + '\u007D' }" /> Gives the output:
javanoob's user avatar
  • 8,907
4 votes
Accepted

System.XmlException: start tag unexpected character =

There are few things wrong with the xml. 1) In Apex, the string starts and end with single quotes ' , thus you don't need to escape " 2) You cannot use & in XML, it makes XML invalid, you have ...
Pranay Jaiswal's user avatar
4 votes

Decoding pipe symbol in apex

You are actually getting HTML Entities in XML. So, you should use unescapeHtml4(). String str = 'Test &#124; Shift Happens: Test data '; String conStr = str.unescapeHtml4(); System.debug(conStr);
salesforce-sas's user avatar
4 votes
Accepted

Using AMPscript to pull XML from DE

I'd recommend looking over how XPATH 1.0 works -- that's the key part to understanding how to pull node attributes and values from the payload. Here's an example with a different, but similar ...
Adam Spriggs's user avatar
  • 30.8k
4 votes
Accepted

How to validate LWC's XML properties?

You can't actually stop the user entering bad data (they could even enter values that are not currency names - you might want to think about using a picklist data source, or even have some apex to ...
Phil W's user avatar
  • 37k
3 votes
Accepted

Method does not exist or incorrect signature: [System.XmlStreamWriter].writeCharacters(Date)

If you look at the XmlStreamWriter documentation, the signature of the writeCharacters method accepts String only. writeCharacters(text) Writes the specified text to the output stream. ...
Adrian Larson's user avatar
  • 151k
3 votes
Accepted

Escape XML Function in VisualForce?

If you think that <br> tags in your formula fields are the problem, can you try to substitute them either in controller, or in outputText like this: <apex:outputText value="{!SUBSTITUTE(...
smukov's user avatar
  • 5,613
3 votes

When can or can't I use Wsdl2Apex?

The web based version of WSDL2Apex is ultimately a code generator for WebServiceCallout.invoke. If you use it then you generally get the limitations for both WSDL2Apex and WebserviceCallout.invoke. ...
Daniel Ballinger's user avatar
3 votes

Escape XML Function in VisualForce?

You can use apex:outputText to escape sensitive characters. You can use it like this: <apex:outputText value="{!record.field}" /> There's a parameter called "escape" that defaults to true; in ...
sfdcfox's user avatar
  • 497k
3 votes
Accepted

getChildElement element failing null pointer exception

Your XML has a default namespace defined via the xmlns attribute so you will have to supply the namespace when referencing the elements: String ns ='http://schemas.microsoft.com/search/local/ws/rest/...
Keith C's user avatar
  • 136k
3 votes

permission, permission sets, XML, objects

You can find the appropriate values in the Profile object. The XML looks like: <Profile ...> <classAccesses> <apexClass>MyClass</apexClass> <enabled>...
sfdcfox's user avatar
  • 497k
3 votes
Accepted

Getting error as required field missing

Problem lies in your code at this line newcontacts.add(c); This is part of your outer loop, and it is going to add Contact for every node, be it ContactNode or Not. So you have build a logic around ...
Mahmood's user avatar
  • 5,966
3 votes
Accepted

Consuming xml flat files in Salesforce

If the volume of data is not huge, then the simplest way to read the data is to use Apex's DOM parser: Dom.Document doc = new Dom.Document(); doc.load(xml); and then the various methods that let you ...
Keith C's user avatar
  • 136k
3 votes
Accepted

XML for creating Metadata with SOAP API

The request body is alright except for the xsi:type="ns0:Metadata" attribute. Instead of the abstract ns0:Metadata, that should read ns0:CustomObject for example: <soap-env:Header> <ns0:...
Matt and Neil's user avatar
3 votes
Accepted

How to generated the below XMlStructure Based on list size?

Try with this Apex provides classes that enable you to work with XML content using the DOM (Document Object Model). Execute below code in anonymous window, List<Product_for_Sample_Literature__c&...
NITHESH K's user avatar
  • 2,535
3 votes
Accepted

NamedCredential soap request authentication headers

In your Named Credential configuration, make sure you specify "Allow Merge Fields in HTTP Body", which will allow you to use the merge fields from your Named Credential. Then, use the $Credential ...
sfdcfox's user avatar
  • 497k
3 votes
Accepted

Extra content at the end of the document While generating xml from Apex

In order to get it working just right, you need to pay careful attention to extra line breaks in your code. I created the following in my org: <apex:page controller="q203222" contentType="text/xml;...
sfdcfox's user avatar
  • 497k
3 votes

Deflate XML for custom SAML integration?

You can find Visualforce code that implements a JavaScript deflate algorithm online as part of the PlantUML integration here: https://github.com/rsoesemann/plantuml4force It may be a round-about ...
snugsfbay's user avatar
  • 966
3 votes
Accepted

Issue with mapping the fields when there is an apex webservice xml response

You need to go down a further level in the nodes: Dom.Document doc = httpRe.getBodyDocument(); Dom.XMLNode result = doc.getRootElement(); String vinDate= result.getChildElement('date', null).getText(...
Keith C's user avatar
  • 136k

Only top scored, non community-wiki answers of a minimum length are eligible