• Rebecca Hendricks 9
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 3
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 4
    Replies
Hello,

I'm not getting my code to work out, and believe it is the result of a conflict between the Trigger I've created and a Process builder that was created.  However, for the life of me, I can't figure out where the error in my logic is happening.

Background:
My boss would like to know how many times our Reps have a 30 minute lag between creating/editing tasks.  There are two ways that a task can be created/edited: 1) directly creating/editing a new task from the contact and/or opportunity, and 2) Automatically from a process that is launched when a new contact is created.

As the task can be created as the first actions of the day, as well as not really having a good way of knowing how this task relates to others in the system, I've created some custom fields that will hold a flag on whether it was the first activity of the day (which will always have more than a 30 minutes gap since the last activity action) and whether it was created within 30 minutes of the last task action.  It is these fields that my trigger will update.

Trigger code:
trigger UpdateActivityFlags on Task (before insert, before update) {
    
    Boolean within30Mins = Boolean.valueOf('true');	//assume task was created more than 30 mins since last activity modification
    String userID = UserInfo.getUserId();	//Get User Id for task owner
    DateTime rightNow = system.now();	//get the date/time of when the task is being created
    Date rightNowDate = date.newInstance(rightNow.year(), rightNow.month(), rightNow.day());	//date part only of date/time task is being created
    Task mostRecentTask;
    Date mostRecentTaskDate;
    
    //Need to get most recent activity information
    try{
        mostRecentTask = [SELECT id, LastModifiedDate, LastModifiedTime__c, EditedWithin30MinsOfLastTask__c, Subject
                          FROM Task 
                          Where OwnerId = :userID AND LastModifiedTime__c < :rightNow 
                          ORDER BY LastModifiedTime__c Desc 
                          Limit 1];
        mostRecentTaskDate = Date.newInstance(mostRecentTask.LastModifiedDate.year(), mostRecentTask.LastModifiedDate.month()
                                              , mostRecentTask.LastModifiedDate.day());	//get date portion of most recent activity modification
    } catch(Exception e){
        System.debug('There were no previous tasks for this user. Error information: Type - ' + e.getTypeName() + ' ;  Message - ' + e.getMessage());
    }
    
    //Check if task was created within 30 mins of last activity modification
    //if(mostRecentTask != NULL){	//There IS a previous task to compare myself to
    //    if((rightNow.getTime() - mostRecentTask.LastModifiedTime__c.getTime()) < 1800000 // 30 mins = 1.8E6 milliseconds
    //        || mostRecentTask.Subject.containsAny('- 2 Week Followup') || mostRecentTask.Subject.containsAny('- 2 Month Followup')
    //      ){	
    //        within30Mins = True;
    //    }
    //}
    
    if(mostRecentTask != NULL){	//There IS a previous task to compare myself to
        if(Trigger.isInsert){
            if((rightNow.getTime() - mostRecentTask.LastModifiedTime__c.getTime()) >= 1800000
               && !mostRecentTask.Subject.containsAny('- 2 Week Followup') && !mostRecentTask.Subject.containsAny('- 2 Month Followup')
              ){	
                  within30Mins = false;
              }
        }
        else{
            if((rightNow.getTime() - mostRecentTask.LastModifiedTime__c.getTime()) >= 1800000){
                within30Mins = false;
            }
        }
        
    }
    
    //update flag information
    for (Task t : Trigger.New){
        t.EditedWithin30MinsOfLastTask__c = within30Mins;
        if(mostRecentTask == NULL){	//no previous tasks owned by user
            t.FirstActivityofDay__c = True;	//no other activities means that this is the first one they are creating
        } else {
            if((Date.valueOf(rightNowDate).daysBetween(mostRecentTaskDate)) != 0){	//task creating and last activity modification are not on the same day
                t.FirstActivityOfDay__c = True;
            }
            t.PreviousTaskDateTime__c = mostRecentTask.LastModifiedTime__c;
        }
    }
}
the commented out code is when I set the initial value of the Boolean to false.  However, this really didn't work for the automatic notifications items, so I tried to approach it from the reverse.

Process information for 2 day "automatic" task:
User-added image

Process for 2 week task creation:
User-added image

Process for 2 Month task creation:
User-added image

Questions-Information:
As I stated, as the trigger is on before insert and before update, I think the Process is creating the task, and that is activating the trigger.  However, I thought my trigger had taken into account this information with the check for the subject information.  (I should mention that the words searched for are exactly what is "coded" in the process, and will be the only time this exact phrase is used.)  Even though I've got the information placed into the process, I believe the trigger would over-write it, but thought the subject inclusion would have caught the over-writing and still given it the value it needed, but that's not the case, as my "within 30 minutes" field is not populating with a True value as it should be for these.

Should I be having my trigger execute on After Insert and After Update information, and then update the information on that task again?
 
Hello. I'm trying to create a report for my boss that shows the number of Activities that were created within 30 minutes of the previous activity for each of our reps.  Having done some research on this, I thought the best way to go about it would be to have a custom field (checkbox) that would indicate if the task was created within 30 minutes of the previous activity, and another custom field (checkbox) that would indicate if the task was the first activity of the day.  (If it's the first activity modification of the day, I don't want it to be counted as not being within 30 minutes of the last activity modification, as the Rep wasn't on duty to make any modifications.)

I was trying to create a trigger to be "ran" anytime an Activity was created/modified that would execute SOQl to get the most recently modified task, and then compare the information to set the two flags previously mentioned.  I looked at previous apex codes to get the syntax as I'm new to Apex.  The "copied" syntax compiled and saved in the previous versions, but my current code is giving me a lot of errors on the Problems tab of Developer console.

Here's my code.  (I know proper code shouldn't be heavily commented, but I did it to assist you to follow what I am trying to accomplish as you can't see my org structure, as well as help any future non-coding background employees know what was going on, which may be very possible with my employer).
trigger UpdateActivityFlags on Task (before insert, before update) {
    
    Boolean within30Mins = new Boolean();	//determine if this task was created before within 30 mins of last activity
    String userID = UserInfo.getUserId();	//Get User Id for task owner
    DateTime rightNow = system.now();	//get the date/time of when the task is being created
    Date rightNowDate = date.newInstance(rightNow.year(), rightNow.month(), rightNow.day())	//date part only of date/time task is being created
    
    //Need to get most recent activity information
    Task mostRecentTask = [SELECT * FROM Task Where OwnerId = userID AND LastModifiedTime__c < rightNow ORDER BY LastModifiedTime__c Desc Limit 1];
    
    Date mostRecentTaskDate = date.newInstance(mostRecentTask.LastModifiedTime__c.year(), mostRecentTask.LastModifiedTime__c.month()
                                               , mostRecentTask.LastModifiedTime__c.day());	//gets date portion of most recent activity modification
    
    if(((rightNow - mostRecentTask.LastModifiedTime)*24*60) <= 30){	//this task was created within 30 mins of last activity modification
        within30Mins = True;
    }
    
    //update flag information
    for (Task t : Trigger.New){
        t.CreationWithin30MinsOfLastTask = within30Mins;
        if((rightNowDate - mostRecentTaskDate) <> 0){	//task creating and last activity modification are not on the same day
            FirstActivityOfDay = True;
        }
    }
    
}

The errors I'm getting are:
  • Type cannot be constructed: Boolean on line 3
  • Unexpected token 'rightNowDate' on Line 6
  • Unexpted token '=' on line 6
  • Unexpected toke '(' on line 6
  • Unexpected token 'mostRecentTask' on line 9
  • Unexpected token '=' on line 9 (I actually have 2 separate errors on this one)
  • Unexpected token '[' on line 9
  • Unexpected token 'Where' on line 9
  • Unexpected token 'AND' on line 9
  • Unexpected token '<' on line 9
  • Unexpected token 'ORDER' on line 9
  • Unexpected token 'BY' on line 9
  • Unexpected token 'Desc' on line 9
  • Unexpected token '1' on line 9
  • Variable does not exist: mostRecentTask.LastModifiedTime__c on lines 11 & 12
  • Variable does not exist: mostRecentTask on line 14
  • Variable does not exist: CreationWithin30MinsOfLastTask on line 20
  • Variable does not exist: rightNowDate on line 21
  • Variable does not exist: FirstActivityOfDay on line 22
I understand what the errors are stating (it can't find the variable, it can't be created, etc.), but I don't understand why they are being thrown as the syntax is the same as other code that has passed just fine.  Help would be very much appreciated.
I'm new to developing in Salesforce and am working on the Define Custom Big Objects unit in Trailhead.  I understand that I'm supposed to make Rider_History__b.object file as well as a rider_history.permissionset and package.xml file.  However, I don't know how to actually begin the process on how to get these files created.

I understand that once it's created I can then use the Workbench to upload the zip file into my trailhead environment, but I can't do that until after the files have actually been created.  How do I do that????  Is it done in an Apex class? Or is it done as a different type of item in the Developer Console? Or is it done a completely different way.

Remember, I'm a newb when it comes to this stuff, so you may need to be a bit more specific than with a more experienced developer.
I am trying to complete the Lightning Experience Specialist Superbadge but am stuck on Step 4.  I have everything set up pretty similarly to what is listed in the other posts on this forum.  However, when I try and create my Action to update the Account Package (Opportunity Line Item), I can't seem to locate the Needs Insurance and Needs Waiver fields in the field section of the Action properties.

I have already confirmed that the fields do exist in my Adventure Package (Opportunity Line Item) object.
User-added image

Yet, when I try to create the Action in my flow and select the Adventure Package (OpportunityLineItem) as the Record Type, I these fields do not appear in my Field options.
User-added image

Does anybody know why these fields aren't listed as options?  I've passed the previous stages just fine, and believe I need to have these fields in order to pass this stage.....
I am trying to complete the Trailhead project to Incorporate Data from the Weather Company in Salesforce.  I've gotten to the Create a Lightning Component to Display the Weather unit, and have created the Apex controller class, and the Lightning Component bundle, copying the code as provided in the unit.  However, when I try to add the component to the page I get an "A Component Error has occurred!" Error.  This is what the error looks like:
User-added image

I am wondering what is causing this error, as I copied the code directly as it was located in the trailhead and have followed the directions exactly.  Any help would be appreciated.
I am trying to complete the Trailhead item to Build a Cat Rescue App, but I'm getting stuck at the Install Einstein Vision Apex Wrappers unit.  I have created an Einstein Platform Account and received the "welcome aboard" email, and have installed the third-party package and set up the email as per the trail instructions.  However, when I click to verify the step I get a "System.NullPointerException: null argument for JSONGenerator.writeStringField()" error.

I've searched the forum on this error, and each post states this is the result of not putting in the proper email.  I have already confirmed that the email address I have put into the Email item in custom settings is the same email that received the "welcome aboard" email when I set up the Platform account.  I repeat, this is not due to an incorrect email entered into the custom settings as I have confirmed I have entered the same email address that got the welcome aboard email from the Salesforce Einstein Team.

Does anybody know what could be causing this error?  I have also tried deleting and re-installing the package.  I have installed for System Admins only and for All users, still getting the same error.  I have also tried installing it using an incognito error, with no resolution.  Any assistance would be much appreciated!!
I'm trying to complete the Use SOAP API unit and am getting the "UNKNOWN_EXCEPTION: Destination URL not reset." error.  I have the Session ID and the URL prefix I from my login.  Looking at the other posts, I understand this error is that I have not redirected the URL to go to my specific instance server.  However, I don't see where to put in the <serverURL> tag into the code?

When the code was originally generated from the create, there was no <serverURL> tag already in existance for me to overwrite.  There also is no URL already listed on the page for salesforce for me to overwrite as suggested in the other posts.  Does ANYBODY know where I can put in the URL (which I have) into my SOAP UI to get it to correct this error?????
I am trying to complete the Trailhead project to Incorporate Data from the Weather Company in Salesforce.  I've gotten to the Create a Lightning Component to Display the Weather unit, and have created the Apex controller class, and the Lightning Component bundle, copying the code as provided in the unit.  However, when I try to add the component to the page I get an "A Component Error has occurred!" Error.  This is what the error looks like:
User-added image

I am wondering what is causing this error, as I copied the code directly as it was located in the trailhead and have followed the directions exactly.  Any help would be appreciated.
I'm trying to complete the Apex Specialist Superbadge.  I have created my WarehouseCalloutService apex class and it seems to match how others have created their class.  However when I run my code and then try and check the challenge, I'm getting the error that seems many others are getting about the Challenge Not Yet Complete.... "The runWarehouseEquipmentSync method does not appear to have run successfully. Could not find a successfully completed @future job for this method. Make sure that you run this method at least one before attempting this challenge. Since this method is annotated with the @future method, you may want to wait for a few seconds to ensure that it has processed successfully."

Here is my code:
public with sharing class WarehouseCalloutService {

    private static final String endpoint = 'https://th-superbadge-apex.herokuapp.com/equipment';

    @future(callout = true)	//need this so that it knows to call to external source
    public static void runWarehouseEquipmentSync(){
        Http http = new Http();
        HttpRequest httpRequest = new HttpRequest();
        httpRequest.setEndpoint(endpoint);
        httpRequest.setMethod('GET');
        HttpResponse httpResponse = http.send(httpRequest);
        
        //if successfully get the JSON file, need to parse out to different equipment objects
        if (httpResponse.getStatusCode() == 200){ //status = "OK" (this is for GET or HEAD requests)
            List<Object> equipmentList = (List<Object>) JSON.deserializeUntyped(httpResponse.getBody());
            List<Product2> products = new List<Product2>();
            
            for(Object item: equipmentList){
                Map<String, Object> productMap = (Map<String,Object>) item;	//map of item(s) in JSON file
                Product2 product = new Product2();	//list of products to insert/update in system
                
                product.Replacement_Part__c = (Boolean) productMap.get('replacement');
                product.Cost__c = (Integer) productMap.get('cost');                
                product.Current_Inventory__c = (Integer) productMap.get('quantity');
                product.Lifespan_Months__c = (Integer) productMap.get('lifespan');
                product.Maintenance_Cycle__c = (Integer) productMap.get('maintenanceperiod');
                product.Warehouse_SKU__c = (String) productMap.get('sku');
                product.Name = (String) productMap.get('name');
                product.ProductCode = (String) productMap.get('_id');
                products.add(product);
            }
            
            if(products.size() > 0){	//only need to upsert if items actually exist
                System.debug(products);
                upsert products;
            }
        }
    }
}

According to some other strings I have found on this error (https://developer.salesforce.com/forums/?id=906F0000000kE7DIAU), this is what I've looked at and the current status of it:
  • Field Level Security for Lifespan_Months__c field on Equipment (Product2) object: Visible for All profiles
  • User-added image
  • Remote Site Settings: Added this URL as a Remote Site and confirmed it is active - https://th-superbadge-apex.herokuapp.com
  • User-added image
  • Apex Jobs: Confirmed it is listed in Apex Jobs log and that it's listing as a "Future" job type and a "Completed" status.
  • User-added image
  • Execution Log: Confirmed that it shows that 1 of 50 Future classes were executed.
  • User-added image
  • SOQL Query: Confirmed that the job was placed into the system.
  • User-added image

Any assistance as to why I am not getting a complete on this task would be much appreciated!
Hello,

I'm not getting my code to work out, and believe it is the result of a conflict between the Trigger I've created and a Process builder that was created.  However, for the life of me, I can't figure out where the error in my logic is happening.

Background:
My boss would like to know how many times our Reps have a 30 minute lag between creating/editing tasks.  There are two ways that a task can be created/edited: 1) directly creating/editing a new task from the contact and/or opportunity, and 2) Automatically from a process that is launched when a new contact is created.

As the task can be created as the first actions of the day, as well as not really having a good way of knowing how this task relates to others in the system, I've created some custom fields that will hold a flag on whether it was the first activity of the day (which will always have more than a 30 minutes gap since the last activity action) and whether it was created within 30 minutes of the last task action.  It is these fields that my trigger will update.

Trigger code:
trigger UpdateActivityFlags on Task (before insert, before update) {
    
    Boolean within30Mins = Boolean.valueOf('true');	//assume task was created more than 30 mins since last activity modification
    String userID = UserInfo.getUserId();	//Get User Id for task owner
    DateTime rightNow = system.now();	//get the date/time of when the task is being created
    Date rightNowDate = date.newInstance(rightNow.year(), rightNow.month(), rightNow.day());	//date part only of date/time task is being created
    Task mostRecentTask;
    Date mostRecentTaskDate;
    
    //Need to get most recent activity information
    try{
        mostRecentTask = [SELECT id, LastModifiedDate, LastModifiedTime__c, EditedWithin30MinsOfLastTask__c, Subject
                          FROM Task 
                          Where OwnerId = :userID AND LastModifiedTime__c < :rightNow 
                          ORDER BY LastModifiedTime__c Desc 
                          Limit 1];
        mostRecentTaskDate = Date.newInstance(mostRecentTask.LastModifiedDate.year(), mostRecentTask.LastModifiedDate.month()
                                              , mostRecentTask.LastModifiedDate.day());	//get date portion of most recent activity modification
    } catch(Exception e){
        System.debug('There were no previous tasks for this user. Error information: Type - ' + e.getTypeName() + ' ;  Message - ' + e.getMessage());
    }
    
    //Check if task was created within 30 mins of last activity modification
    //if(mostRecentTask != NULL){	//There IS a previous task to compare myself to
    //    if((rightNow.getTime() - mostRecentTask.LastModifiedTime__c.getTime()) < 1800000 // 30 mins = 1.8E6 milliseconds
    //        || mostRecentTask.Subject.containsAny('- 2 Week Followup') || mostRecentTask.Subject.containsAny('- 2 Month Followup')
    //      ){	
    //        within30Mins = True;
    //    }
    //}
    
    if(mostRecentTask != NULL){	//There IS a previous task to compare myself to
        if(Trigger.isInsert){
            if((rightNow.getTime() - mostRecentTask.LastModifiedTime__c.getTime()) >= 1800000
               && !mostRecentTask.Subject.containsAny('- 2 Week Followup') && !mostRecentTask.Subject.containsAny('- 2 Month Followup')
              ){	
                  within30Mins = false;
              }
        }
        else{
            if((rightNow.getTime() - mostRecentTask.LastModifiedTime__c.getTime()) >= 1800000){
                within30Mins = false;
            }
        }
        
    }
    
    //update flag information
    for (Task t : Trigger.New){
        t.EditedWithin30MinsOfLastTask__c = within30Mins;
        if(mostRecentTask == NULL){	//no previous tasks owned by user
            t.FirstActivityofDay__c = True;	//no other activities means that this is the first one they are creating
        } else {
            if((Date.valueOf(rightNowDate).daysBetween(mostRecentTaskDate)) != 0){	//task creating and last activity modification are not on the same day
                t.FirstActivityOfDay__c = True;
            }
            t.PreviousTaskDateTime__c = mostRecentTask.LastModifiedTime__c;
        }
    }
}
the commented out code is when I set the initial value of the Boolean to false.  However, this really didn't work for the automatic notifications items, so I tried to approach it from the reverse.

Process information for 2 day "automatic" task:
User-added image

Process for 2 week task creation:
User-added image

Process for 2 Month task creation:
User-added image

Questions-Information:
As I stated, as the trigger is on before insert and before update, I think the Process is creating the task, and that is activating the trigger.  However, I thought my trigger had taken into account this information with the check for the subject information.  (I should mention that the words searched for are exactly what is "coded" in the process, and will be the only time this exact phrase is used.)  Even though I've got the information placed into the process, I believe the trigger would over-write it, but thought the subject inclusion would have caught the over-writing and still given it the value it needed, but that's not the case, as my "within 30 minutes" field is not populating with a True value as it should be for these.

Should I be having my trigger execute on After Insert and After Update information, and then update the information on that task again?
 
I'm trying to complete the Use SOAP API unit and am getting the "UNKNOWN_EXCEPTION: Destination URL not reset." error.  I have the Session ID and the URL prefix I from my login.  Looking at the other posts, I understand this error is that I have not redirected the URL to go to my specific instance server.  However, I don't see where to put in the <serverURL> tag into the code?

When the code was originally generated from the create, there was no <serverURL> tag already in existance for me to overwrite.  There also is no URL already listed on the page for salesforce for me to overwrite as suggested in the other posts.  Does ANYBODY know where I can put in the URL (which I have) into my SOAP UI to get it to correct this error?????

Hi,

 

I got the below error, when I create Lead record from Java application using Partner WSDL web service call.

 

AxisFault
 faultCode: UNKNOWN_EXCEPTION
 faultSubcode:
 faultString: UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from login must be set in the SforceService
 faultActor:
 faultNode:
 faultDetail:
    {urn:fault.partner.soap.sforce.com}UnexpectedErrorFault:<ns1:exceptionCode>UNKNOWN_EXCEPTION</ns1:exceptionCode><ns1:exceptionMessage>Destination URL not reset. The URL returned from login must be set in the SforceService</ns1:exceptionMessage>

UNKNOWN_EXCEPTION: Destination URL not reset. The URL returned from login must be set in the SforceService
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at org.apache.axis.encoding.ser.BeanDeserializer.<init>(BeanDeserializer.java:104)
    at org.apache.axis.encoding.ser.BeanDeserializer.<init>(BeanDeserializer.java:90)
    at com.sforce.soap.partner.fault.UnexpectedErrorFault.getDeserializer(UnexpectedErrorFault.java:84)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.apache.axis.encoding.ser.BaseDeserializerFactory.getSpecialized(BaseDeserializerFactory.java:154)
    at org.apache.axis.encoding.ser.BaseDeserializerFactory.getDeserializerAs(BaseDeserializerFactory.java:84)
    at org.apache.axis.encoding.DeserializationContext.getDeserializer(DeserializationContext.java:464)
    at org.apache.axis.encoding.DeserializationContext.getDeserializerForType(DeserializationContext.java:547)
    at org.apache.axis.message.SOAPFaultDetailsBuilder.onStartChild(SOAPFaultDetailsBuilder.java:157)
    at org.apache.axis.encoding.DeserializationContext.startElement(DeserializationContext.java:1035)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(Unknown Source)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(Unknown Source)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
    at javax.xml.parsers.SAXParser.parse(Unknown Source)
    at org.apache.axis.encoding.DeserializationContext.parse(DeserializationContext.java:227)
    at org.apache.axis.SOAPPart.getAsSOAPEnvelope(SOAPPart.java:696)
    at org.apache.axis.Message.getSOAPEnvelope(Message.java:435)
    at org.apache.axis.transport.http.HTTPSender.readFromSocket(HTTPSender.java:796)
    at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:144)
    at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
    at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
    at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
    at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
    at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
    at org.apache.axis.client.Call.invoke(Call.java:2767)
    at org.apache.axis.client.Call.invoke(Call.java:2443)
    at org.apache.axis.client.Call.invoke(Call.java:2366)
    at org.apache.axis.client.Call.invoke(Call.java:1812)
    at com.sforce.soap.partner.SoapBindingStub.create(SoapBindingStub.java:2657)
    at org.teg.iagent.PartnerAgentProcessor.start(PartnerAgentProcessor.java:482)
    at org.teg.iagent.PartnerAgentProcessor.main(PartnerAgentProcessor.java:82)

 

and, below is my code to set field values, which I retrieved from a POJO object.

 

    public MessageElement createNewXmlElement(String Name, String nodeValue) throws Exception {

        MessageElement msgElement;
        DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
        DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
        Document document = documentBuilder.newDocument();
        
        Element xmlEle = document.createElement(Name);
        xmlEle.appendChild(document.createTextNode(nodeValue));

        msgElement = new MessageElement(xmlEle);

        return msgElement;
    }

 

I found similar issue in the forum and I am sure, I never called getUserinfo method before the session created. Can anyone help me out from this issue.

 

Regards,

SuBaa

  • April 23, 2012
  • Like
  • 0