• Jason Christman
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 2
    Likes Given
  • 2
    Questions
  • 5
    Replies
I get this error message from a nightly scheduled batch.  I do not get it all the time just every couple days.  I can run the same job started from a button and it runs fine and does all the updates.  Background for you.  I have a service thought runs a batch that does api call outs to external services to get information back on stats for a campaign.  The stats are for custom fields on the campaign and campaign members.  When I click the button to run the job it runs fine.  But when the job is scheduled to run I get back this
< Access to entity 'Campaign' denied: Entity is not api accessible>
It acts like the job service does not have permissions to perform the udpate. Does anyone know how to fix or get around this issue, any help would be appreciated.  Thanks,
Looking for a clean way to update a record and set its relationship id based on the relationships external_Id field. 
 
sObject sobject = new sObject();
sobject.type = "CustomObject__c";

XmlDocument doc = new XmlDocument();
List<XmlElement> objElements = new List<XmlElement>();

XmlElement nElement = doc.CreateElement("Name");
nElement.InnerText = "TestName";
objElements.add(nElement);

//
//  This does not work but provides example of what I want to do.
// 
XmlElement rElement = doc.CreateElement("Account__r.tsExternal_Id__c");
rElement.InnerText = "External_Id";
objElements.add(rElement);


sobject.Any = objElements.ToArray();
DataLoader does the relationship lookup based on external Ids, I am hoping there is away that does not require for another query to get the actual Id.
 
Looking for a clean way to update a record and set its relationship id based on the relationships external_Id field. 
 
sObject sobject = new sObject();
sobject.type = "CustomObject__c";

XmlDocument doc = new XmlDocument();
List<XmlElement> objElements = new List<XmlElement>();

XmlElement nElement = doc.CreateElement("Name");
nElement.InnerText = "TestName";
objElements.add(nElement);

//
//  This does not work but provides example of what I want to do.
// 
XmlElement rElement = doc.CreateElement("Account__r.tsExternal_Id__c");
rElement.InnerText = "External_Id";
objElements.add(rElement);


sobject.Any = objElements.ToArray();
DataLoader does the relationship lookup based on external Ids, I am hoping there is away that does not require for another query to get the actual Id.
 
I am trying to genrate apex code from WSDL.  and I am getting error message:"Failed to parse wsdl" The error is at following 3 ines:
            <xs:attribute name="FactoryType" type="xs:QName"/>
            <xs:attribute name="Id" type="xs:ID"/>
            <xs:attribute name="Ref" type="xs:IDREF"/>


So I commented it and saleforce is able to parse. Now, when I try to generate code it fails:

Unsupported schema type: {http://www.w3.org/2001/XMLSchema}unsignedByte

Please help me. I am totally lost.
The WSDL is as follows:
 
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions name="PartnerAdvantageService" targetNamespace="http://tempuri.org/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsap="http://schemas.xmlsoap.org/ws/2004/08/addressing/policy" xmlns:wsa10="http://www.w3.org/2005/08/addressing" xmlns:tns="http://tempuri.org/" xmlns:msc="http://schemas.microsoft.com/ws/2005/12/wsdl/contract" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsx="http://schemas.xmlsoap.org/ws/2004/09/mex" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
	<wsdl:types>
		<xs:schema elementFormDefault="qualified" targetNamespace="http://tempuri.org/" xmlns:xs="http://www.w3.org/2001/XMLSchema">
			<xs:import namespace="http://schemas.datacontract.org/2004/07/Pelco.SalesForce.WcfServices.PartnerAdvantage"/>
			<xs:element name="FindCompanies">
				<xs:complexType>
					<xs:sequence>
						<xs:element minOccurs="0" name="territories" nillable="true" type="xs:string"/>
						<xs:element minOccurs="0" name="searchText" nillable="true" type="xs:string"/>
					</xs:sequence>
				</xs:complexType>
			</xs:element>
			<xs:element name="FindCompaniesResponse">
				<xs:complexType>
					<xs:sequence>
						<xs:element minOccurs="0" name="FindCompaniesResult" nillable="true" type="q1:ArrayOfCompanyModel" xmlns:q1="http://schemas.datacontract.org/2004/07/Pelco.SalesForce.WcfServices.PartnerAdvantage"/>
					</xs:sequence>
				</xs:complexType>
			</xs:element>
		</xs:schema>
		<xs:schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://schemas.microsoft.com/2003/10/Serialization/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.microsoft.com/2003/10/Serialization/">
			<xs:element name="anyType" nillable="true" type="xs:anyType"/>
			<xs:element name="anyURI" nillable="true" type="xs:anyURI"/>
			<xs:element name="base64Binary" nillable="true" type="xs:base64Binary"/>
			<xs:element name="boolean" nillable="true" type="xs:boolean"/>
			<xs:element name="byte" nillable="true" type="xs:byte"/>
			<xs:element name="dateTime" nillable="true" type="xs:dateTime"/>
			<xs:element name="decimal" nillable="true" type="xs:decimal"/>
			<xs:element name="double" nillable="true" type="xs:double"/>
			<xs:element name="float" nillable="true" type="xs:float"/>
			<xs:element name="int" nillable="true" type="xs:int"/>
			<xs:element name="long" nillable="true" type="xs:long"/>
			<xs:element name="QName" nillable="true" type="xs:QName"/>
			<xs:element name="short" nillable="true" type="xs:short"/>
			<xs:element name="string" nillable="true" type="xs:string"/>
			<xs:element name="unsignedByte" nillable="true" type="xs:unsignedByte"/>
			<xs:element name="unsignedInt" nillable="true" type="xs:unsignedInt"/>
			<xs:element name="unsignedLong" nillable="true" type="xs:unsignedLong"/>
			<xs:element name="unsignedShort" nillable="true" type="xs:unsignedShort"/>
			<xs:element name="char" nillable="true" type="tns:char"/>
			<xs:simpleType name="char">
				<xs:restriction base="xs:int"/>
			</xs:simpleType>
			<xs:element name="duration" nillable="true" type="tns:duration"/>
			<xs:simpleType name="duration">
				<xs:restriction base="xs:duration">
					<xs:pattern value="\-?P(\d*D)?(T(\d*H)?(\d*M)?(\d*(\.\d*)?S)?)?"/>
					<xs:minInclusive value="-P10675199DT2H48M5.4775808S"/>
					<xs:maxInclusive value="P10675199DT2H48M5.4775807S"/>
				</xs:restriction>
			</xs:simpleType>
			<xs:element name="guid" nillable="true" type="tns:guid"/>
			<xs:simpleType name="guid">
				<xs:restriction base="xs:string">
					<xs:pattern value="[\da-fA-F]{8}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{4}-[\da-fA-F]{12}"/>
				</xs:restriction>
			</xs:simpleType>
			<xs:attribute name="FactoryType" type="xs:QName"/>
			<xs:attribute name="Id" type="xs:ID"/>
			<xs:attribute name="Ref" type="xs:IDREF"/>
		</xs:schema>
		<xs:schema elementFormDefault="qualified" targetNamespace="http://schemas.datacontract.org/2004/07/Pelco.SalesForce.WcfServices.PartnerAdvantage" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.datacontract.org/2004/07/Pelco.SalesForce.WcfServices.PartnerAdvantage">
			<xs:complexType name="ArrayOfCompanyModel">
				<xs:sequence>
					<xs:element minOccurs="0" maxOccurs="unbounded" name="CompanyModel" nillable="true" type="tns:CompanyModel"/>
				</xs:sequence>
			</xs:complexType>
			<xs:element name="ArrayOfCompanyModel" nillable="true" type="tns:ArrayOfCompanyModel"/>
			<xs:complexType name="CompanyModel">
				<xs:sequence>
					<xs:element minOccurs="0" name="Address1" nillable="true" type="xs:string"/>
					<xs:element minOccurs="0" name="City" nillable="true" type="xs:string"/>
					<xs:element minOccurs="0" name="CompanyName" nillable="true" type="xs:string"/>
					<xs:element minOccurs="0" name="Country" nillable="true" type="xs:string"/>
					<xs:element minOccurs="0" name="CustomerNumber" nillable="true" type="xs:string"/>
					<xs:element minOccurs="0" name="DateSubmitted" type="xs:dateTime"/>
					<xs:element minOccurs="0" name="PartnerID" type="xs:int"/>
					<xs:element minOccurs="0" name="PartnerLevelDate" type="xs:dateTime"/>
					<xs:element minOccurs="0" name="PartnerLevelName" nillable="true" type="xs:string"/>
					<xs:element minOccurs="0" name="Phone" nillable="true" type="xs:string"/>
					<xs:element minOccurs="0" name="PostalCode" nillable="true" type="xs:string"/>
					<xs:element minOccurs="0" name="ProfileStatus" nillable="true" type="xs:string"/>
					<xs:element minOccurs="0" name="RepFirmName" nillable="true" type="xs:string"/>
					<xs:element minOccurs="0" name="State" nillable="true" type="xs:string"/>
					<xs:element minOccurs="0" name="StatusDate" type="xs:dateTime"/>
					<xs:element minOccurs="0" name="TermsConditionsDate" type="xs:dateTime"/>
					<xs:element minOccurs="0" name="Territory" type="xs:unsignedByte"/>
				</xs:sequence>
			</xs:complexType>
			<xs:element name="CompanyModel" nillable="true" type="tns:CompanyModel"/>
		</xs:schema>
	</wsdl:types>
	<wsdl:message name="IPartnerAdvantageService_FindCompanies_InputMessage">
		<wsdl:part name="parameters" element="tns:FindCompanies"/>
	</wsdl:message>
	<wsdl:message name="IPartnerAdvantageService_FindCompanies_OutputMessage">
		<wsdl:part name="parameters" element="tns:FindCompaniesResponse"/>
	</wsdl:message>
	<wsdl:portType name="IPartnerAdvantageService">
		<wsdl:operation name="FindCompanies">
			<wsdl:input wsaw:Action="http://tempuri.org/IPartnerAdvantageService/FindCompanies" message="tns:IPartnerAdvantageService_FindCompanies_InputMessage"/>
			<wsdl:output wsaw:Action="http://tempuri.org/IPartnerAdvantageService/FindCompaniesResponse" message="tns:IPartnerAdvantageService_FindCompanies_OutputMessage"/>
		</wsdl:operation>
	</wsdl:portType>
	<wsdl:binding name="BasicHttpBinding_IPartnerAdvantageService" type="tns:IPartnerAdvantageService">
		<soap:binding transport="http://schemas.xmlsoap.org/soap/http"/>
		<wsdl:operation name="FindCompanies">
			<soap:operation soapAction="http://tempuri.org/IPartnerAdvantageService/FindCompanies" style="document"/>
			<wsdl:input>
				<soap:body use="literal"/>
			</wsdl:input>
			<wsdl:output>
				<soap:body use="literal"/>
			</wsdl:output>
		</wsdl:operation>
	</wsdl:binding>
	<wsdl:service name="PartnerAdvantageService">
		<wsdl:port name="BasicHttpBinding_IPartnerAdvantageService" binding="tns:BasicHttpBinding_IPartnerAdvantageService">
			<soap:address location="http://pelcosales.schneider-electric.com/PartnerAdvantage/PartnerAdvantageService.svc"/>
		</wsdl:port>
	</wsdl:service>
</wsdl:definitions>
Hi,

I am trying to get myself started with retrieving some inforamtion for saleforce and then save to some local database.
From help, it says 
From Setup, click Develop | API to display the WSDL download page.
Download the appropriate WSDL:

However, when I login and go to developer/API, I just see a message saying:
"Integrate salesforce.com "
 The Force.com platform allows you to easily integrate salesforce.com with your applications, and to build new applications that work with salesforce.com. For complete API documentation, sample code, and developer community, visit http://developer.salesforce.com.

So what I did wrong? Is there some versioning difference or security difference so I don't see the wsdl download page?

Many Thanks
Hi.

In the VF I used the date format as YYYY-MM-dd in the 
<apex:outputText value="{0,date,YYYY/MM/dd}">
Before the last week of the year it was OK. When the new year falls in the  last week of Decemeber comes the issue.
For example
2014:
S   M  T  W Th F Sat
28 29 30 31 1   2 3

In the above calendar 1st Jan of 2015 falls in the Thurusday.So when I viewd the records of 28,29,30 of December 2014 It showed as
2015-12-28
2015-12-29
2015-12-30
2015-12-31

After that I came to know that
@"YYYY" is week-based calendar year.
@"yyyy" is ordinary calendar year.
http://realmacsoftware.com/blog/working-with-date-and-time

cheers
suresh



 
Hey everyone, 

the enterprise WSDL in the soap API exposes a well-known bug in the XmlSerializer in .NET.  Apparently MS has known about the bug since 2009 and has decided not to fix this.  You can read about it here on this link:  https://connect.microsoft.com/VisualStudio/feedback/details/471297

To work around this, I tweaked the WSDL with a dummy attribute.  Everyone that uses .NET with the Enterprise WSDL is going to hit this problem.  Hoping this helps.

<complexType name="ListViewRecord">
  <sequence>
   <element name="columns" type="tns:ListViewRecordColumn" maxOccurs="unbounded"/>
  </sequence>
  <xsd:attribute name="tmp" type="xsd:string" /> <!--Added by Chris Berg per bug found in XML Serializer-->
</complexType>
 
Cheers!