• sandhubals
  • NEWBIE
  • 15 Points
  • Member since 2011


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 12
    Replies
I can't find a way to insert the field values of the parent object that are being used in the fieldset on the child object. Below is my code and I get the null values. I can only successfully insert the values in the Job object. Not sure if my approach is correct to use the parent object fields in the child fieldset.


public with sharing class fieldsetJobApplication
{
// Job object has a lookup to the Candidate object
// The fieldset is on the Job object and is referring few fields on the Candidate object
// From the VF page on insert the values into the Job object are inserted fine but the fieldset values on the Candidate object remain null

public Job__c jA {get;set;}
public Candidate__c jC {get;set;}

public fieldsetJobApplication()
{
jA = new Job__c();
jC = new Candidate__c();
}

public PageReference save()
{
assignValues();

// Insert Candidate record
insert jC;
// Provide the parent Id to child record for reference
jA.Candidate__c = jC.Id;

// All below show as null values on System.debug
System.debug('jA.Interviewer__c : ' + jA.Candidate__r.Interviewer__c);
System.debug('jA.Start_Date__c : ' + jA.Candidate__r.Start_Date__c);
System.debug('jA.Education__c : ' + jA.Candidate__r.Education__c);

System.debug('jC.Interviewer__c : ' + jC.Interviewer__c);
System.debug('jC.Start_Date__c : ' + jC.Start_Date__c);
System.debug('jC.Education__c : ' + jC.Education__c);

insert jA;

return new pagereference('/'+jA.id);
}

public List getFldsJA()
{
return SObjectType.Job__c.FieldSets.JA_Fieldset.getFields();
}
}

// VF Markup

<apex:page controller="fieldsetJobApplication">
     <apex:form >
        <apex:pageMessages />
        <apex:pageBlock title="Job Application">
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}" />
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Job Application and Candidate Fields" >
                <apex:repeat value="{!FldsJA}" var="j">
                    <apex:inputField value="{!jA[j]}" />
                </apex:repeat>
            </apex:pageBlockSection>
  </apex:pageBlock>
  </apex:form>      
</apex:page>


Hello All,

I need an urgent help, how can I directly show the record to the sales rep in Edit mode instead of showing record detail page after Pre Chat form creates the case and contact record.
Can it be done use pre-chat API?
I can't find a way to insert the field values of the parent object that are being used in the fieldset on the child object. Below is my code and I get the null values. I can only successfully insert the values in the Job object. Not sure if my approach is correct to use the parent object fields in the child fieldset.


public with sharing class fieldsetJobApplication
{
// Job object has a lookup to the Candidate object
// The fieldset is on the Job object and is referring few fields on the Candidate object
// From the VF page on insert the values into the Job object are inserted fine but the fieldset values on the Candidate object remain null

public Job__c jA {get;set;}
public Candidate__c jC {get;set;}

public fieldsetJobApplication()
{
jA = new Job__c();
jC = new Candidate__c();
}

public PageReference save()
{
assignValues();

// Insert Candidate record
insert jC;
// Provide the parent Id to child record for reference
jA.Candidate__c = jC.Id;

// All below show as null values on System.debug
System.debug('jA.Interviewer__c : ' + jA.Candidate__r.Interviewer__c);
System.debug('jA.Start_Date__c : ' + jA.Candidate__r.Start_Date__c);
System.debug('jA.Education__c : ' + jA.Candidate__r.Education__c);

System.debug('jC.Interviewer__c : ' + jC.Interviewer__c);
System.debug('jC.Start_Date__c : ' + jC.Start_Date__c);
System.debug('jC.Education__c : ' + jC.Education__c);

insert jA;

return new pagereference('/'+jA.id);
}

public List getFldsJA()
{
return SObjectType.Job__c.FieldSets.JA_Fieldset.getFields();
}
}

// VF Markup

<apex:page controller="fieldsetJobApplication">
     <apex:form >
        <apex:pageMessages />
        <apex:pageBlock title="Job Application">
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}" />
            </apex:pageBlockButtons>
            <apex:pageBlockSection title="Job Application and Candidate Fields" >
                <apex:repeat value="{!FldsJA}" var="j">
                    <apex:inputField value="{!jA[j]}" />
                </apex:repeat>
            </apex:pageBlockSection>
  </apex:pageBlock>
  </apex:form>      
</apex:page>


Greetings...

I have had great success in using .net and the associated API Enterprise generated WSDL and Web Reference for about a year.  I've also used the API in the Sandbox.  I hadn't made a change to the Sandbox or the Production for a couple of months.  Today I did the following in Firefox (I have had more success generating and downloading the WSDL in Firefox)

- Went to Settings/Develop/API/Generate Enterprise WSDL and clicked the GENERATE button to the right of "Generate Enterprise WSDL"
- The result in Firefox was not the normal formatted XML that I had seen in the past (perhaps the update to Firefox did this) What appeared was what looked like one big paragraph of sentences (no xml tags)
-  I right clicked in the white area of the page and "saved as"  test.wsdl
- When I opened test.wsdl, it looked like it alwas does...properly formed XML

Next in VS, I changed the Web Reference property to the Test.wsdl file name and Updated my Web Reference

======================================
Now the issue (finaly)
======================================

When I try to create an instance of SforceService like the code below:

                    SforceService sfService = new SforceService();

I get the following exception:

2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.Name InvalidOperationException
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.Message Unable to generate a temporary class (result=1).
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.Message error CS0030: Cannot convert type 'Mozenda.Business.Salesforce.ListViewRecordColumn[]' to 'Mozenda.Business.Salesforce.ListViewRecordColumn'
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.Message error CS0030: Cannot convert type 'Mozenda.Business.Salesforce.ListViewRecordColumn[]' to 'Mozenda.Business.Salesforce.ListViewRecordColumn'
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.Message error CS0029: Cannot implicitly convert type 'Mozenda.Business.Salesforce.ListViewRecordColumn' to 'Mozenda.Business.Salesforce.ListViewRecordColumn[]'
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.Message error CS0029: Cannot implicitly convert type 'Mozenda.Business.Salesforce.ListViewRecordColumn' to 'Mozenda.Business.Salesforce.ListViewRecordColumn[]'
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.Source System.Xml
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.StackTrace at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.StackTrace    at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies)
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.StackTrace    at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.StackTrace    at System.Xml.Serialization.XmlSerializer.GetSerializersFromCache(XmlMapping[] mappings, Type type)
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.StackTrace    at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Type type)
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.StackTrace    at System.Web.Services.Protocols.SoapClientType..ctor(Type type)
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.StackTrace    at System.Web.Services.Protocols.SoapHttpClientProtocol..ctor()
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.StackTrace    at Mozenda.Business.Salesforce.SforceService..ctor()
2014-09-11 16:35:30.000  Warning SalesforceClient.Connect Exception.Exception.StackTrace    at Mozenda.Business.SalesforceClient.SalesForceClient.Connect()


There is alot if information about "Unable to generate a temporary class (result=1)" doing a Google search, but nothing seems to apply.

- Has Salesforce changed how the Enterprise WSDL is created?

Thanks in advance!!

Russ






Here is my form code. I'm trying to create a lead record from the pre-chat form if one does not already exist.

<form method='post' id='prechatForm'>
    First Name:<font color="red">*</font><input type="text" name="liveagent.prechat:FirstName" /><br />
    Last Name:<font color="red">*</font> <input type="text" name="liveagent.prechat:LastName" /><br />
    Email:<font color="red">*</font> <input type="text" name="liveagent.prechat:Email" /><br />
    Phone Number:<font color="red">*</font> <input type='text' name='liveagent.prechat:Phone' /><br />
    Company Name:<font color="red">*</font> <input type='text' name='liveagent.prechat:Company' /><br />
    State:<font color="red">*</font> <select name="liveagent.prechat:State">
          <option value='Select State' selected='selected'>Select State</option>
          <option value='AK'>AK</option>
          <option value='AL'>AL</option>
          <option value='AR'>AR</option>
          <option value='AZ'>AZ</option><option value='CA'>CA</option><option value='CO'>CO</option><option value='CT'>CT</option><option value='DE'>DE</option><option value='FL'>FL</option><option value='GA'>GA</option><option value='HI'>HI</option><option value='IA'>IA</option><option value='ID'>ID</option><option value='IL'>IL</option><option value='IN'>IN</option><option value='KS'>KS</option><option value='KY'>KY</option><option value='LA'>LA</option><option value='MA'>MA</option><option value='MD'>MD</option><option value='ME'>ME</option><option value='MI'>MI</option><option value='MN'>MN</option><option value='MO'>MO</option><option value='MS'>MS</option><option value='MT'>MT</option><option value='NC'>NC</option><option value='ND'>ND</option><option value='NE'>NE</option><option value='NH'>NH</option><option value='NJ'>NJ</option><option value='NM'>NM</option><option value='NV'>NV</option><option value='NY'>NY</option><option value='OH'>OH</option><option value='OK'>OK</option><option value='OR'>OR</option><option value='PA'>PA</option><option value='RI'>RI</option><option value='SC'>SC</option><option value='SD'>SD</option><option value='TN'>TN</option><option value='TX'>TX</option><option value='UT'>UT</option><option value='VA'>VA</option><option value='VT'>VT</option><option value='WA'>WA</option><option value='WI'>WI</option><option value='WV'>WV</option><option value='WY'>WY</option>
        </select><br />
        <br/><font color="red">*</font>Indicates a required field.<br /><br />
        <!-- Saves values entered in the pre-chat fields to the chat transcript -->
        <input type="hidden" name="liveagent.prechat.save:FirstName" value="First_Name__c" />
        <input type="hidden" name="liveagent.prechat.save:LastName" value="Last_Name__c" />
        <input type="hidden" name="liveagent.prechat.save:Email" value="Email__c" />
        <input type="hidden" name="liveagent.prechat.save:Phone" value="Phone__c" />
        <input type="hidden" name="liveagent.prechat.save:Company" value="Company__c" />
        <input type="hidden" name="liveagent.prechat.save:State" value="State__c" />
       
<!-- Map lead fields  -->
<input type="hidden" name="liveagent.prechat.findorcreate.map:Lead" value="FirstName,FirstName;LastName,LastName;Email,Email;" />

<!-- Match lead by email -->
<input type="hidden" name="liveagent.prechat.findorcreate.map.doFind:Lead" value="Email,true;" />
<input type="hidden" name="liveagent.prechat.findorcreate.map.isExactMatch:Lead" value="Email,true;" />

<!-- Create unmatched lead -->
<input type="hidden" name="liveagent.prechat.findorcreate.map.doCreate:Lead" value="FirstName,true;LastName,true;Email,true;" />

<!-- Save lead to lookup -->
<input type="hidden" name="liveagent.prechat.findorcreate.saveToTranscript:Lead" value="Lead" />

<!-- Display lead -->
<input type="hidden" name="liveagent.prechat.findorcreate.showOnCreate:Lead" value="true" />

    <input type='submit' value='Request Chat' id='prechat_submit'/> 
</form>
  • February 11, 2014
  • Like
  • 1

Is it possible to share an AES key between Salesforce and another application? I know there is the Crypto.generateAesKey() method, but I can't use that key in a PHP application to decrypt the data later. Is it possible to generate my own AES key from a string, then use that string as the AES key in both applications?

When prompted by the apex data loader I enter my salesforce.com username and password, but this message keeps appearing:

Error logging in to Salesforce. Please check your username and password.

When I login to salesforce.com with the same username and password it works.

Does anyone know why I can't login to the data loader?


Message Edited by Lkc037 on 12-11-2007 11:49 AM
  • December 11, 2007
  • Like
  • 0