• Deepika Gulati
  • NEWBIE
  • 30 Points
  • Member since 2012
  • Salesforce Expert

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 19
    Replies
Hi All,

We are trying to access a SOAP WS exposed on Microsoft Dynamics by the client. The WSDL that they shared does not have any login method nor any parameters to set the username and password. But upon accessing the end point URL on the browser it asks for credentials and we are able to authenticate based on the given values.  

But when we are trying to call the WS from SOAP as well as SFDC but getting  authentication error. 

For SOAP client we are getting the following error : 
Tue May 24 17:03:54 IST 2016:INFO:219.65.96.233:7057 requires authentication with the realm 'null'
Tue May 24 17:03:54 IST 2016:DEBUG:Found credentials
Tue May 24 17:03:54 IST 2016:DEBUG:Attempt 2 to execute request
Tue May 24 17:03:54 IST 2016:DEBUG:Sending request: POST /WSUrl
Tue May 24 17:03:54 IST 2016:DEBUG:Receiving response: HTTP/1.1 401 Unauthorized
Tue May 24 17:03:54 IST 2016:DEBUG:Connection can be kept alive indefinitely
Tue May 24 17:03:54 IST 2016:DEBUG:Target requested authentication

While on accessing the service through SFDC, following is the error that we are getting : 
IO Exception : External server did not return any content. 

Also when we tried accessing the same service through .Net application, we were able to hit the server and POST the data. 
The .Net application is using the following code to set the credentails which we are not able to do in SFDC
objCustlistS.Credentials = new System.Net.NetworkCredential("username", "password", "domain");

Could somebody help us in solving this MSD - SFDC integration. 
Is there something we should add in header to make a request equivalent to System.Net.NetCredential of .Net. 

Or there is some specific SFDC adapaters to enable Integration. 

Thanks in advance
Deepika

Hi,

 

I am getting this error "java.net.SocketTimeoutException" when trying to Query Records on Task object Exactly one minute after the Query was triggered.

Is this Related to Network issues or because of the Query getting timed out.

As accoding to API docs, Query takes 2 minutes to get timed out so not sure of the second cause.

Can any body please help in this.

 

Below are the error logs:

 

 [07-Jan-2013 04:00:07:825 INFO  GenerateFile main]  Going to fetch Task record from SFDC .....
[07-Jan-2013 04:00:07:825 INFO  QuerySFDC main]  Query string prepared : Select Name,Value__c from Merkle_Config__c
[07-Jan-2013 04:00:08:543 INFO  QuerySFDC main]  Query string prepared : Select  t.id,t.Primary_Reason__c, t.Primary_Disposition__c, t.OwnerId, t.CreatedDate, t.CallType, t.ANI__c ,t.WhoId,t.WhatId From Task t where  t.RecordType.Name in('CTI Inbound Record','CTI Outbound Record')  and (t.Primary_Disposition__c   != null and t.Primary_Disposition__c !='Order Started') and  t.What.Id  != null and t.Sent_to_Merkle__c=false  and t.CreatedDate=LAST_N_DAYS:7
[07-Jan-2013 04:00:42:466 INFO  QuerySFDC main]  Query string prepared : Select  t.id,t.Primary_Reason__c, t.Primary_Disposition__c, t.OwnerId, t.CreatedDate, t.CallType, t.ANI__c ,t.WhoId,t.WhatId From Task t where t.RecordType.Name in('CTI Inbound Record','CTI Outbound Record')  and (t.Primary_Disposition__c   != null and t.Primary_Disposition__c!='Order Started') and t.What.Id  = null and t.whoId !=null and t.Sent_to_Merkle__c=false  and t.CreatedDate=LAST_N_DAYS:7
[07-Jan-2013 04:01:43:076 ERROR EnterpriseSession main]  Exception in EnterpriseSession: query: RemoteException:-; nested exception is: 
 java.net.SocketTimeoutException: Read timed out
[07-Jan-2013 04:01:43:076 ERROR QuerySFDC main]  Failed to get Call__c from SFDC succesfully, the error message was: Error while creating binding soap service; nested exception is:
 java.net.SocketTimeoutException: Read timed out
[07-Jan-2013 04:01:43:076 ERROR GenerateFile main]  Failed to get Tasks from SFDC succesfully, the error message was: Error while creating binding soap service; nested exception is:
 java.net.SocketTimeoutException: Read timed out

 

 

Thanks

HI,

 

I have come one rquirement as Follows:

 

 

" During upload, execute the transformation below and enforce uniqueness of all records based on all 9 columns of this object.

Also Tag(one of the Field) should be case-insensitive, spaces stripped out, and transformed to all lower-case during data upload. "

 

 

Please provide a Solution to enforce Uniqueness and  Transform the Data during data Upload.

 

 

Thanks.

Hello,

 

  1. on my PC (windows 7 & using IE8) I am having trouble when clicking on the Custom Button that opens a VF page – i have to log in again and then it opens the VF page.

 

However

 

2.  when I use another W7 & IE8 machine,  and logging in as  some User,  everything works ok, 

 

And

 

3. When using my W7 Machine, logging in as same user  but using firefox,  everything is ok.

 

 

My VF page has an action attribute calling a Method in Controller class as soon as it loads.

Also it use the DataTable and output panel to display the Lists populated in the Controller method.

I am not able to resolve this issue.

 

Can somebody plz help me.

 

Thanks i Advance

Regards

 

 

Hi,

 

 i want to Put  a Proper message that appears when we Hover mouse on Custom Button.

Currently the Field Label comes as message when Mouse is Hovered on it. I want to put  a customised message.

Is it possible?

 

Please help me with that.

 

Thanks

 

 

Hi,

 

I have a Requirement to implement a code in which we when we enter already existing Reference Number, alert Box pops up with 'Yes' and 'No' button,

If Yes is clicks it overrides the value in on the Task Detail page and closes the VF page.

If No is clicked it remains on the Same Page.

 

 

Currently i am using following VF page code:

 

<apex:page standardController="Task" extensions="ParentChildActivity" action="{!childTaskDetails}"   >
       <apex:form id="form1" >
            <apex:outputPanel id="jspanel">
                <script type="text/javascript">
                      function closeWindow()
                      {
                            if({!error})
                            {
                                opener.location.reload();
                                window.close();
                             }
                             else           
                             {
                                alert('TRN is not Valid!');
                             }
                                          
                      }
               </script>  
          </apex:outputPanel>
         <style  type="text/css">
             .header1{
                 background-color:#DCDBD8;
                 text-align:center;
                 padding:12px;
                     }
         </style>
        
        
     <apex:outputPanel id="pnlAddTRN" style="margin:10px;height:350px;overflow-Y:auto;" layout="block">
         <apex:pageBlock id="pb1" >
               <apex:pageBlockSection id="pbs1" collapsible="true" columns="4" title="Add Parent">
                  <apex:outputLabel value="Activity TRN"></apex:outputLabel>
                  <apex:inputText value="{!trn}" required="true"/>
                  <apex:commandButton value="GO" oncomplete="closeWindow()" action="{!searchAndUpdate}"    style="header1"/>
                  <apex:outputLink value="/{!$CurrentPage.parameters.id}"><font color="red" ><b> Cancel </b></font></apex:outputLink>            
               </apex:pageBlockSection>
         </apex:pageBlock>

 <apex:pageBlock id="searchResults" rendered="{!errorAlertC}">
            <apex:pageBlockSection title="Child Activities" rendered="{!errorAlertC}" >
                <apex:dataTable value="{!childTasks}" var="child" border="2px" columnsWidth="10px"  frame="border"  title="Child Activities" headerClass="header1" rendered="{!errorAlertC}" >
                    <apex:column >
                        <apex:facet name="header">
                            Subject
                        </apex:facet>
                        <apex:outputLink value="/{!child.id}" target="_blank">{!child.subject}</apex:outputLink>
                    </apex:column>
           
                    <apex:column >
                        <apex:facet name="header">
                            Related To
                        </apex:facet>
                        <apex:outputField value="{!child.whatId}" style="padding:5px"></apex:outputField>
                    </apex:column>

                   <apex:column >           
                        <apex:facet name="header">
                            Name
                        </apex:facet>
                        <apex:outputField value="{!child.WhoId}" style="padding:5px"></apex:outputField>
                   </apex:column>

                    <apex:column >
                       <apex:facet name="header">
                            Type
                       </apex:facet>
                       <apex:outputText value="{!child.Type}" style="padding:5px"></apex:outputText>
                   </apex:column>


                   <apex:column >
                       <apex:facet name="header">
                            Status
                       </apex:facet>
                       <apex:outputText value="{!child.status}" style="padding:5px"></apex:outputText>
                   </apex:column>

                   <apex:column >
                       <apex:facet name="header">
                            CIDN
                       </apex:facet>
                       <apex:outputText value="{!child.Customer_CIDN__c}" style="padding:5px"></apex:outputText>
                   </apex:column>
           
                   <apex:column >
                       <apex:facet name="header">
                            Activity TRN
                       </apex:facet>
                       <apex:outputText value="{!child.Activity_TRN__c}" ></apex:outputText>
                   </apex:column>

                   <apex:column >
                       <apex:facet name="header">
                            Priority
                       </apex:facet>
                       <apex:outputText value="{!child.Priority}" ></apex:outputText>
                   </apex:column>
                 
                   <apex:column >
                        <apex:facet name="header">
                        Activity Date   
                        </apex:facet>
                        <apex:outputField value="{!child.ActivityDate}" style="padding:5px"></apex:outputField>
                    </apex:column>

 

                   <apex:column >
                        <apex:facet name="header">
                            Assigned To
                        </apex:facet>
                        <apex:outputField value="{!child.ownerId}" style="padding:5px"></apex:outputField>
                    </apex:column>

 

                </apex:dataTable>
           
           </apex:pageBlockSection>
       
        </apex:pageBlock>

</apex:outputpanel>

</apex:form>

</apex:page>

 

 

 

 

I need urgent help in this.


              

 

 

hi,

 

Following is the Controller and VF page Code:

 

public class ParentChildActivity{
public final task t1;
public final task o;
public String trn;
public String taskIdDemo;
public String ActivityTRN{get;set;}
public Boolean errorAlert{get; set;}
public Integer flag{get; set;}
List<Task> taskObjects=new List<Task>();

public ParentChildActivity(ApexPages.StandardController stdController)
    {   
        this.o= (Task)stdController.getRecord();
        taskIdDemo=o.Id;
       
       t1=[Select Activity_TRN__c,Id from Task where id=:o.Id];
        System.debug('Task Id is '+ t1.Id);

    }
public void settrn(String xTRN)
    {
        trn=xTRN;
    }
public String gettrn()
    {
    return trn;
    }
public PageReference searchAndUpdate()
    {
        for(Task t: [Select Id,Activity_TRN__c,Parent_Activity_TRN__c from Task where Activity_TRN__c=:TRN])
        {
            System.debug('Task Id is in SearchAndUpdate'+t.Id);
            System.debug('Activity TRN is'+t.Activity_TRN__c);
            System.debug('Parent Activity'+t.Parent_Activity_TRN__c);
            if(t1.Id!=t.Id && t1.Activity_TRN__c==t.Parent_Activity_TRN__c)
            {
            flag=2;
            }
            if(t1.Id!=t.Id && t1.Activity_TRN__c!=t.Parent_Activity_TRN__c)
            {
            taskObjects.add(t);
            }
         }
        System.debug('Task Objects is '+ taskObjects);
        if(taskObjects.size()>0)
        {
        flag=1;
        errorAlert=true;
            for(Task t:[Select Id,Activity_TRN__c from task where Id in: taskObjects])
            {
                System.debug('Activity TRN is'+t.Activity_TRN__c);
                t1.Parent_Activity_TRN__c=t.Activity_TRN__c;
                t1.Parent_Activity_TaskId__c=t.Id;
                t1.SalesForceURL__c=URL.getSalesforceBaseUrl().toExternalForm()+'/'+t.id;
                System.debug('Salesforce URL is'+t1.SalesForceURL__c);
                update(t1);
             }
         }
         else
         {
             flag=3;
             errorAlert=false;             
             return null;
          }
     PageReference pageRef = new PageReference('/' + taskIdDemo);           
     pageRef.setRedirect(true);     
     return pageRef;
       }
}

 

 

<apex:page standardController="Task" extensions="ParentChildActivity"  >
    <script type="text/javascript">
      function closeWindow()
        {
          if({!flag==1})
            {
            opener.location.reload();
            window.close();
            }
            else if({!flag==2})           
            {
            alert(' it is the Child of this Task  ');
            }

           else if({!flag==3})

           {

           alert('Invalid TRN');

           }
          }
     </script>

    <apex:form id="form1" >
        <apex:pageBlock id="pb1" >

            <apex:pageBlockSection id="pbs1" collapsible="true" columns="4">
                   <apex:outputLabel value="Activity TRN"></apex:outputLabel>
                  <apex:inputText value="{!trn}"/>
                  <apex:commandButton oncomplete="closeWindow()" value="GO" action="{!searchAndUpdate}" />
                  <apex:outputLink value="/{!$CurrentPage.parameters.id}"><font color="red"><b> Cancel </b></font></apex:outputLink>            
            </apex:pageBlockSection>
        </apex:pageBlock>

    </apex:form>

    <apex:detail subject="{!task.Parent_Activity_TaskId__c}" relatedList="false" />

</apex:page>

 

 

 

 

 

I want to display different error messages for different scenarios:

The Java Script code is not giving me alert box. Can someone Please Help me with this.

Hi,

I have a requirement in which when i click on a custom button "generate eID" eID is generated.  A Vf page is used as mediator to call the controller method with the taskid of the current task  and the eID is generated and populated.

 

Now if the eID is already available and still we click on the button i want to display the error message on the top of the Detail page of current task.

 

Currently i have displayed the message on the VF page and with the Link to go back to the current task. but that takes to much time.

 

 

The Controller Class

 

public class eIDController {
public string theID{get; set;} 
public Boolean errorAlert=false;
private final Task o;
// Constructor used to fetch the current Record   
public eIDController(ApexPages.StandardController stdController) 
{    
    this.o = (Task)stdController.getRecord();    
}            
   
//Method making the callout to WrapperDummy class
public PageReference autoRun() 
{    
    List<ID> TaskIds=new List<ID>();
//It extracts the Id of the Current Record
    String theId = ApexPages.currentPage().getParameters().get('id');
    if(theId!=null)    
    {     
        for(Task t:[select ID,Activity__c,CustomerIdentity__c from Task where id=:theId])      
        {
//It checks if the Activity  is null
            if(t.Activity___c==null && t.CustomerIdentity__c != null){
            TaskIds.add(t.ID);
            }
//If it is Not Null it Throws An Error message
            else if(t.Activity__c!=null && t.CustomerIdentity__c != null){
                errorAlert=true;
                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'Activity already exists'));
                return null;
            }
            else if(t.Activity_TRN__c==null && t.Customer_CIDN__c == null){
                errorAlert=true;
                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'Customer Identity is Null'));
                return null;
            }
        }
        update TaskIds;

     }                        
    PageReference pageRef = new PageReference('/' + theId);        
    pageRef.setRedirect(true);            
    return pageRef;
    }
}

 

 

 

 

VF page:

 

<apex:page standardController="Task" extensions="eIDController" tabStyle="Task" action="{!autoRun}">
<apex:form >
<apex:sectionHeader title="Auto-Running Apex Code"/>  
<apex:pageblock >
<apex:pageMessages >
</apex:pageMessages>
<apex:outputPanel >
     Click <apex:outputLink value="/{!$CurrentPage.parameters.id}"> Here </apex:outputLink> to return to the Custom object record
  </apex:outputPanel>

</apex:pageblock>
</apex:form>
</apex:page>

 

 

 i want to display the error message in the form of alert box on the Detail Page or in the form of error on the top of Detail page.

 

addError, javascript can be an option but not sure how to implement it

Hi,

I have a requirement in which when i click on a custom button "generate eID" eID is generated.  A Vf page is used as mediator to call the controller method with the taskid of the current task  and the eID is generated and populated.

 

Now if the eID is already available and still we click on the button i want to display the error message on the top of the Detail page of current task.

 

Currently i have displayed the message on the VF page and with the Link to go back to the current task. but that takes to much time.

 

 

The Controller Class

 

public class eIDController {
public string theID{get; set;} 
public Boolean errorAlert=false;
private final Task o;
// Constructor used to fetch the current Record   
public eIDController(ApexPages.StandardController stdController) 
{    
    this.o = (Task)stdController.getRecord();    
}            
   
//Method making the callout to WrapperDummy class
public PageReference autoRun() 
{    
    List<ID> TaskIds=new List<ID>();
//It extracts the Id of the Current Record
    String theId = ApexPages.currentPage().getParameters().get('id');
    if(theId!=null)    
    {     
        for(Task t:[select ID,Activity__c,CustomerIdentity__c from Task where id=:theId])      
        {
//It checks if the Activity  is null
            if(t.Activity___c==null && t.CustomerIdentity__c != null){
            TaskIds.add(t.ID);
            }
//If it is Not Null it Throws An Error message
            else if(t.Activity__c!=null && t.CustomerIdentity__c != null){
                errorAlert=true;
                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'Activity already exists'));
                return null;
            }
            else if(t.Activity_TRN__c==null && t.Customer_CIDN__c == null){
                errorAlert=true;
                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'Customer Identity is Null'));
                return null;
            }
        }
        update TaskIds;

     }                        
    PageReference pageRef = new PageReference('/' + theId);        
    pageRef.setRedirect(true);            
    return pageRef;
    }
}

 

 

 

 

VF page:

 

<apex:page standardController="Task" extensions="eIDController" tabStyle="Task" action="{!autoRun}">
<apex:form >
<apex:sectionHeader title="Auto-Running Apex Code"/>  
<apex:pageblock >
<apex:pageMessages >
</apex:pageMessages>
<apex:outputPanel >
     Click <apex:outputLink value="/{!$CurrentPage.parameters.id}"> Here </apex:outputLink> to return to the Custom object record
  </apex:outputPanel>

</apex:pageblock>
</apex:form>
</apex:page>

 

 

 i want to display the error message in the form of alert box on the Detail Page or in the form of error on the top of Detail page.

 

addError, javascript can be an option but not sure how to implement it

Hi Guys,
 am trying to delete some accounts and contact in my sandbox org using data loader, Code in dev console or by delete button but I am getting An unknown exception has occurred error.
Do you have any idea why I am getting this error, any workaround to fix this error?
I am logged in as Sys Admin Profile UserButton errorDataloader Error fileDev Console Error
Thanks,
Rahul
  • September 20, 2021
  • Like
  • 0
Hi All - I have a requirement for email to case creation, if the email subject contais set of keywords (we have 100+ keywords) then the case should be assigned to particular queue name. can someone suggest the best approach that we can achieve this scenario? Thanks
Hello Devs,

I am having trouble getting an Output Value from a Flow Action. Whenever I call the action in Flow, it returns as 'Outputs:
{!oanda_exchange_rate} = oandaExchangeRateList ([OandaExchangeRate__c (No ID)])'. I'm not sure what "No ID" means so I can't really debug that. Eventually I want to insert this data into the database. Below are the steps of what I am doing:

1. Input data into the Action Element via Invocable Variables
2. The inputted data pings an API and returns some a JSON that is transformed into an object type and creates multiple objects
3. The objects are saved into a Output Invocable Variable for use in Flow.
4. I save that list of objects into a Record Collection Variable in Flow
5. I run the debugger and I see "Outputs:
{!oanda_exchange_rate} = oandaExchangeRateList ([OandaExchangeRate__c (No ID)])'" as the output.

Not sure where I am going wrong here.

Flow Resource Configuration

Flow Resource Configuration

Action Configration

Action Configuration


Outputs Values After Debugging
Outputs Value

Sample Data of Output Being Passed Into Flow
(methodOutputs:[oandaExchangeRateList=(OandaExchangeRate__c:{Base_Currency__c=EUR, Quote_Currency__c=EUR, Average_Exchange_Rate__c=1.000000, Id=null})])

 
I have  Entitlement Template Releted list on product . I need to fetch Product With entitlement ,How can i do that .
Thank you
Hi,
I have two objects i.e; Invoice and Account. Invoice is a custom object, in invoice object, I have a master detail field called "customer name__c". I want to populate the customer name field with account name while creating a new record in invoice object. I have tried with process builder and flows to populate the account name but I can't update it.

So, Any suggestion how to update it through trigger?

Thanks,
Kezia
Hello All - Hope someone can help with the issue I am facing. A few users in my org have recently got Win 7 IE 8 update. After that, when they go to login.salesforce.com and enter credentials, SFDC does not allow the access. But when they open a new IE tab or window and then try to login again, it works. It is happening to many people, but not all. We tried deleting cookies, passwords etc, but that did not help. Has any one had similar problems? If so, how was it fixed? Thanks in advance for your help. Regards, Girish

Hi,

 

I have a Requirement to implement a code in which we when we enter already existing Reference Number, alert Box pops up with 'Yes' and 'No' button,

If Yes is clicks it overrides the value in on the Task Detail page and closes the VF page.

If No is clicked it remains on the Same Page.

 

 

Currently i am using following VF page code:

 

<apex:page standardController="Task" extensions="ParentChildActivity" action="{!childTaskDetails}"   >
       <apex:form id="form1" >
            <apex:outputPanel id="jspanel">
                <script type="text/javascript">
                      function closeWindow()
                      {
                            if({!error})
                            {
                                opener.location.reload();
                                window.close();
                             }
                             else           
                             {
                                alert('TRN is not Valid!');
                             }
                                          
                      }
               </script>  
          </apex:outputPanel>
         <style  type="text/css">
             .header1{
                 background-color:#DCDBD8;
                 text-align:center;
                 padding:12px;
                     }
         </style>
        
        
     <apex:outputPanel id="pnlAddTRN" style="margin:10px;height:350px;overflow-Y:auto;" layout="block">
         <apex:pageBlock id="pb1" >
               <apex:pageBlockSection id="pbs1" collapsible="true" columns="4" title="Add Parent">
                  <apex:outputLabel value="Activity TRN"></apex:outputLabel>
                  <apex:inputText value="{!trn}" required="true"/>
                  <apex:commandButton value="GO" oncomplete="closeWindow()" action="{!searchAndUpdate}"    style="header1"/>
                  <apex:outputLink value="/{!$CurrentPage.parameters.id}"><font color="red" ><b> Cancel </b></font></apex:outputLink>            
               </apex:pageBlockSection>
         </apex:pageBlock>

 <apex:pageBlock id="searchResults" rendered="{!errorAlertC}">
            <apex:pageBlockSection title="Child Activities" rendered="{!errorAlertC}" >
                <apex:dataTable value="{!childTasks}" var="child" border="2px" columnsWidth="10px"  frame="border"  title="Child Activities" headerClass="header1" rendered="{!errorAlertC}" >
                    <apex:column >
                        <apex:facet name="header">
                            Subject
                        </apex:facet>
                        <apex:outputLink value="/{!child.id}" target="_blank">{!child.subject}</apex:outputLink>
                    </apex:column>
           
                    <apex:column >
                        <apex:facet name="header">
                            Related To
                        </apex:facet>
                        <apex:outputField value="{!child.whatId}" style="padding:5px"></apex:outputField>
                    </apex:column>

                   <apex:column >           
                        <apex:facet name="header">
                            Name
                        </apex:facet>
                        <apex:outputField value="{!child.WhoId}" style="padding:5px"></apex:outputField>
                   </apex:column>

                    <apex:column >
                       <apex:facet name="header">
                            Type
                       </apex:facet>
                       <apex:outputText value="{!child.Type}" style="padding:5px"></apex:outputText>
                   </apex:column>


                   <apex:column >
                       <apex:facet name="header">
                            Status
                       </apex:facet>
                       <apex:outputText value="{!child.status}" style="padding:5px"></apex:outputText>
                   </apex:column>

                   <apex:column >
                       <apex:facet name="header">
                            CIDN
                       </apex:facet>
                       <apex:outputText value="{!child.Customer_CIDN__c}" style="padding:5px"></apex:outputText>
                   </apex:column>
           
                   <apex:column >
                       <apex:facet name="header">
                            Activity TRN
                       </apex:facet>
                       <apex:outputText value="{!child.Activity_TRN__c}" ></apex:outputText>
                   </apex:column>

                   <apex:column >
                       <apex:facet name="header">
                            Priority
                       </apex:facet>
                       <apex:outputText value="{!child.Priority}" ></apex:outputText>
                   </apex:column>
                 
                   <apex:column >
                        <apex:facet name="header">
                        Activity Date   
                        </apex:facet>
                        <apex:outputField value="{!child.ActivityDate}" style="padding:5px"></apex:outputField>
                    </apex:column>

 

                   <apex:column >
                        <apex:facet name="header">
                            Assigned To
                        </apex:facet>
                        <apex:outputField value="{!child.ownerId}" style="padding:5px"></apex:outputField>
                    </apex:column>

 

                </apex:dataTable>
           
           </apex:pageBlockSection>
       
        </apex:pageBlock>

</apex:outputpanel>

</apex:form>

</apex:page>

 

 

 

 

I need urgent help in this.


              

 

 

hi,

 

Following is the Controller and VF page Code:

 

public class ParentChildActivity{
public final task t1;
public final task o;
public String trn;
public String taskIdDemo;
public String ActivityTRN{get;set;}
public Boolean errorAlert{get; set;}
public Integer flag{get; set;}
List<Task> taskObjects=new List<Task>();

public ParentChildActivity(ApexPages.StandardController stdController)
    {   
        this.o= (Task)stdController.getRecord();
        taskIdDemo=o.Id;
       
       t1=[Select Activity_TRN__c,Id from Task where id=:o.Id];
        System.debug('Task Id is '+ t1.Id);

    }
public void settrn(String xTRN)
    {
        trn=xTRN;
    }
public String gettrn()
    {
    return trn;
    }
public PageReference searchAndUpdate()
    {
        for(Task t: [Select Id,Activity_TRN__c,Parent_Activity_TRN__c from Task where Activity_TRN__c=:TRN])
        {
            System.debug('Task Id is in SearchAndUpdate'+t.Id);
            System.debug('Activity TRN is'+t.Activity_TRN__c);
            System.debug('Parent Activity'+t.Parent_Activity_TRN__c);
            if(t1.Id!=t.Id && t1.Activity_TRN__c==t.Parent_Activity_TRN__c)
            {
            flag=2;
            }
            if(t1.Id!=t.Id && t1.Activity_TRN__c!=t.Parent_Activity_TRN__c)
            {
            taskObjects.add(t);
            }
         }
        System.debug('Task Objects is '+ taskObjects);
        if(taskObjects.size()>0)
        {
        flag=1;
        errorAlert=true;
            for(Task t:[Select Id,Activity_TRN__c from task where Id in: taskObjects])
            {
                System.debug('Activity TRN is'+t.Activity_TRN__c);
                t1.Parent_Activity_TRN__c=t.Activity_TRN__c;
                t1.Parent_Activity_TaskId__c=t.Id;
                t1.SalesForceURL__c=URL.getSalesforceBaseUrl().toExternalForm()+'/'+t.id;
                System.debug('Salesforce URL is'+t1.SalesForceURL__c);
                update(t1);
             }
         }
         else
         {
             flag=3;
             errorAlert=false;             
             return null;
          }
     PageReference pageRef = new PageReference('/' + taskIdDemo);           
     pageRef.setRedirect(true);     
     return pageRef;
       }
}

 

 

<apex:page standardController="Task" extensions="ParentChildActivity"  >
    <script type="text/javascript">
      function closeWindow()
        {
          if({!flag==1})
            {
            opener.location.reload();
            window.close();
            }
            else if({!flag==2})           
            {
            alert(' it is the Child of this Task  ');
            }

           else if({!flag==3})

           {

           alert('Invalid TRN');

           }
          }
     </script>

    <apex:form id="form1" >
        <apex:pageBlock id="pb1" >

            <apex:pageBlockSection id="pbs1" collapsible="true" columns="4">
                   <apex:outputLabel value="Activity TRN"></apex:outputLabel>
                  <apex:inputText value="{!trn}"/>
                  <apex:commandButton oncomplete="closeWindow()" value="GO" action="{!searchAndUpdate}" />
                  <apex:outputLink value="/{!$CurrentPage.parameters.id}"><font color="red"><b> Cancel </b></font></apex:outputLink>            
            </apex:pageBlockSection>
        </apex:pageBlock>

    </apex:form>

    <apex:detail subject="{!task.Parent_Activity_TaskId__c}" relatedList="false" />

</apex:page>

 

 

 

 

 

I want to display different error messages for different scenarios:

The Java Script code is not giving me alert box. Can someone Please Help me with this.

Hi,

I have a requirement in which when i click on a custom button "generate eID" eID is generated.  A Vf page is used as mediator to call the controller method with the taskid of the current task  and the eID is generated and populated.

 

Now if the eID is already available and still we click on the button i want to display the error message on the top of the Detail page of current task.

 

Currently i have displayed the message on the VF page and with the Link to go back to the current task. but that takes to much time.

 

 

The Controller Class

 

public class eIDController {
public string theID{get; set;} 
public Boolean errorAlert=false;
private final Task o;
// Constructor used to fetch the current Record   
public eIDController(ApexPages.StandardController stdController) 
{    
    this.o = (Task)stdController.getRecord();    
}            
   
//Method making the callout to WrapperDummy class
public PageReference autoRun() 
{    
    List<ID> TaskIds=new List<ID>();
//It extracts the Id of the Current Record
    String theId = ApexPages.currentPage().getParameters().get('id');
    if(theId!=null)    
    {     
        for(Task t:[select ID,Activity__c,CustomerIdentity__c from Task where id=:theId])      
        {
//It checks if the Activity  is null
            if(t.Activity___c==null && t.CustomerIdentity__c != null){
            TaskIds.add(t.ID);
            }
//If it is Not Null it Throws An Error message
            else if(t.Activity__c!=null && t.CustomerIdentity__c != null){
                errorAlert=true;
                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'Activity already exists'));
                return null;
            }
            else if(t.Activity_TRN__c==null && t.Customer_CIDN__c == null){
                errorAlert=true;
                ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'Customer Identity is Null'));
                return null;
            }
        }
        update TaskIds;

     }                        
    PageReference pageRef = new PageReference('/' + theId);        
    pageRef.setRedirect(true);            
    return pageRef;
    }
}

 

 

 

 

VF page:

 

<apex:page standardController="Task" extensions="eIDController" tabStyle="Task" action="{!autoRun}">
<apex:form >
<apex:sectionHeader title="Auto-Running Apex Code"/>  
<apex:pageblock >
<apex:pageMessages >
</apex:pageMessages>
<apex:outputPanel >
     Click <apex:outputLink value="/{!$CurrentPage.parameters.id}"> Here </apex:outputLink> to return to the Custom object record
  </apex:outputPanel>

</apex:pageblock>
</apex:form>
</apex:page>

 

 

 i want to display the error message in the form of alert box on the Detail Page or in the form of error on the top of Detail page.

 

addError, javascript can be an option but not sure how to implement it

Is it possible to make a callout from APEX to a SOAP web service that uses NTLM authentication? If so is there documentation and or samples?

 

I was able to generate an apex class from the WSDL but I don't know how to use it with NTLM auth and I have a funny feeling its not even possible.

 

NTLM authentication is always getting in my way (unless I'm building in .NET) but I have no say in what authentication protocol is used.

  • November 29, 2011
  • Like
  • 0

Hii, 

 

I am a newbie. I am looking to do integration between GP and SalesForce. 

 

Can somebody provide me starting inputs on how to go about it.

Any kind of documentation would help.

 

thanks,

Mamta  

I am trying to render a page block section dynamically based on two conditions , on Case Object. These two conditions are picklists. I am using the standard case controller. I haven't created any custom class controller for this.

 

I am not able to do so.. Kindly Help..

 

Following is my Custom Case VF page

<apex:page standardController="Case">
    <apex:sectionHeader title="{!$ObjectType.Case.label} Edit" subtitle="{!Case.Casenumber}"/>
    <apex:form >
    <apex:pageBlock title="{!$ObjectType.Case.label} Edit" mode="edit">
    
        <apex:pageBlockButtons >
            <apex:commandButton action="{!save}" value="Save"/>
            <apex:commandButton action="{!cancel}" value="Cancel"/>   
        </apex:pageBlockButtons>
        <apex:actionRegion >
        <apex:pageBlockSection showHeader="true" title="Case Information" columns="2">
            <apex:pageBlockSectionItem >
                <apex:outputLabel value="Case Owner"/>
                <apex:outputText value="{!Case.Owner.Name}"/>
            </apex:pageBlockSectionItem>
            <apex:inputField required="true" value="{!Case.Status}"/>
            <apex:inputField value="{!Case.Priority}"/>
            <apex:inputField required="true" value="{!Case.ContactId}"/>
            <apex:inputField required="true" value="{!Case.AccountId}"/>
            <apex:inputField required="true" value="{!Case.Origin}"/>
            <apex:inputField value="{!Case.Department__c}"/>
                            
                        <apex:pageBlockSectionItem >
                        <apex:outputLabel value="Case Reason"/>
                        <apex:outputPanel >
                            <apex:inputField value="{!Case.Case_Reason2__c}">
                                <apex:actionSupport event="onchange" rerender="thePageBlock" status="Status"/>
                            </apex:inputField>
                            <apex:actionStatus startText="Loading Client Information Block..." id="Status"/>
                        </apex:outputPanel>
 </apex:pageBlockSectionItem>

            
            <apex:inputField value="{!Case.Account_Set_Up__c}"/>
            <apex:inputField required="true" value="{!Case.FCR__c}"/>
            <apex:inputField value="{!Case.User_Set_up__c}"/>
            <apex:inputField required="true" value="{!Case.Complaint__c}"/>
            <apex:inputField value="{!Case.EChain_Contact__c}"/>
            <apex:inputField required="true" value="{!Case.Route_to_Helpdesk__c}"/>
            <apex:inputField value="{!Case.Escalated_to_Ops_QA__c}"/>
            <apex:inputField value="{!Case.Source__c}"/>
            <apex:inputField value="{!Case.CSE_Case_Number_For_Ops_QA_only__c}"/>
            <apex:inputField value="{!Case.Escalation_Assist_Log__c}"/>
            <apex:inputField value="{!Case.CSR__c}"/>
        </apex:pageBlockSection>
        </apex:actionRegion>
        <apex:pageBlockSection showHeader="true" title="Description Information" columns="1">
            <apex:inputField value="{!Case.Subject}"/>
            <apex:inputField value="{!Case.Description}"/>
            <apex:inputField value="{!Case.Action_Taken__c}"/>
        </apex:pageBlockSection>
        
        <apex:pageBlockSection showHeader="true" title="Dispute Information" columns="2">
            <apex:inputField value="{!Case.Dispute_Investigator__c}"/>
            <apex:inputField value="{!Case.Dispute_Jurisdiction__c}"/>
            <apex:inputField value="{!Case.Dispute_Resolution__c}"/>
            <apex:inputField value="{!Case.Dispute_re__c}"/>
            <apex:inputField value="{!Case.Business_Line__c}"/>
            <apex:inputField value="{!Case.Reason_Detail__c}"/>
        </apex:pageBlockSection>
   <apex:actionRegion >
   <apex:outputPanel id="thePageBlock" rendered="{IF(!Case.Department__c == 'Criminal' && !Case.Case_Reason2__c == 'Applicant Dispute', true, false)}">
   
   
 <apex:pageBlockSection showHeader="true"  title="Client Facing Criminal Dispute Information" columns="2" >
            <apex:inputField value="{!Case.Dispute_initiated_by__c}"/>
            <apex:inputField value="{!Case.Applicant_Name__c}"/>
            <apex:inputField value="{!Case.Client_Name__c}"/>
            <apex:inputField value="{!Case.Jurisdiction_1__c}"/>
            <apex:inputField value="{!Case.Order__c}"/>
            <apex:inputField value="{!Case.Jurisdiction_2_Optional__c}"/>
            <apex:inputField value="{!Case.Client_Email_Address__c}"/>
            <apex:inputField value="{!Case.Jurisdiction_3_Optional__c}"/>
            <apex:inputField value="{!Case.Client_Email_Address_Optional__c}"/>
            <apex:inputField value="{!Case.Applicant_Dispute_Notification__c}"/>
            <apex:inputField value="{!Case.Client_Email_Address_Optional2__c}"/>
            <apex:inputField value="{!Case.Applicant_Dispute_Resolve_Favour__c}"/>
            <apex:inputField value="{!Case.Client_Email_Address_Optional3__c}"/>
            <apex:inputField value="{!Case.Applicant_Dispute_Resolve_Not_Favour__c}"/>
        </apex:pageBlockSection>
       </apex:outputPanel>
       </apex:actionRegion>
    </apex:pageBlock>
    </apex:form>
</apex:page>

 

 

Hello,

 

I am trying to execute a Http Callout to a webservice that is with windows machine and the credentials were given to me as domain\username

password

 

I wrote a simple http callout as mentioned in the docs. Did the base 64 thing for username:pwd but I keep getting

HttpResponse[Status=Unauthorized, StatusCode=401]

 

I tried to put domain as domain\username, domain:username:password with other combinations of moving domain first and last but nothing seems to work.

 

I have my authorizationheader set as follows

 

    Blob headerValue = Blob.valueOf(username + ':' + password);
    String authorizationHeader = 'NTLM ' +   EncodingUtil.base64Encode(headerValue);

 

I tried BASIC above and then tried NTLM too but with same result.

 

Any help is greatly appreciated.

 

Thanks

  • February 23, 2011
  • Like
  • 0

Hello I have a simple controller for a visual force page and need to write the test methods , can someone help me out.

 

Here is the code for the controller 

 

public class EditOveride {
 
 public EditOveride() {}
    
    Id AccountId;
    public EditOveride(ApexPages.StandardController stdController) {
    // get id from URL
        AccountId = ApexPages.currentPage().getParameters().get('id');  
        
      }
   
    public boolean displayPopup {get; set;}
    
     public void showPopup() {
        displayPopup = true;
    }
    
    public  PageReference closePopup() {
           
            displayPopup = false;  

       return new PageReference('/' + AccountId);
    }                     
       
    public PageReference editPage() {      
   
      return new PageReference('/'+AccountId+'/e?retURL=%2F'+AccountId+'&nooverride=1');                                                             
      }   
 
 

I'm trying to work on Outbound messages using an asp.net web service as endpoint but i keep on getting the Read timed out error (viewed from the OM queue delivery status) and not even one of the messages went through.
 
I am almost 100% certain that the code I have is the same as those in the tech note OM sample using C# and the "Building a Listener" article
 
I have turned off my firewall, using a static ip (and could connect to the endpoint).
 
Could it be really be some connectivity issues or i'm just missing something in the implementation.
 
Will try on the different server and post the URL tomorrow. Appreciate any help.