• Jyosi jyosi
  • NEWBIE
  • 125 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 107
    Questions
  • 81
    Replies
Hello All,

I am able to get the jquery working in browser and in mobile browser.
In salesforce one app i have some fields required which i have done through jquery ? I am able to see the fields as required but it wont prompot the message in salesforce one.

Thanks

Regards,
Jyo
Hello Everyone,
I have page when user clicks verify i insert the record and make a callout. In executeWS() i call another call where we update the response from External system. It's get updated and everything works. executeWS() code is below. when i verify i get the status bar ,but the  status bar won't appear on the page until the page gets redirect.
I need to keep the status bar working until the pages the get loaded successfully after the redirect. I need to show user please wait i am updating   the values and getting the page back for the result.

 
<apex:commandButton value="Save As Draft " action="{!saveSample}"  reRender="pgBlckId,table" status="actStatusId"/>
             
             <apex:commandButton value="Verify" action="{!saveSample}" oncomplete="executeWS()" status="actStatusId"  reRender="isSF1"/>
             <apex:actionStatus id="actStatusId" rendered="true" >
             <apex:facet name="start" >
                  <apex:actionFunction name="executeWS" action="{!executeWS}" >
                  <div class="waitingSearchDiv" id="el_loading" style="background-color: #fbfbfb;
                       height: 100%;opacity:0.65;width:100%;"> 
                    <div class="waitingHolder" style="top: 74.2px; width: 91px;">
                        <img class="waitingImage" src="/img/loading.gif" title="Please Wait..." />
                        <span class="waitingDescription">Please Wait...</span>
                    </div>
                </div>
                 </apex:actionFunction>
                </apex:facet>
            </apex:actionStatus>
public PageReference executeWS(){
    bsubmit =validateUserInputs(true);
    system.debug('validateUserInputs ==== '+validateUserInputs(bsubmit));
   if(bsubmit!=true) 
   {
           try{
             if(OrderNumber.get(sampleRecord.Id)==null)
             {
               callout.processSampleOrderRequestCreate(this,samplerecord.Id);
              
               PageRedirect = new PageReference('/apex/XXX?Id='+sampleRecord.Id+'');
               PageRedirect.setRedirect(true);
              }else{
               callout.processSampleOrderChangeRequest(this,samplerecord.Id);
               PageRedirect = new PageReference('/apex/XXX?Id='+sampleRecord.Id+'');
               PageRedirect.setRedirect(true);
              }
        }catch(Exception e)
             {
               system.debug('Exception === '+e.getMessage()); 
             }
           
      }
       return PageRedirect;
   }

Thanks for the help.

Regards,
Jyo
 
Hello All,
I have used google simulator and trying to work in salesforce one app.
I was able to keep design for iphone 6+,but when i simuate in iphone 6/5 tha pageblocktable is not fiting the whole screen .

below is pageblock code which is used to design for 6+
   <apex:outputpanel style="overflow:scroll;height:250px;" layout="block">
        <!-- Begin Order Line Item Information  -->
          <div class="bootstrap" style="padding: 10px;">
         <apex:variable value="{!0}" var="index" />  
         
         
        <apex:pageBlockTable value="{!SampleLineItemWrapperList}" var="sliExt" id="table1"  columnsWidth="style:padding: 10px;">
          
         <apex:column headerValue="No"  style="padding:.5px;width: 90px">
         <apex:outputtext value="{!sliExt.counterWrap}" style="padding:.5px;width: 90px" />
         </apex:column>
       
       <apex:column headerValue="Product"  width="25px" rendered="{!IF(sliExt.sample_Line_Item.Id=null,true,false)}">
       <apex:inputfield value="{!sliExt.sample_Line_Item.Product_No__c}" style="width: 70px;"  onkeypress="return handleEnter(this, event)">
          <apex:actionSupport event="onchange" action="{!BOMExplosion}" rerender="table1" onbeforedomupdate="elementFocus = document.activeElement;"
                                            >
              <apex:param name="T1" value="{!sliExt.counterWrap}" assignTo="{!selectedLineItemIndex}" />
           </apex:actionSupport>
           </apex:inputfield>
        </apex:column>
             
       <apex:column headerValue="Product"  style="padding:.5px;width: 0px" rendered="{!IF(sliExt.sample_Line_Item.Id!=null,true,false)}">
       <apex:outputField value="{!sliExt.sample_Line_Item.Product_No__c}"  style="padding:.5px;width:90px"/>
       </apex:column>
             
       <apex:column headerValue="UOM" style="padding:.5px;width: 40px" rendered="{!IF(sXXiExt.XX.Id=null,true,false)}">
        <apex:inputfield value="{!XX.XX.XX}" style="padding:.5px;width:40px"  id="T1" onkeypress="return handleEnter(this, event)"/>
        </apex:column>
             
        <apex:column headerValue="UOM" width="25px" rendered="{!IF(XX.XX.Id!=null,true,false)}">
         <apex:outputField value="{!XX.XX.XX}" style="width: 10px;" />
        </apex:column>
         
         <apex:column headerValue="Quantity" width="25px">
            <apex:inputfield value="{!XX.XX.XX}" style="width: 40px;"  onkeypress="return handleEnter(this, event)"/>
         </apex:column>
       
          <apex:column headerValue="Avail Qty" style="padding:.5px;width: 90px">
            <apex:outputfield value="{!XX.XX.XX}"  />
         </apex:column>
         
         <apex:column headerValue="Qty Shipped" style="padding:.5px;width: 90px">
            <apex:outputfield value="{!XX.XX.XX}" style="padding:.5px;width: 40px"  />
         </apex:column>
         
          <apex:column headerValue="Shiping Date" style="padding:.5px;width: 90px" >
            <apex:outputfield value="{!XX.XX.XX}" style="padding:.5px;width: 40px"  />
         </apex:column>
         
         
         <apex:column headerValue="Reason for Rejection" style="padding:.5px;width: 90px" >
            <apex:inputfield value="{!XX.XXX.XXX}" style="padding:.5px;width: 90px"  onkeypress="return handleEnter(this, event)"/>
         </apex:column>
         
         
         <apex:column headerValue=""  style="display:none;visibility:hidden;padding:.5px;width:1px">
            <apex:inputfield value="{!sliExt.sample_Line_Item.Country__c}" style="padding:.5px;width: 90px" />
         </apex:column>
          
         </apex:pageBlockTable>
            </div>
            
     <apex:commandButton value="Add5Row" action="{!addRow}" />
  </apex:outputpanel>    


Thaks for the help.

Regards,
Jyo
Hello Every ,

I have visualforce ,with the two button verify and submit.
When user clicks verify button .I insert the records and make a callout to thirdparty.
I get the response where i update the fields.but the updated fields are not reflected in visualforce page( Like i wont be closing the page)
Here is code for the button .

<apex:form id="form">
        <apex:pageBlock mode="edit" id="pgBlckId">
            
            <apex:pageblockbuttons >
             
            <apex:commandButton value="Save As Draft " action="{!saveSample}"  reRender="pgBlckId" status="actStatusId"/>
             <apex:commandButton value="Verify" action="{!saveSample}" oncomplete="executeWS()"   reRender="pgBlckId" status="actStatusId"/>
             <apex:actionStatus id="actStatusId" rendered="true">
             <apex:facet name="start" >
                  <apex:actionFunction name="executeWS" action="{!executeWS}"  >
                  <div class="waitingSearchDiv" id="el_loading" style="background-color: #fbfbfb;
                       height: 100%;opacity:0.65;width:100%;"> 
                    <div class="waitingHolder" style="top: 74.2px; width: 91px;">
                        <img class="waitingImage" src="/img/loading.gif" title="Please Wait..." />
                        <span class="waitingDescription">Please Wait...</span>
                    </div>
                </div>
                 </apex:actionFunction>
                </apex:facet>
            </apex:actionStatus>  
                
           </apex:pageblockbuttons>
   
the excute method

public PageReference executeWS(){
       system.debug('executeWS === '+SAPOrderNumber.get(sampleRecord.Id)+'==='+this.j);
      
       try{
         if(SAPOrderNumber.get(sampleRecord.Id)==null)
         {
          callout.processSampleOrderRequestCreate(this,samplerecord.Id);
         }else{
            callout.processSampleOrderChangeRequest(this,samplerecord.Id);
         }
            /*PageReference pageref = new pagereference('/apex/sampleorderecc');
      pageref.getParameters().put('recordID', samplerecord.Id);
      pageref.setRedirect(true);*/
         }catch(Exception e)
         {
           system.debug('Exception === '+e.getMessage()); 
         }
        return Null;
   }
     

public void processSampleOrderRequestCreate(SampleOrderECC1 obj,Id sampleRecord)
  {
      here i make callout to thirdparty 
}    

 public void processCreateResponse{
  here i updated the records.

}

thanks for the ehlp
I Have class where i am writing all the queries and calling into the other class .
I need to the get the custom setting values from class B to class A and assign to variable in class A.
Here is the code in Class B.
public String ABC()
    {
     List<User> ListUserValues= getCurrentUserInfoById(userinfo.getUserId());
        for(User UserValues :ListUserValues)
        {
          if(UserValues.Location__c=='US')
          {
            AuthenticationSettings__c GLIntegration = AuthenticationSettings__c .getAll().get('SAP_Universal');
             UserName=Integration.User__c;
             Password=ntegration.Password__c;
             EndPoint=ntegration.EndPoint__c;
             UserDet = UserName + ':' + Password;
          }
         }

I need to get UserDet and endpoint variable in Class A.

Can you help me how to get the value into class A.

Thanks for help

Regards,
Jyo
Hello All ,

I need to make the field required in Apex webservices class

I have variable  firstName and it should be mandatory in services 

webservice string firstName; is the syntax.When i generate the schema it's shows as below.
<xsd:element name="firstName" minOccurs="0" type="xsd:string" nillable="true"/>
how to make the minOccurs="1" through apex class
<xsd:element name="firstName" minOccurs="1" type="xsd:string" nillable="true"/>


Thanks for help.

Regards,
Ashok N
 
Hello Everyone,
I have requirment where i need to allow the user to enter the workorder and workorderlinitem.
The workorderlinitem can be entered the with multipe records.I need to have button that increment 5 lines when user click on that button

I got a problem while assiging the values that are entered in page at workorderlinitem
Here is the code for visualforce page and controller

<apex:page tabStyle="WorkOrder" controller="WorkOrdersLineitem">
  <!-- Header WorkOrder Information-->
  <apex:form >

  <apex:pageblock title="WorkOrderDetail" mode="edit" >
   <apex:pageblockButtons >
 
  <apex:commandButton value="Save" action="{!WorkOrderSave}" id="Workordersave"/>
  </apex:pageblockButtons>
  <apex:pageBlockSection title="WorkOrderHeaderInformation" columns="2">
 
  <apex:outputField value="{!workoderrecord.contactId}" />
  <apex:outputField value="{!workoderrecord.AccountId}" />
  <apex:inputfield value="{!workoderrecord.subject}"/><br></br>
  <apex:inputfield value="{!workoderrecord.StartDate}" />
  <apex:inputfield value="{!workoderrecord.EndDate}" />
  <apex:inputfield value="{!workoderrecord.Pricebook2id}"/>
  <apex:inputfield value="{!workoderrecord.RootWorkOrderId}"/>
  <apex:inputfield value="{!workoderrecord.Status}"/>
  <apex:inputfield value="{!workoderrecord.StatusCategory}"/>
  </apex:pageBlockSection>
 
  <!-- Work Order Line Items Information-->

 
   <apex:pageBlockTable value="{!WorkorderLineItemList}" var="c" id="wtable">
   <apex:column headerValue="Ident">
           <apex:outputText value="{!c.ident}"/>
         </apex:column>
         
            <apex:column headerValue="PricebookEntry">
            <apex:inputfield value="{!c.con.PricebookEntryId}"/>
         </apex:column>
         
         <apex:column headerValue="Quantity">
            <apex:inputfield value="{!c.con.Quantity}"/>
         </apex:column>
        
          <apex:column headerValue="Subject">
            <apex:inputfield value="{!c.con.Subject}"/>
         </apex:column>
         
         
          <apex:column headerValue="Status">
            <apex:inputfield value="{!c.con.Status}"/>
         </apex:column>
         
         <apex:column headerValue="StatusCategory">
            <apex:inputfield value="{!c.con.StatusCategory}"/>
         </apex:column>
         
       
   </apex:pageBlockTable>
    
   <apex:commandButton value="Add Row" action="{!addRows}" rerender="wtable">
         <apex:param name="addCount" value="1" assignTo="{!addCount}"/>
      </apex:commandButton>
      <apex:commandButton value="Add 5 Rows" action="{!addRows}" rerender="wtable">
         <apex:param name="addCount" value="5" assignTo="{!addCount}"/>
      </apex:commandButton>

  </apex:pageblock>

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

Apex Class

public class WorkOrdersLineitem{
public List<WorkorderLineItemValues> WorkorderLineItemList {get; set;}
public workorder workoderrecord{get;set;}
public static Integer addCount {get; set;}
public Integer nextIdent=1;
Id workoderrecordId ;
WorkOrder WorkOrderInsert  =new Workorder();
List<WorkOrder> LstWorkOrderInsert= new List<WorkOrder>();
public WorkOrdersUKApex()
{
    Id id = ApexPages.currentPage().getParameters().get('id');
    workoderrecord = (id == null) ? new workorder():
     [SELECT contactId, AccountId, subject,StartDate,EndDate,Pricebook2id,RootWorkOrderId,
      Status,StatusCategory FROM workorder WHERE Id = :id];

  WorkorderLineItemList=new List<WorkorderLineItemValues>();
  for (Integer idx=1; idx<5; idx++)
  {
      
       WorkorderLineItemList.add(new WorkorderLineItemValues( nextIdent++));
      
  }
}

 public WorkOrder getworkoderrecord  () {

        return workoderrecord ;
    }
public void WorkOrderSave()
 {
    system.debug('Testing in save');
    List<WorkOrderLineItem> LstWorkOrderLineItem=new List<WorkOrderLineItem>();
    system.debug('Value from Page ==== '+workoderrecord.subject);
    WorkOrderInsert.subject=workoderrecord.subject;
    WorkOrderInsert.StartDate=workoderrecord.StartDate;
    WorkOrderInsert.EndDate=workoderrecord.EndDate;
    WorkOrderInsert.Pricebook2id=workoderrecord.Pricebook2id;
    //WorkOrderInsert.RootWorkOrderId=workoderrecord.RootWorkOrderId;
    WorkOrderInsert.Status=workoderrecord.Status;
    LstWorkOrderInsert.add(WorkOrderInsert);
    if(LstWorkOrderInsert.size()>0)
     {
       try
       {
          insert LstWorkOrderInsert;
       }catch(DMLException e)
          {
           system.debug('Error while inserting the WorkOrder ===>' +e);
          }
     }
    for(WorkorderLineItemValues wrap : WorkorderLineItemList)
       {
        LstWorkOrderLineItem.add(wrap.con);
       }
    if(LstWorkOrderLineItem.size()>0)
    {
        try{
            insert LstWorkOrderLineItem;
        }catch(DMLException e)
        {
            system.debug('LineItemException==>> '+e);
        }
    }
  }

 public void addRows()
{
       for (Integer idx=1; idx<5; idx++)
          {
            WorkorderLineItemList.add(new WorkorderLineItemValues(nextIdent++));
          }
       
}  
public class WorkorderLineItemValues {
  public Integer ident {get;set;}
  public WorkorderLineItem con {get; set;}
  public WorkorderLineItemValues(Integer inIdent) {
     //con = c;
     ident=inIdent;
 }
   
  }  

}


Thanks for the help a lot

Regards,
Jyo
Hello Every one ,

I have 2 field set which i used to display the fields in visualforce page,I need to compare only the 1st  fields set values if the value are changed i need to show the pop screen and if user clicks ok  i need to save the record.
Can you please help me how to achevie it .


Thanks

Regards,
Jyo


 
global without sharing class XXXWebService {
    
    global class XXXServiceInfo
    {
        webService String status;
        webService String complaint
        webService String teamId;
        webService String UserName;
        webService String Password;
    }
Here the extrenal team will pass the username and password,how do i need to check the authentication in Apex Class.
Can you please help me out.
}

Thanks

Regards,
Jyo
for(Sample_Line SampleLineitem:List_SampleLineItemQuery)
             {
              
                 Map_RejectionSampleLineItem.put(SampleLineitem.Product__c,SampleLineitem.Line_Number__c);
                 }

​​In RejectionSampleLineItem it may contian duplicates Product__c so i will be  missing one key


​ for(Inventory__c Inv :Rejection_InvAdjustment)
                         {
                            
                             MN =
when i get the items because the line number is not present in the map it wont pull the value and it stamps to different line number
Integer.valueOf(Map_RejectionSampleLineItem.get(Inv.Product__c));
                             system.debug('MN Value ====== 511   '+MN);                           

​}​

Is there anyway i can get all the duplicate ids of products.

Thanks

Regards,
Ashok N
 
Hello Everyone,

I have a pageblock section  

<apex:pageBlockSectionItem id="producttypesectionitem" >
         <apex:outputText value="Product Type" />
         <apex:selectRadio id="producttypeoptions" layout="pageDirection" value="{!ProductTypeOptions}"   onclick="myFunction(this);">
         <apex:selectOptions id="producttypeitem" value="{!ProductTypeItems}" />
              <!--<apex:selectOptions value="{!items}"/>-->
         </apex:selectRadio>                                       
         </apex:pageBlockSectionItem>

In Apex class i am using below code  I need to get the values of XX and YY based on selection of radio buttion from user in apex class

Like if they select X i need to run one query else i need to run other query .

  public String getProductTypeOptions(){
   return ProductTypeOptions;   
  }
   
  public void setProductTypeOptions(String ProductTypeOptions){
    this.ProductTypeOptions = ProductTypeOptions;
  }
   
  public List<SelectOption> getProductTypeItems() {
    List<SelectOption> options = new List<SelectOption>();                                  
   
    options.add(new SelectOption('XX','XX'));
    options.add(new SelectOption('YY','YY'));
 
    return options;
  }

please help me out i am not able to get the values selected on radio button.

Thanks for help.

Regards,
Jyo

 
Hello Everyone,

I have a webservice where i need to compare the old and new value if i have the  old values i need to send it another method for other i need to send in another method in webservice callout.
Need to collect the parent and child old and new values.
I wrote the trigger but i always get the new values when i send it how can i get the old values 

if(Trigger.isUpdate && Trigger.isbefore){
        XXXX.ABC(trigger.newMap.keySet());
    }

public static void ABC(Set<Id>SampleLineItem) in this method i need to acheive the old and new values.
  {
  // Map<Id,Sample_Line_Item__c> Sample_Line_Item__c= new Map<Id,Sample_Line_Item__c>();
    List<Sample__c> LstSampleQuery= new List<Sample__c>();
   Set<Id> SetSampleIds= new Set<id>();
    Map<Id, Sample_Line_Item__c> LstSampleLineItems = new Map<Id, Sample_Line_Item__c>([select Id,Line_number__c,Unit_of_Measure__c,Delivery_Group__c,Product_No__c,Sample__c from 
                         Sample_Line_Item__c where Id IN:SampleLineItem and Line_Number__C!=null order by Name  Asc]);

Thanks for help
Map<Id,Set<Id>> NoIFC_Product_Map= new Map<Id,Set<Id>();
Set<Id> NoIFC_Product= new set<id>();
for(product2 Products:AllProducts_Query)
            {
                if(Products.Test__c==true)
                {    
                      NoIFC_Product.add(Products.Id);
                      NoIFC_Product_Map.Put(Products.Id,NoIFC_Product);
                     for(SampleLineItemExt sliExt : sampleLineItemExtList) {
                         Sample_Line_Item__c sli = sliExt.sampleLineItem;
                if(sli.Id != null) { // Product_Number__c replaced by Product_No__c
                    if((sli.Product_No__c == null ) 
                    && (sliExt.iqty == null || sliExt.iqty.equals(''))
                    && (sli.Unit_Of_Measure__c == null || sli.Unit_Of_Measure__c.equals(''))
                    ) {
                        delSliSet.add(sliExt.sampleLineItem.Id);
                    }
                }
                if((sli.Product_No__c != null )&& (sliExt.iqty != null && !sliExt.iqty.equals('')) && (sli.Unit_Of_Measure__c != null && !sli.Unit_Of_Measure__c.equals(''))) {
                    sli.Quantity__c = Integer.valueOf(sliExt.iqty);
                    if(sli.Sample__c == null)
                       sli.Sample__c = sampleRecord.Id;
                       sli.Product_No__c=NoIFC_Product_Map.get(sli.Product_No__c); I want to access the id and get the set of ids,
I get the error  Illegal assignment from Set<Id> to Id when i use the Map.Get(Id).
Can you please help me out.
                       newSli.add(sli);
                }

Thanks

Regards,
Jyo
            }
Hello All,

I want to hide the button once it's clicked and display the another section.

<apex:pageBlockSection title="Contact Information" collapsible="true" columns="2">   
                <apex:inputCheckbox value="{!DupeCheck}" label="SkipDupeCheck"><apex:actionSupport event="onchange" reRender="DupeCheckOutputPanel" id="Us"  />
                </apex:inputCheckbox>
<apex:inputField value="{!con.LastName}" />
                <apex:inputField value="{!con.Birthdate}" />
                <apex:inputField value="{!con.Gender__c}"/>

      <apex:commandButton value="Verify Duplication" action="{!verify}" rerender="detailError,DupValue" onclick="this.disabled"  /> want to hide the button  once it clicked once and display the below section

<apex:pageBlock rendered="{!con.Email!=null}">
              <apex:pageBlockSection title="Sample Address Information" collapsible="true" columns="2">
                 <apex:inputField value="{!con.Sample_Shipping_Street__c}" id="shpstreet1" required="true"/>
                <apex:inputField value="{!con.Alternate_Street__c}" id="altstreet1"/>
 
Hello Everyone,
we got into typical requirement
when the user add the task on contact he selects 10 contact and assign the same task.
when the task is created and  assigned to 10 contact we need to update the contact records. e
i am able update the 10 contact when task is assigned.
but on create it takes only one contact i.e the primary contact gets updated
Apex Trigger

If(Trigger.isinsert || Trigger.IsAfter)
     {
        Task1.XXX(Trigger.New);
     }

// Handler class 

 public void XXX(List<Task> LstTask) 
   {
      Set<id> TaskIds= new Set<id>();
      Set<id> WhoIds= new Set<id>();
      List<TaskRelation> TaskRelation = new List<TaskRelation>();
      Map<Id,Account> AcctListUpdate= new Map<Id,Account>();
      Map<Id,Id> MapWhoId= new Map<Id,Id>();
       Map<Id,Id> MapWhatId= new Map<Id,Id>();
      Map<Id,Contact> LstContactupdate= new Map<Id,Contact>();
       for(Task TaskValues: LstTask)
       {
            TaskIds.add(TaskValues.id);
            WhoIds.add(TaskValues.whoId);
       }
      system.debug('TaskIds>>>>'+TaskIds+'>>>>>'+WhoIds);we get only whoids for the task 
      TaskRelation=[SELECT AccountId,IsWhat,RelationId,TaskId FROM TaskRelation Where TaskId =: TaskIds];
      system.debug('TaskQuery '+TaskRelation.size()+'!!! ' +TaskRelation);
      for(TaskRelation TaskRelations:TaskRelation)
      {
         MapWhoId.put(TaskRelations.id,TaskRelations.RelationId);
         MapWhatId.put(TaskRelations.id, TaskRelations.AccountId);
        system.debug('MapWhatId>.>>'+MapWhatId);
        system.debug('MapWhoId>.>>'+MapWhoId);
      }
       for(TaskRelation TaskRelations:TaskRelation)
      {
         Contact ContactUpdate= new Contact();
         Account AccountUpdate= new Account();
         ContactUpdate.Id=MapWhoId.get(TaskRelations.id);
         ContactUpdate.Date_of_Last_Call__c=system.today();
         AccountUpdate.Id=MapWhatId.get(TaskRelations.id);
         AccountUpdate.Date_of_Last_Call__c=system.today();
         LstContactupdate.put(ContactUpdate.Id,ContactUpdate);
         AcctListUpdate.put(AccountUpdate.Id, AccountUpdate);
          
      }
        
       system.debug('LstContactupdate>>>>'+LstContactupdate+'>>>>>>'+AcctListUpdate);
      if(LstContactupdate.size()>0)
      {
          try{
              update LstContactupdate.values();
              update AcctListUpdate.values();
              system.debug('LstContactupdatetoUpddate>>>>'+LstContactupdate);
          }catch(DmlException e)
          {
              system.debug('DmlException>>'+e);
          }
      }
       
   }



 
Hello Everyone,

I am implementing the duplication rule using Data.com methods.I was able to get the Error message and all other details in visualforce page.
User enter some information to check whether the values is duplicate below or not the section below  where the user enter the data for verification
 <apex:pageBlockSection title="Contact Information" collapsible="true" columns="2">   
               
         <apex:inputCheckbox value="{!DupeCheck}" label="SkipDupeCheck"><apex:actionSupport event="onchange" reRender="DupeCheckOutputPanel" id="Us"/>
                </apex:inputCheckbox>
                <apex:inputField value="{!con.Title}"/>            
                <apex:inputField value="{!con.Gender__c}"/>
                <apex:inputField value="{!con.FirstName}" required="True"/>
                <apex:inputField value="{!con.Phone}" />
                <apex:inputField value="{!con.LastName}" />
                <apex:inputField value="{!con.MobilePhone}" />
                <apex:inputField value="{!con.Sample_Shipping_Street__c}" id="shpstreet1" required="true"/>
                <apex:inputField value="{!con.Sample_Shipping_Street2__c}" id="shpstreet2"/>
                <apex:inputField value="{!con.Sample_Shipping_Mail_Stop_Suite__c}" id="shpunit"/>
                <apex:inputField value="{!con.Sample_Shipping_City__c}" id="shpcity" required="true"/>
                <apex:inputField value="{!con.Sample_Shipping_State_Province__c}" id="shpstate" required="true"/>
                <apex:inputField value="{!con.Sample_Shipping_Zip_Postal_Code__c}" id="shpzip" required="true"/>
                <apex:inputField value="{!con.Sample_Shipping_Country__c}" id="shpcountry" required="true"/> <!-- updated from smpcountry -->
              </apex:pageBlockSection>

once the user enters the data and verify duplication i need to display the below section

<apex:outputPanel id="DupeCheckOutputPanel">
            <apex:pageBlockSection title="Relationships" collapsible="true" columns="2"  rendered="{!IF(hasDuplicateResult = true , true , false)}" > 
              <apex:outputText value="&nbsp;" escape="false" />
                <apex:inputField value="{!con.Fax}" />
                <apex:inputField value="{!con.Alternate_Street__c}" id="altstreet1"/>
                <apex:inputField value="{!con.Alternate_Zip_Postal_Code__c}" id="altzip" />
                
I get the above the section when user has duplicate records in system. but i need to show this when they are no duplication in system too when user clicks verify duplication.

Below are the command button

<apex:commandButton  value="Verify Duplication"  action="{!Save}"  />
          <!--      <apex:commandButton value="Cancel"  action="{!Cancel}" immediate="true" />-->
               <apex:commandButton value="Cancel"  onClick="closeTab();return false" />


Thanks for the help.

Regards,
Jyo
Hello All,
I wrote the batch class and i make the callout to external system.The batch class is schedule for eelpe hvery 3 hours.
but here is some problem The batch job works fine .but it gives weried error at 9 clock batch pushing the values twice to the exteral system.(And it happens 2 months once) Is there any way we can check out the excute methods fire twices for that time interval.

Thanks for the help.

Regards,
Jyo

 
Hello Everyone,

When i use @isTest(SeeAlldata=true) the test class run with out any error .

Want to build the test class @isTest(SeeAlldata=false ) while accesing the custom setting data 

I have created the test data for custom setting as below
 AuthenticationSettings__c GLIntegration = new AuthenticationSettings__c();    
          //uthenticationSettings__c    GLIntegration = new AuthenticationSettings__c();
              GLIntegration.User__c='Test';
              GLIntegration.Name='121';
              GLIntegration.Password__c='Test';
              GLIntegration.EndPoint__c='https://XXX/XXX/XXX.svc';
              Insert GLIntegration;
          system.debug('customSettinInsert!!'+GLIntegration);
            System.assert(GLIntegration != null);
        List<GLIntegrationAuthenticationSettings__c> GLIntegrationQuery= new List<GLIntegrationAuthenticationSettings__c>();
        GLIntegrationQuery=[Select Id,Name,User__c,Password__c,EndPoint__c from GLIntegrationAuthenticationSettings__c where id=:GLIntegration.Id];
         system.debug('GLIntegrationQuerysize!!!'+GLIntegrationQuery.size());
          AuthenticationSettings__c GLIntegrationTestValues = AuthenticationSettings__c.getAll().get('121');
           String  UserName=GLIntegrationTestValues.User__c;
          String  Password=GLIntegrationTestValues.Password__c;
           String Biz_Talk_EndPoint=GLIntegrationTestValues.EndPoint__c;
           String Name=GLIntegrationTestValues.Name;
            System.debug('@@'+UserName+'!!!'+Password+'*****'+Biz_Talk_EndPoint+'----'+Name); I can see all the values in the debug.

But it still fails

Class.GlobalComplaintOutbound.<init>: line 16, column 1
Below is the code which uses the custom setting data
GLIntegrationAuthenticationSettings__c GLIntegration = GLIntegrationAuthenticationSettings__c.getAll().get('BizTalk');
     String UserName=GLIntegration.User__c;
     String Password=GLIntegration.Password__c;
    String Biz_Talk_EndPoint=GLIntegration.EndPoint__c;

Class.GlobalComplaintWebSvcCalloutTest.testEchoString: line 51, column 1

     GlobalComplaintOutbound outbound= new GlobalComplaintOutbound();

Note: I am using the batch apex to make the callout to external system.

Can you please suggest what i am missing here.

Thanks for the help.

Regards,
Jyo
Hello Everyone,
Based on userLogin i need to shift the page layout.
Here is what i am trying to develop When user login is xx Country i need to some them standard contact pagelayout.Else i need to some them custom pagelayout.
Below is code 

<apex:page standardController="Contact" extensions="ContactRedirect" action="{!redirect}">
</apex:page>

Class

public class ContactRedirect {
public contact contact{get;set;}

public list<User> userList {get;set;}
 String recordId;
PageReference customPage;

    public ContactRedirect(ApexPages.StandardController controller) {
     recordId = controller.getId();
     system.debug('recordId'+recordId);
     
    }
    
    public PageReference redirect() {
        Id selectedRecordType = ApexPages.currentPage().getParameters().get('RecordType');
        
      User UserValue = [select Id,User_Country_Location__c from User where id = :UserInfo.getUserId()];
        system.debug('UserValue!!'+UserValue);
  if (UserValue.User_Country_Location__c=='XX') 
      {
         customPage =  Page.XXX;
        customPage.setRedirect(true);
        customPage.getParameters().put('id', recordId);
        //return customPage;
      } else {
             customPage= /00Q/e?retURL=%2F00Q%2Fo&RecordType='+selectedRecordType+'&ent=Lead;
            getParameters().put('nooverride','1');
            
    }
        return customPage;
    }
}

When ever i click on new button it goes to the page

https://c.cs13.visual.force.com/apex/RedirectButton?retURL=%2F003%2Fo&RecordType=012500000009kEg&ent=Contact&save_new=1&sfdc.override=1
and immedistely it redircet to "https://cs13.salesforce.com/null"

Can you please help me what i am missing
Hello Every one,

I need to compare the old and new values in apex class.It works fine if i write the code in trigger.But i need this validation to be incroporated in handler class
Below is my trigger and Apex class 

if(Trigger.Isupdate && Trigger.Isbefore)
       {
            for(Contact Contacts : trigger.new)
       {
             if((Contacts.Secure_Start_Owner__c != Trigger.oldMap.get(Contacts.Id).Secure_Start_Owner__c) || (Trigger.oldMap.get(Contacts.Id).Secure_Start_Owner__c==null))
                { 
                   AssignSecureStartOwnerHandler.assignSecureStartOwneronUpdate(Trigger.newMap,trigger.new);
                 }
        }
       }

Method Name

   public void assignSecureStartOwneronUpdate(Map<Id, contact> leadMap, List<contact> Listlead){
                 List<Contact> updateLeads = new List<Contact>();
                 List<Contact> updateContacts = new List<Contact>(); 
                 List<Account> updateAccounts = new List<Account>();
                 List<User> updateUsers = new List<User>();
                    List<Id> LeadIds = new List<Id>();
                 Boolean cc = false;
                 List<Id> userIds = new List<Id>();
                 Id AccountId;
                 integer last; 
                 List<Account> accountIds;
        Set<Id> Nurse_Clinician = new set<id>();
        for(Contact lead:Listlead) 
        {
          Nurse_Clinician.add(lead.Nurse_Clinician__c);
        }
         List<Contact> thisClinician = [select AccountId, Account1__c, Id from Contact where Id IN:Nurse_Clinician];  
            System.debug('thisClinician@@@'+thisClinician);
         for(Contact leads:Listlead) 
        {  
           if(leads.Secure_Start_Owner__c==null)
          { 
                system.debug('SecureStartOwner' +lead.Secure_Start_Owner__c);
                final String conrecname = '(US) Patient/Consumer';
                RecordType conr = [Select Id,Name From RecordType where Name = :(conrecname)];
                System.debug('conr Id = '+conr.Id);
         if(thisClinician!=null && thisClinician.size()>0)
         {  
             System.debug('acc on nurse = '+thisClinician[0].Account1__c);
             AccountId = thisClinician[0].Account1__c;
         }
        if(leads.Place_of_Surgery_Hospital__c==null)
        {
            leads.Place_of_Surgery_Hospital__c = AccountId;
            updateLeads.add(leads);
        }
      
    }        
        if(AccountId !=null){
            
         System.debug('accountid on contact = '+AccountId);
         accountIds = [select Id, Last_Round_Robin_ID__c from Account where Id=:AccountId limit 1];
          system.debug('accountIds@@@@'+accountIds);
        if(accountIds!=null){
          if(accountIds[0].Last_Round_Robin_ID__c==null)
          {
             last = 0;
          }
          else{
              last = Integer.valueOf(accountIds[0].Last_Round_Robin_ID__c);
               }
        List<AccountTeamMember> atm = [Select UserId, TeamMemberRole, Id, AccountId From AccountTeamMember where AccountID=:accountIds[0].Id AND (TeamMemberRole = 'US Secure Start Patient Coord - US OST 1'OR TeamMemberRole = 'US Secure Start Patient Coord - US OST 2'
                                                          OR TeamMemberRole = 'US Secure Start Patient Coord - US OST 3'
                                                          OR TeamMemberRole = 'US Secure Start Patient Coord - US OST 4'
                                                          OR TeamMemberRole = 'US Secure Start Patient Coord - US OST 5')
                                      ];
           
            System.debug('atm = '+atm);
     if(atm!=null && atm.size()>0){
       for(AccountTeamMember a:atm){
                     
                    System.debug('atm.UserId = '+a.UserId);
                    userIds.add(a.UserId);  //all these users can be the secure start owner for this Lead  

     
                        }
                    }
            
            else{
                        //AccountTeam is not set then assign Secure Start ownership to the logged In user
                        Id loggedInUserId = UserInfo.getUserId();
                        userIds.add(loggedInUserId);
                    }
                if(userIds!=null && userIds.size()>0){
            //get the Round Robin ID from the user records
            List<User> users = [select Name, Round_Robin_ID__c, Last_Round_Robin_Assigned_At__c,Not_Assigned_SS_Owner_Recently__c, Id from User 
                                where Id IN:userIds ORDER BY Last_Round_Robin_Assigned_At__c ASC,Round_Robin_ID__c ASC];
            System.debug('users = '+users);
                    for(contact lead:Listlead){
                    if(last==0){
                /* never started assignment on this team - pick the first user from users and update the Last_Round_Robin_ID__c on contact */
                integer assigned;
                        //
                for(integer i=0;i<users.size();i++){
                    if(users[i].Not_Assigned_SS_Owner_Recently__c==true){
                        lead.Secure_Start_Owner__c = users[i].Id;
                        if(cc==false){
                            accountIds[0].Last_Round_Robin_ID__c = Integer.valueOf(users[i].Round_Robin_ID__c);
                            updateAccounts.add(accountIds[0]);
                        }
                        users[i].Not_Assigned_SS_Owner_Recently__c = false;
                        users[i].Last_Round_Robin_Assigned_At__c = System.now();
                        assigned = i;
                        updateLeads.add(lead);
                        updateUsers.add(users[i]);
                        system.debug('assigned ! :'+assigned);
                        break;
                    }
                    if(assigned==null ||assigned==0){
                        
                        System.debug('no user had flag checked');
                        //reset and pick first user // sort Users on the Last_Round_Robin_Assigned_At__c and pick first user
                     
                        lead.Secure_Start_Owner__c = users[0].Id;
                        if(cc==false){
                            accountIds[0].Last_Round_Robin_ID__c = Integer.valueOf(users[0].Round_Robin_ID__c);
                            updateAccounts.add(accountIds[0]);
                        }
                        users[0].Not_Assigned_SS_Owner_Recently__c = false;
                        users[0].Last_Round_Robin_Assigned_At__c = System.now();
                        assigned = 0;
                        updateLeads.add(lead);                        
                        updateUsers.add(users[0]); 
                    }
                }
                
                integer counter = -1;
                for(User u:users){
                    counter++;
                    if(counter!=assigned){
                        u.Not_Assigned_SS_Owner_Recently__c = true;
                        updateUsers.add(u);
                    }
                }
            }
            else{ 
                lead.Secure_Start_Owner__c = users[0].Id;
                if(cc==false){
                    accountIds[0].Last_Round_Robin_ID__c = Integer.valueOf(users[0].Round_Robin_ID__c);
                    updateAccounts.add(accountIds[0]);
                }
                users[0].Not_Assigned_SS_Owner_Recently__c = false;
                users[0].Last_Round_Robin_Assigned_At__c = System.now();
                System.debug('adding = '+users[0].Name);
                updateUsers.add(users[0]);
                updateLeads.add(lead);
                
                integer index = 0;
                integer endIndex = users.size()-1;
                System.debug('index = '+index+' till endIndex = '+endIndex);
                    while(endIndex>index){
                        users[endIndex].Not_Assigned_SS_Owner_Recently__c = true;
                        System.debug('adding = '+users[endIndex].Name);
                        updateUsers.add(users[endIndex]);
                        endIndex--;
                    
                    
           }
            }
                }
            }
                    
     }
                    
        }
    if(updateAccounts!=null && updateAccounts.size()>0){
            System.debug('updateAccounts = '+updateAccounts[0]);
            update updateAccounts;
        }
        if(updateUsers!=null &&  updateUsers.size()>0){
            update updateUsers;
        }
        
   }     
    
  // return null;
   
        
   
}

Thanks for help.

Regards,
jyo
   
   
Hello Everyone,

I have a visual force ,where the users selects contact records and it create a task for the owner or if specify another owner ID in the code.
Here I am have 4 teams,
Need to assign task based on the workload
Suppose if the first task is assigned to one user of first team and another task creates it should assign to 2 user in first team.
 
How can achieve this? If they are any work around could you please suggest me

Regards,
Jyo
 
Hello Everyone,
I have page when user clicks verify i insert the record and make a callout. In executeWS() i call another call where we update the response from External system. It's get updated and everything works. executeWS() code is below. when i verify i get the status bar ,but the  status bar won't appear on the page until the page gets redirect.
I need to keep the status bar working until the pages the get loaded successfully after the redirect. I need to show user please wait i am updating   the values and getting the page back for the result.

 
<apex:commandButton value="Save As Draft " action="{!saveSample}"  reRender="pgBlckId,table" status="actStatusId"/>
             
             <apex:commandButton value="Verify" action="{!saveSample}" oncomplete="executeWS()" status="actStatusId"  reRender="isSF1"/>
             <apex:actionStatus id="actStatusId" rendered="true" >
             <apex:facet name="start" >
                  <apex:actionFunction name="executeWS" action="{!executeWS}" >
                  <div class="waitingSearchDiv" id="el_loading" style="background-color: #fbfbfb;
                       height: 100%;opacity:0.65;width:100%;"> 
                    <div class="waitingHolder" style="top: 74.2px; width: 91px;">
                        <img class="waitingImage" src="/img/loading.gif" title="Please Wait..." />
                        <span class="waitingDescription">Please Wait...</span>
                    </div>
                </div>
                 </apex:actionFunction>
                </apex:facet>
            </apex:actionStatus>
public PageReference executeWS(){
    bsubmit =validateUserInputs(true);
    system.debug('validateUserInputs ==== '+validateUserInputs(bsubmit));
   if(bsubmit!=true) 
   {
           try{
             if(OrderNumber.get(sampleRecord.Id)==null)
             {
               callout.processSampleOrderRequestCreate(this,samplerecord.Id);
              
               PageRedirect = new PageReference('/apex/XXX?Id='+sampleRecord.Id+'');
               PageRedirect.setRedirect(true);
              }else{
               callout.processSampleOrderChangeRequest(this,samplerecord.Id);
               PageRedirect = new PageReference('/apex/XXX?Id='+sampleRecord.Id+'');
               PageRedirect.setRedirect(true);
              }
        }catch(Exception e)
             {
               system.debug('Exception === '+e.getMessage()); 
             }
           
      }
       return PageRedirect;
   }

Thanks for the help.

Regards,
Jyo
 
Hello All ,

I need to make the field required in Apex webservices class

I have variable  firstName and it should be mandatory in services 

webservice string firstName; is the syntax.When i generate the schema it's shows as below.
<xsd:element name="firstName" minOccurs="0" type="xsd:string" nillable="true"/>
how to make the minOccurs="1" through apex class
<xsd:element name="firstName" minOccurs="1" type="xsd:string" nillable="true"/>


Thanks for help.

Regards,
Ashok N
 
global without sharing class XXXWebService {
    
    global class XXXServiceInfo
    {
        webService String status;
        webService String complaint
        webService String teamId;
        webService String UserName;
        webService String Password;
    }
Here the extrenal team will pass the username and password,how do i need to check the authentication in Apex Class.
Can you please help me out.
}

Thanks

Regards,
Jyo
Hi All, 

I'm pretty new to coding, so this may be a really basic question.
I'm trying to modify an Apex class that was created by our original SF org developers. There is a bulk test in one of the classes that fails to pass the governor limits, I assume, because of all of the SOQL queries :
 
private class Test_OpportunityTrigger {

    static testMethod void testOpportunityTriggers()
    {
    	Test_OpportunityTrigger.testOpportunityTriggersHelper(2);
    }

    static testMethod void testOpportunityTriggersBulk()
    {
        Test_OpportunityTrigger.testOpportunityTriggersHelper(200);
    }
    
    static void testOpportunityTriggersHelper(Integer numberOfRecords)
    {
        // find a status for a converted lead
    	LeadStatus convertStatus = [
        	SELECT MasterLabel
        	FROM LeadStatus
        	WHERE IsConverted = true
        	LIMIT 1
        ];
    	
        // create leads
        List<Lead> leadList = TestData.generateLeads(numberOfRecords);
        for(Lead lead : leadList)
        {
            lead.State = 'PA';
        	lead.Stage__c = 'Sales Qualified Lead';
        	lead.Status = 'Working - Contacted';
        	lead.SIC_Code__c = 'siccode';
            lead.Branch_Code__c = '101: Corrugated Products';
        }
        insert leadList;
// convert the leads
        List<Database.LeadConvert> leadConvertList = new List<Database.LeadConvert>();
        for(Integer ii=0; ii<leadList.size(); ++ii)
        {
            Lead lead = leadList[ii];
            Database.LeadConvert lc = new Database.LeadConvert();
            lc.setLeadId(lead.Id);
            lc.setConvertedStatus(convertStatus.MasterLabel);
            leadConvertList.add(lc);
        }
        
        if(!leadConvertList.isEmpty()){
            List<Database.LeadConvertResult> lcrList = Database.convertLead(leadConvertList);
        }
        
        // build a map to correlate an opportunity and contact for role verification
        Map<Id, Id> opportunityToContactMap = new Map<Id, Id>();
        List<OpportunityContactRole> oppConRoleSOQL = [SELECT Id, OpportunityId, ContactId FROM OpportunityContactRole WHERE IsPrimary = true AND Role = 'Decision Maker'];
        for(OpportunityContactRole opportunityContactRole : oppConRoleSOQL){
            opportunityToContactMap.put(opportunityContactRole.OpportunityId, opportunityContactRole.ContactId);
        }
        
        // verify that the lookup was populated on the opportunity and that the opportunity contact roles were created
        


        Map<Id, Contact> oppIdToContactMap = new Map<Id, Contact>();
        Map<Id, Contact> contactMap = new Map<Id, Contact>([SELECT Id, AccountId FROM Contact]);
        List<Opportunity> opportunityList = [SELECT Id, AccountId, Opportunity_Contact__c FROM Opportunity];

        


        for(Opportunity opportunity : opportunityList)
        {
            Contact contact = contactMap.get(opportunity.Opportunity_Contact__c);
            System.assertEquals(opportunity.AccountId, contact.AccountId);
            System.assertEquals(opportunityToContactMap.get(opportunity.Id), opportunity.Opportunity_Contact__c);
        }
        
        // insert new contacts and change the opportunity contact
        List<Contact> contactList = TestData.generateContacts(numberOfRecords);
        for(Integer ii=0; ii<contactList.size(); ++ii){
            contactList[ii].AccountId = opportunityList[ii].AccountId;
        }
        insert contactList;
        for(Integer ii=0; ii<opportunityList.size(); ++ii){
            opportunityList[ii].Opportunity_Contact__c = contactList[ii].Id;
        }
        update opportunityList;
        
        // verify that the contact roles were updated
        opportunityToContactMap.clear();
        // JKK created this line too. Same as above.
        oppConRoleSOQL = [SELECT Id, OpportunityId, ContactId FROM OpportunityContactRole WHERE IsPrimary = true AND Role = 'Decision Maker'];
        for(OpportunityContactRole opportunityContactRole : oppConRoleSOQL){
            opportunityToContactMap.put(opportunityContactRole.OpportunityId, opportunityContactRole.ContactId);
        }
        for(Integer ii=0; ii<opportunityList.size(); ++ii)
        {
            Opportunity opportunity = opportunityList[ii];
            System.assertEquals(opportunityToContactMap.get(opportunity.Id), opportunity.Opportunity_Contact__c);
        }
    }
}


So, I can cause this to pass just by changing the Bulk trigger value from 200 to like, 10. What I would PREFER to do, is just run an if statement for the SOQL variables that says "if this variable already exists, don't run this query for it." If I just test for whether the variable is 'null', it'll just say that the variable doesn't exist. Well shoot, THAT'S what I'd like to test for, then! If it doesn't exist, do a thing! Or, will that not solve my governor limit problem?

Any ideas?

for(Sample_Line SampleLineitem:List_SampleLineItemQuery)
             {
              
                 Map_RejectionSampleLineItem.put(SampleLineitem.Product__c,SampleLineitem.Line_Number__c);
                 }

​​In RejectionSampleLineItem it may contian duplicates Product__c so i will be  missing one key


​ for(Inventory__c Inv :Rejection_InvAdjustment)
                         {
                            
                             MN =
when i get the items because the line number is not present in the map it wont pull the value and it stamps to different line number
Integer.valueOf(Map_RejectionSampleLineItem.get(Inv.Product__c));
                             system.debug('MN Value ====== 511   '+MN);                           

​}​

Is there anyway i can get all the duplicate ids of products.

Thanks

Regards,
Ashok N
 
Hi all,
I want to change the owner of the record when a field value is equal to the value of the another field in another object.
example:In lead object, custom field value is equal to the value of my custom object field then i want to change the owner of the lead as my custom object assigned user.
Can anyone help me over here.

Regards,
james
I have been trying to use NON SOAP method for Fedex- Salesforce integration. I am using  Developer console to pass the sample value. While running the sample code, I am getting "Read Time Out" exception.  I had also set time to 2 minute and  still showing same exception. Below is my sample code,

HttpRequest req = new HttpRequest();
HttpResponse res = new HttpResponse();
Http http = new Http();
String xml = '<?xml version="1.0" encoding="UTF-8"?><SOAP-ENV:Envelope xmlns:SOAP-              ENV="http://schemas.xmlsoap.org/soap/envelope/"xmlns:ns1="http://fedex.com/ws/rate/v13".....................................'
req.setEndpoint('https://wsbeta.fedex.com:443/web-services');
req.setMethod('POST');
req.setTimeout(120000);
system.debug(req);
req.setHeader('Referrer', 'Cloudygen');
req.setHeader('Host', 'wsbeta.fedex.com');
req.setHeader('Accept', 'image/gif, image/jpeg,image/pjpeg, text/plain, text/html, */*');
req.setHeader('Content-Type', 'image/gif');
req.setHeader('Content-Length',String.valueOf(xml.length()));
system.debug(req);
res = http.send(req);
system.debug(res);

I would be glad if someone could help me with this. I would also appreciate if anyone could provide me with different approach for FEDEX integration.
Hi, 

We are trying to update a new field that we created in Opportunity Poduct. We tried to upload the updated info back into production and getting the following error: 'Unable to create/update fields: PricebookEntryId. Please check the security settings of this field and verify that it is read/write for your profile or permission set.' 

What does that mean?  How to fix it ? and/or How do we update Opportunity Product info. 

Thank!
Hello Everyone,

I have a webservice where i need to compare the old and new value if i have the  old values i need to send it another method for other i need to send in another method in webservice callout.
Need to collect the parent and child old and new values.
I wrote the trigger but i always get the new values when i send it how can i get the old values 

if(Trigger.isUpdate && Trigger.isbefore){
        XXXX.ABC(trigger.newMap.keySet());
    }

public static void ABC(Set<Id>SampleLineItem) in this method i need to acheive the old and new values.
  {
  // Map<Id,Sample_Line_Item__c> Sample_Line_Item__c= new Map<Id,Sample_Line_Item__c>();
    List<Sample__c> LstSampleQuery= new List<Sample__c>();
   Set<Id> SetSampleIds= new Set<id>();
    Map<Id, Sample_Line_Item__c> LstSampleLineItems = new Map<Id, Sample_Line_Item__c>([select Id,Line_number__c,Unit_of_Measure__c,Delivery_Group__c,Product_No__c,Sample__c from 
                         Sample_Line_Item__c where Id IN:SampleLineItem and Line_Number__C!=null order by Name  Asc]);

Thanks for help
Map<Id,Set<Id>> NoIFC_Product_Map= new Map<Id,Set<Id>();
Set<Id> NoIFC_Product= new set<id>();
for(product2 Products:AllProducts_Query)
            {
                if(Products.Test__c==true)
                {    
                      NoIFC_Product.add(Products.Id);
                      NoIFC_Product_Map.Put(Products.Id,NoIFC_Product);
                     for(SampleLineItemExt sliExt : sampleLineItemExtList) {
                         Sample_Line_Item__c sli = sliExt.sampleLineItem;
                if(sli.Id != null) { // Product_Number__c replaced by Product_No__c
                    if((sli.Product_No__c == null ) 
                    && (sliExt.iqty == null || sliExt.iqty.equals(''))
                    && (sli.Unit_Of_Measure__c == null || sli.Unit_Of_Measure__c.equals(''))
                    ) {
                        delSliSet.add(sliExt.sampleLineItem.Id);
                    }
                }
                if((sli.Product_No__c != null )&& (sliExt.iqty != null && !sliExt.iqty.equals('')) && (sli.Unit_Of_Measure__c != null && !sli.Unit_Of_Measure__c.equals(''))) {
                    sli.Quantity__c = Integer.valueOf(sliExt.iqty);
                    if(sli.Sample__c == null)
                       sli.Sample__c = sampleRecord.Id;
                       sli.Product_No__c=NoIFC_Product_Map.get(sli.Product_No__c); I want to access the id and get the set of ids,
I get the error  Illegal assignment from Set<Id> to Id when i use the Map.Get(Id).
Can you please help me out.
                       newSli.add(sli);
                }

Thanks

Regards,
Jyo
            }
I have a simple Visual Flow embedded in a simple Visualforce page that creates a record in a custom object.  When the flow ends, I would like to redirect to the detail page of the record that was just created (using a Flow variable).  How can I reference a flow variable in the <flow>'s returnurl parameter?
User-added image
Hello All,
I wrote the batch class and i make the callout to external system.The batch class is schedule for eelpe hvery 3 hours.
but here is some problem The batch job works fine .but it gives weried error at 9 clock batch pushing the values twice to the exteral system.(And it happens 2 months once) Is there any way we can check out the excute methods fire twices for that time interval.

Thanks for the help.

Regards,
Jyo

 
Hello Everyone,

When i use @isTest(SeeAlldata=true) the test class run with out any error .

Want to build the test class @isTest(SeeAlldata=false ) while accesing the custom setting data 

I have created the test data for custom setting as below
 AuthenticationSettings__c GLIntegration = new AuthenticationSettings__c();    
          //uthenticationSettings__c    GLIntegration = new AuthenticationSettings__c();
              GLIntegration.User__c='Test';
              GLIntegration.Name='121';
              GLIntegration.Password__c='Test';
              GLIntegration.EndPoint__c='https://XXX/XXX/XXX.svc';
              Insert GLIntegration;
          system.debug('customSettinInsert!!'+GLIntegration);
            System.assert(GLIntegration != null);
        List<GLIntegrationAuthenticationSettings__c> GLIntegrationQuery= new List<GLIntegrationAuthenticationSettings__c>();
        GLIntegrationQuery=[Select Id,Name,User__c,Password__c,EndPoint__c from GLIntegrationAuthenticationSettings__c where id=:GLIntegration.Id];
         system.debug('GLIntegrationQuerysize!!!'+GLIntegrationQuery.size());
          AuthenticationSettings__c GLIntegrationTestValues = AuthenticationSettings__c.getAll().get('121');
           String  UserName=GLIntegrationTestValues.User__c;
          String  Password=GLIntegrationTestValues.Password__c;
           String Biz_Talk_EndPoint=GLIntegrationTestValues.EndPoint__c;
           String Name=GLIntegrationTestValues.Name;
            System.debug('@@'+UserName+'!!!'+Password+'*****'+Biz_Talk_EndPoint+'----'+Name); I can see all the values in the debug.

But it still fails

Class.GlobalComplaintOutbound.<init>: line 16, column 1
Below is the code which uses the custom setting data
GLIntegrationAuthenticationSettings__c GLIntegration = GLIntegrationAuthenticationSettings__c.getAll().get('BizTalk');
     String UserName=GLIntegration.User__c;
     String Password=GLIntegration.Password__c;
    String Biz_Talk_EndPoint=GLIntegration.EndPoint__c;

Class.GlobalComplaintWebSvcCalloutTest.testEchoString: line 51, column 1

     GlobalComplaintOutbound outbound= new GlobalComplaintOutbound();

Note: I am using the batch apex to make the callout to external system.

Can you please suggest what i am missing here.

Thanks for the help.

Regards,
Jyo