• sanca
  • NEWBIE
  • 40 Points
  • Member since 2014

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 16
    Questions
  • 30
    Replies
I downloaded the APEX trigger to create assets from Opportunity Line Items. How can I then update the opportunity line items with the ID of the newly created Asset? Any help is appreciated!

trigger CreateAssetonClosedWon on Opportunity (after insert, after update) {
     for(Opportunity o: trigger.new){ 
      if(o.isWon == true && o.HasOpportunityLineItem == true && o.type == 'Purchase'){
         String opptyId = o.Id;
         OpportunityLineItem[] OLI = [Select UnitPrice, Quantity, PricebookEntry.Product2Id, PricebookEntry.Product2.Name, Description, Converted_to_Asset__c, DOM__c, Asset__c  
                                      From OpportunityLineItem 
                                      where OpportunityId = :opptyId  and Converted_to_Asset__c = false];
         Asset[] ast = new Asset[]{};
         Asset a = new Asset();
         for(OpportunityLineItem ol: OLI){
            a = new Asset();
        a.AccountId = o.AccountId;
            a.Product2Id = ol.PricebookEntry.Product2Id;
            a.Quantity = ol.Quantity;
            a.Price =  ol.UnitPrice;
            a.PurchaseDate = o.CloseDate;
            a.Status = 'Purchased';
            a.Description = ol.Description;
            a.Name = ol.PricebookEntry.Product2.Name;
            a.Original_Opportunity__c = opptyID;
            a.In_Inventory__c = true;
            a.Date_of_Manufacturer__c = ol.DOM__c;
            ast.add(a);
            ol.Converted_to_Asset__c = true;
       }
      update OLI; 
      insert ast;
     }
    }
}
 
Hi Devs ,

Initial design was like this , 
There is aura :iteration which loops products and the value of product description field was same for all the products . 

Now they need unique description for each products which can be done but here is the catch that it has to be translated into multiple languages .  
I know we can use labels for translation but how can we set custom labels dynamically inside aura :iteration so that each product is set to unique description and also it would be translated to multiple languages .
 
  • June 14, 2019
  • Like
  • 0
Hi Devs,

To achieve a certain functionality , I have called a server side apex controller class which inturns calls batch class .  I have written a code to hide spinner class inside action,setcallback funtion .  This never gets executed untill I manually perform a button click anywhere on the screen or switch tabs / brower window . 
Because of this ,the spinner keeps spinning and never goes off the screen until I manually click anywhere in window or switch tabs,after which the action.setcallback funtion get called (Verified in console tab)  . 
Is this happening because of batch class . How can I overcome this ?
 
  • April 15, 2019
  • Like
  • 0
Hi Devs,

I have requirement  which goes like this ,
There is a force.com site which inserts custom objects and then  opportunity records gets created using trigger . Now Business wants to show a pop up window (notification) to all user as soon as the opportunity records gets inserted  and that pop up should have a button for user to take ownership of that record . 
Is it implementable ? Can we notify user using pop up screen ?
  • September 18, 2018
  • Like
  • 0
Hi Devs,

I have requirement  which goes like this ,
There is a force.com site which inserts opportunity records into sfdc system . Now Business wants to show a pop up window (notification) to all user as soon as the opportunity records gets inserted  and that pop up should have a button for user to take ownership of that record . 
Is it implementable ? Can we notify user using pop up screen ?
  • September 18, 2018
  • Like
  • 0
Hi Devs ,
I have a component which is invoked through quick action present in event record page .The component is referring to force:hasRecordId interface .
The value of recordid is resulting to  undefined  when debugged. 
<!--component>

<aura:component controller="customLookUpController" implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction">
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
</aura:component>

<!--controller>
({
    doInit: function(component,event,helper) {
        var getId = component.get("v.recordId");   -- > undefined 
},
})
  • June 27, 2018
  • Like
  • 0

Hi Devs,

I had a requirement to fetch the external data and update back the response in saleforce system based on trigger action.
The design is as follows,
When zipcode field in opportunity is changed or populated ,the trigger calls the external api and passes zipcode value .
The external api returns state,city,country based on zipcode .
The external api just accepts 1 zipcode at a time .
The design is implemented and working fine when opportunity is changed from UI .
Since there could be many opportunity getting updated/updated in bulk  , I have enclosed a HTTP.send(req) in for loop .
If there are more than 100 records getting updated , more that 100 callouts gettting called in single transaction and will throw callout limit exception .

Any better design to avoid the error and functionality works fine even for bulk data.
  • June 08, 2018
  • Like
  • 0
Hi Devs,

I need a urgent help !!! There is Api only User Profile which is accessed by Third party application . The Profile has permission to read and edit opportunity object and Task object only and no access to other objects(including contact object )as security concerns . 
The third party application wants to create a task and assoiciate who id to contact record and what id to opportunity record . The 3rd party is able to create task and associate to opportunity but cannot associate it to contact .
So workaround which we created was a custom field which will store contact id provided by custom field and assoicate that task to contact present in contact id field using trigger (since trigger run in system mode) .But the issue still persist and application is not able to associate contact record to task during creation . 
Are they any alternatives ?

Regards,
Sanju C A
 
  • September 07, 2017
  • Like
  • 0
Hi Devs ,

I have two vf page which has similar form and fields , so thinking to design a VF component and use this vf comp in both the VF pages . 
But I want to refer the apex variable of custom controller of Vf component in VF page which uses it .
Can you please tell me how to do that ?

Regards,
Sanju
  • June 02, 2017
  • Like
  • 0
Hi All ,

I have a VF page which is a standard controller(opportunity) with extension . It has a form with some input text fields and next button ,
Next button calls pagereference method which redirects the page to std edit pagelayout of opportunity(setRedirect(false)) .In the url I have also mentioned retURL which points to the VF page .
So my query is when I fill  some text fields and clicks on next button , it redirects to opp edit page . Now when I click on cancel button, It takes me to vf page but the form values are missing . 
Can anyone tell me why the view state is missing or getting flushed out when i return back to VF page using cancel button .
Note : The form is html form , not a  <apex:form> .

As per salesforce doc , "if set to false, the redirect is a server-side forward that preserves the view state if and only if the target page uses the same controller and contains the proper subset of extensions used by the source page."

My source page is VF page (std cont -opp with ext) and target page is opportunity edit page .So here controller are the same . So it has to work as per the doc ? or am I missing something here
  • March 22, 2017
  • Like
  • 0
Hi All,

I have a VF snippet which contains input fields and call external api for autocomplete functionality. I need to display this in edit page layout . But there are 4 record types/4page layout for the object .
Is there any approach /solution where in I can display the VF snippnet in all edit page layouts or should I create 4 Vf pages to recreate 4 page layouts +to show VF snippet and choose each Vf page using record types.
  • March 15, 2017
  • Like
  • 0

Hi ,
I have created a VF page containing  form which has 4 address fields(street,city,state,country) those are populated by autocomplete functionality using 3rd party application .
I want to display this in edit page of opportunity object .
Later I knew that vf page  cannot be placed in edit page layout .
So I looked into button overriding options , But there is a issue  , The opportunity object has 4 record types/4 page layouts .
If I override the new / edit button with the automplete VF page along with other input fields(replicate edit pagelayout fields)  , the display would be same irrespective of record types .
This will cause a mismatch in fields display or page layouts will be ineffective .

1) So for edit functionality , should I create 4 apex pages to display  fields form 4 correspodning page layouts and check which record type is checked , So the Vf page can be dynamically choosen ?
2) And what about autocomplete VF page? since this functionality is common , Can I convert this Vf page to VF component ,so It can be used in all 4 page layouts?
Regarding the 

  • March 14, 2017
  • Like
  • 0
Hi All ,

I have a requirement to use standard aproval process functionality in visualforce page . For that I used Standard controller and showed the detail page using apex:detail tag which shows the approval process button .

But when I click on the button , it is redirecting to detail record page , Instead I need it to remain in same visualforce page where the button is clicked and showing alert box saying record is sent for approval .
Please note that I dont want to use custom approval process with apex 
Can anyone help me here?
Regards,
 
  • August 19, 2016
  • Like
  • 0
Hi All ,

There is an integration code which is already developed in our org , I am not sure whether they have used SOAP API or REST API in achieving the integartion .
Below is the code , can you please help me .

private string Senddata(string authdetails,string endPoint,string soapAction,string requestBody)
    {

        Httprequest soap_request = new Httprequest();

        string xml='';
        http soa = new http();
        Httpresponse soap_response = new Httpresponse();
        soap_request.setEndpoint(endPoint);
        soap_request.setHeader('SOAPAction',soapAction);
        
        soap_request.setMethod('POST');
        soap_request.setHeader('X-DocuSign-Authentication', authdetails);
        soap_request.setHeader('Content-type', 'text/xml; charset=utf-8');
        soap_request.setHeader('Content-Length', ''+requestBody.length());
        
        soap_request.setTimeout(30000);
        soap_request.setBody(requestBody);
        try
        {
            soap_response = soa.send(soap_request);
            xml = soap_response.getbody();
            
        }
        catch(System.CalloutException ex)
        {
            System.Debug('Call out Exception thrown: ' + ex.getMessage());
            throw ex;
        }
        catch (Exception e)
        {
            xml=e.getmessage();
            System.Debug('Exception occured: ' + e.getMessage());
        }
        return xml;
    }

The data is sent in form of xml .

Few are saying its Rest and few are saying its SOAP
  • February 10, 2016
  • Like
  • 0
I am unable to query Entity particle object in apex class . Getting the below error
sObject type 'Entityparticle ' is not supported

But it works perfectly fine in developer console and workbench
  • January 06, 2016
  • Like
  • 0
Has any worked on bar code generation , i have a requirement to convert the text to pdf417 barcode font and then send the font to third party app for bar code generation.
  • October 12, 2015
  • Like
  • 0
Hello All ,

I have designed a sample action function method to a call controller from JS and its working  fine.But  I need to do an enhancement like if checkbox is unselected the output text should not be rendered ( currenlty , once if the checkbox is selected , it remains forever) . Please help me ,below is the code.
P.S : Check box is not part of object , its just custom checkbox which is created in VF page
Visualforce 
------------------


Public class Actionfunction {
Public string MyString_From_Methode{get;set;}
    public Actionfunction(ApexPages.StandardController controller) {

    }

    public string ActionFunMethode(){
     MyString_From_Method = 'Method called from js using Action function';

  
     return null;
    }
}

Apex :
--------

<apex:page standardcontroller="Account" extensions="Actionfunction" tabStyle="Account">
    <apex:form >
       <apex:actionFunction name="actionFunName" action="{!ActionFunMethod}" reRender="outputtxtId"/>
       <apex:pageBlock > 
            <apex:outputLabel for="inptCheckBox" value="Check this box to call Controller method from js using ActionFunction" style="color:green;"></apex:outputLabel> 
            <apex:inputcheckbox onclick="javaScrpt()" id="inptCheckBox" />
       </apex:pageBlock> 
      
      <apex:outputText value="{!MyString_From_Methode}" id="outputtxtId" ></apex:outputText> 
    </apex:form> 
    
    <script>
      function javaScrpt(){
       actionFunName(); 
      }
    </script>
     
</apex:page>
  • July 06, 2015
  • Like
  • 0
Hi Devs,

I have requirement  which goes like this ,
There is a force.com site which inserts opportunity records into sfdc system . Now Business wants to show a pop up window (notification) to all user as soon as the opportunity records gets inserted  and that pop up should have a button for user to take ownership of that record . 
Is it implementable ? Can we notify user using pop up screen ?
  • September 18, 2018
  • Like
  • 0
Hi Devs ,
I have a component which is invoked through quick action present in event record page .The component is referring to force:hasRecordId interface .
The value of recordid is resulting to  undefined  when debugged. 
<!--component>

<aura:component controller="customLookUpController" implements="flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction">
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
</aura:component>

<!--controller>
({
    doInit: function(component,event,helper) {
        var getId = component.get("v.recordId");   -- > undefined 
},
})
  • June 27, 2018
  • Like
  • 0
Hi Devs ,

I have two vf page which has similar form and fields , so thinking to design a VF component and use this vf comp in both the VF pages . 
But I want to refer the apex variable of custom controller of Vf component in VF page which uses it .
Can you please tell me how to do that ?

Regards,
Sanju
  • June 02, 2017
  • Like
  • 0
I have a visualforce page:

<apex:page standardController="Quote">
<apex:form >
  <apex:pageBlock title="Teste">
      <apex:pageBlockSection title="Seção" columns="2">
          <apex:inputField value="{!Quote.Name}"/>
          <apex:inputField value="{!Quote.ExpirationDate}"/>
          <apex:inputField value="{!Quote.Status}"/>
          <apex:inputField value="{!Quote.Tipo__c}"/>
      </apex:pageBlockSection>
      <apex:pageBlockButtons >
          <apex:commandButton action="{!save}" value="Salvar"/>
          <apex:commandButton action="{!cancel}" value="Cancelar"/>
          <apex:commandButton action="{!edit}" value="Editar"/>
          <apex:commandButton action="{!delete}" value="Apagar"/>
      </apex:pageBlockButtons>
  </apex:pageBlock>
</apex:form>
</apex:page>

But it is not avaliable to use in a Opportunity button, just in a Quote button, this page will be used to create a quote from the opportunity page in Salesforce1, how do I this?
Hello guys I am trying to get the code coverage of the apex callout in rest API. Method is getting failed and I am able to achieve only 40% code coverage of the class. Please give your valuable suggestions. Thanks in advance..!


Apex Class
global with sharing class CreateCasesByContract 
{

    global static string GetToken(string userName, string password)
    {   
        string accessToken;
        Http client = new Http();
        HttpRequest req = new HttpRequest();
        req.setEndpoint('-------------------');
        req.setMethod('POST');
        string encodedBody = EncodingUtil.urlEncode('grant_type','UTF-8')+'='+EncodingUtil.urlEncode('password','UTF-8')+'&'+EncodingUtil.urlEncode('username','UTF-8')+'='+EncodingUtil.urlEncode(userName, 'UTF-8')+'&'+EncodingUtil.urlEncode('password','UTF-8')+'='+EncodingUtil.urlEncode(password, 'UTF-8');
        req.setHeader('content-type', 'application/x-www-form-urlencoded');
        req.setBody(encodedBody);
        HttpResponse res = client.send(req);
        String Token = res.getBody(); 
        system.debug('J!GS' + Token );

        JSONParser parser = JSON.createParser(Token);
        While(parser.nextToken() != null)
        {
            if ((parser.getCurrentToken() == JSONToken.FIELD_NAME)) 
            {
                String fieldName = parser.getText();
                parser.nextToken();
                if(fieldName == 'access_token')
                {
                    accessToken = parser.getText();      
                } 
            }
        }

        return accessToken;
    } 


    global  Integer CreateCase()
    {
    Integer C;
        //Make POST call for getting AssocType object 
        string assocData;
        String access_token = GetToken('API_Admin','Boxer@123');

        Http client = new Http();
        HttpRequest req = new HttpRequest();
        req.setEndpoint('------------------'+ System.UserInfo.getName() +'&caseType= 82');
        req.setMethod('GET');      
        req.setHeader('content-type', 'application/json');
        req.setHeader('Authorization', 'bearer ' + access_token);
        HttpResponse res = client.send(req);
        String assocString = res.getBody();      
        ApiResponse APIRes = new ApiResponse();

        APIRes = (ApiResponse) System.JSON.deserialize(assocString, ApiResponse.class);

        system.debug('ApiRes object '+ APIRes);
        string CID2;

        List<Contract>  ConList = [Select id,Property_Manager__c,DueDate__c,Region__c,PROPERTY_CODE__c, BP_Property__r.Name,bp_property_id__c,Region_ID__c,
                                   LeasingAgentSAM__c ,BP_Unit__r.Name from Contract where  Id =: cid and Broker_Involved__c = 'Yes'  ORDER BY LastModifiedDate  DESC  limit 1];

        List<textValuescls> txstring = New List<textValuescls>();

        string metadataValue = '';

        String CurrentUserofSFstr = UserInfo.getName();

        CaseData cd = New CaseData();


        //Mapping the Contarct data With AssocDataTypes and Passing parameters.

        ****for(AssocType AC: APIRes.ResponseContent)
        {
            for(Contract  C1 : ConList)
            {   
                CID2 = C1.Id;
                string CaseTitelstr = C1.PROPERTY_CODE__c  + '  X  '+  C1.BP_Unit__r.Name   +    'Broker Commission Request';
                if(AC.Description == 'Property')
                {
                    metadataValue += AC.AssocTypeID + ',0,' + C1.bp_property_id__c +  ',' + AC.Description + ',' + C1.BP_Property__r.Name +'|';
                }
                else if(AC.Description == 'Region')
                {
                    metadataValue += AC.AssocTypeID + ',0,' + C1.Region_ID__c + ',' + AC.Description +',' + C1.Region__c + '|';
                }
                else if(AC.Description == 'Status')
                {   
                    metadataValue += AC.AssocTypeID + ',3784,0,Status,New ';
                }
                else if(Ac.Description == 'Suite')
                {   
                    textValuescls tx1 = new textValuescls();
                    tx1.key = Ac.AssocTypeID;
                    tx1.value = C1.BP_Unit__r.Name;                    
                    txstring.add(tx1);
                }
                else if(Ac.Description == 'Due Date')
                {   
                    string duedate = string.valueOf(C1.DueDate__c);
                    textValuescls tx2 = new textValuescls();
                    tx2.key = Ac.AssocTypeID;
                    tx2.value = duedate;                    
                    txstring.add(tx2);
                }
                else if (AC.Description == 'Case Title')
                {
                    textValuescls tx3 = new textValuescls();
                    tx3.key = Ac.AssocTypeID;
                    tx3.value = CaseTitelstr;                    
                    txstring.add(tx3); 
                }
                cd.currentUser = C1.LeasingAgentSAM__c;
                cd.metaDataValues = metadataValue ;
                cd.caseNotes = 'Testing REST API from Salesforce  Please ignore this case  ' + CurrentUserofSFstr; 
                cd.textValues = txstring;
                cd.caseTitle = CaseTitelstr;
                cd.caseType = 82 ;
                cd.assignTo = 'xyz'; 
            }
        }
        //Converting  CaseData object and parameters in json fromat 
        String JSONString = JSON.serialize(cd);
        System.debug('Serialized list of invoices into JSON format: ' + JSONString);
        Http client1 = new Http();
        HttpRequest req1 = new HttpRequest();
        req1.setEndpoint('------------------------------');
        req1.setMethod('POST');      
        req1.setHeader('content-type', 'application/json');
        req1.setHeader('Authorization', 'bearer ' + access_token);
        req1.setBody(JSONString);
        HttpResponse res1 = client1.send(req1);
        string caseDataFinal = res1.getBody();
        system.debug('Final test ' + caseDataFinal);
        APIResponseCaseData APIResCaseData = new APIResponseCaseData();
        APIResCaseData = (APIResponseCaseData) System.JSON.deserialize(caseDataFinal, APIResponseCaseData.class);
        Integer caseIdFinal = APIResCaseData.ResponseContent;
        system.debug('Final test ' + caseIdFinal);
        ID coid = Id.valueOf(CID2);
        system.debug('^^^^^^^ID^^^^^^' + coid);
        List<Contract> CList = new List<Contract>();
        contract con = new Contract();
        //con.Id = coid;
        con.BCR_Case_Id__c = caseIdFinal;
        CList.add(con);
        Update CList;
    return C;
    }**
}

Mock Class :
global class CreateCasesByContractMock implements HttpCalloutMock {

    global HTTPResponse respond(HTTPRequest request) {

        // Create a fake response
        HttpResponse response = new HttpResponse();
        response.setHeader('Content-Type', 'application/json');
        response.setBody(' {"caseTitle": "4200t  X 520 Broker Commission Request ",  "caseType": 82,  "assignTo": "JigneshC",  "currentUser": "Testing"}');
        response.setStatusCode(200);
        return response; 

    }*  

}

Test Class :
@isTest Public class TestCreateCasesByContract{

    Public Static testmethod void mytest()

    {  
        Test.setMock(HttpCalloutMock.class, new CreateCasesByContractMock()); 

        HttpResponse  response = New HttpResponse ();
        test.startTest();
        CreateCasesByContract.GetToken('userName', 'password');
        test.stopTest();



    }

    public static testmethod  void testsaveDataToSF()
    {
        Test.setMock(HttpCalloutMock.class, new CreateCasesByContractMock());


        AssocType AC = New AssocType();

        test.startTest();
        CreateCasesByContract.CreateCase();
        test.stopTest();

    }**


}

 
  • April 05, 2017
  • Like
  • 0
this is my trigger:


trigger JOBTriger on Job_Application__c (after insert, after update) {
set<id> jobId = new set<id>();
set<id> contId=new set<id>();
for(Job_Application__c p : trigger.new){
      jobId.add(p.Job_Master_JObApplication__c);
      contId.add(p.Contact_Job_application__c);
 }
Map<id,Job__c> mapJobList = new Map<id,Job__c>([select Id,Job_Category__c  from Job__c where Id in : jobId]);
Map<id,Contact>mapcontactList=new Map<id,Contact>([Select ID, Bussiness__c  from Contact where id in :contId]);
List<Contact> updateToContact=new List<Contact>();

for(Job_Application__c j : trigger.new){
      Job__c jobData=new Job__c();
     Contact contData= new Contact();
   
      jobData=mapJobList.get(J.JOB_Master_JObApplication__c);
      contData=mapcontactList.get(j.Contact_Job_application__c);
      
       try{
      if(jobData.Job_Category__c !=null || jobData.Job_Category__c !=''){
        if(jobData.Job_Category__c =='Business Sale-Financial Planing'){
            if(contData.Bussiness__c==null){
              contData.Bussiness__c='Financial Planing Buyer';
              }else{
            contData.Bussiness__c= contData.Bussiness__c+';'+'Financial Planing Buyer';
            }
        
        }
        if(jobData.Job_Category__c =='Business Sale-Accounting'){
        if(contData.Bussiness__c==null){
            contData.Bussiness__c='Accounting Buyer';
            }else{
             contData.Bussiness__c= contData.Bussiness__c+';'+'Accounting Buyer';
             }

        }
        if(jobData.Job_Category__c =='Business Sale-Mortgage'){
        if(contData.Bussiness__c==null){
           contData.Bussiness__c='Mortgage Buyer';
           }else{
              contData.Bussiness__c= contData.Bussiness__c+';'+'Mortgage Buyer';
              }

        }
        if(jobData.Job_Category__c =='Business Sale-Real Estate'){
        if(contData.Bussiness__c==null){
            contData.Bussiness__c='Real Estate Buyer';
            }else{
              contData.Bussiness__c= contData.Bussiness__c+';'+'Real Estate Buyer';
              }

        }
        if(jobData.Job_Category__c =='Business Sale-Legal Firm'){
        if(contData.Bussiness__c==null){
            contData.Bussiness__c='Legal Firm Buyer';
            }else{
              contData.Bussiness__c= contData.Bussiness__c+';'+'Legal Firm Buyer';
              }

        }
        
        
        
          updateToContact.add(contData);
          }
      
      
    
      
      
 
 Upsert updateToContact;
 }
 
 
  catch(Exception e){
      System.debug(e);
      
      }
      }
   
      
  
      }


this is my test class:

@isTest
Public class TestJobApplicationn {

@isTest static void testContactt()
  {
 
          JOB__c j= new JOB__c();
        j.name='Abcc';
        j.Account__c='Jobc';
        j.Job_Category__c='Business Sale-Financial Planing';
       insert j;

 
  TerritoryPostCode__c terri= new TerritoryPostCode__c ();
        terri.Name='1100';
        terri.Main_City__c='Haldia';
        
        insert terri; 

    Contact c= new Contact();
        c.FirstName='Vi';
        c.LastName='dass';
        c.Business_Sales_Status__c='Financial Planing Buyer';
        
       c.PostCode__c=terri.id;
     
       
        insert c;
     
  

    
       Job_Application__c job= new Job_Application__c();
        job.name='TestJobApplications';
        job.Candidate__c='Ajiot ggs';
        job.Candidate_Email__c='ajs@gmail.com';
        job.Job_Title__c='Finance';
        job.Priority__c='Low'; 
        job.Contact_Job_application__c=c.id;
        job.JOB_Master_JObApplication__c=j.id;
         insert job; 
         
    } 
   
      
 }


Its give 63% covarage, but i need atlast 80%. how can i do it?
 
I would like to create a validation rule to prevent a record from being saved if the time is after X.  I have attempted this, but I can't see where I can reference the current time.  Any ideas?


AND (
ISPICKVAL (  Status__c , "Submitted" ),
Due_Date__c  =  TODAY() ,
Current time  <=  4 pm 
)
Hi All ,

I have a VF page which is a standard controller(opportunity) with extension . It has a form with some input text fields and next button ,
Next button calls pagereference method which redirects the page to std edit pagelayout of opportunity(setRedirect(false)) .In the url I have also mentioned retURL which points to the VF page .
So my query is when I fill  some text fields and clicks on next button , it redirects to opp edit page . Now when I click on cancel button, It takes me to vf page but the form values are missing . 
Can anyone tell me why the view state is missing or getting flushed out when i return back to VF page using cancel button .
Note : The form is html form , not a  <apex:form> .

As per salesforce doc , "if set to false, the redirect is a server-side forward that preserves the view state if and only if the target page uses the same controller and contains the proper subset of extensions used by the source page."

My source page is VF page (std cont -opp with ext) and target page is opportunity edit page .So here controller are the same . So it has to work as per the doc ? or am I missing something here
  • March 22, 2017
  • Like
  • 0
Hi All,

I have a VF snippet which contains input fields and call external api for autocomplete functionality. I need to display this in edit page layout . But there are 4 record types/4page layout for the object .
Is there any approach /solution where in I can display the VF snippnet in all edit page layouts or should I create 4 Vf pages to recreate 4 page layouts +to show VF snippet and choose each Vf page using record types.
  • March 15, 2017
  • Like
  • 0

Hi ,
I have created a VF page containing  form which has 4 address fields(street,city,state,country) those are populated by autocomplete functionality using 3rd party application .
I want to display this in edit page of opportunity object .
Later I knew that vf page  cannot be placed in edit page layout .
So I looked into button overriding options , But there is a issue  , The opportunity object has 4 record types/4 page layouts .
If I override the new / edit button with the automplete VF page along with other input fields(replicate edit pagelayout fields)  , the display would be same irrespective of record types .
This will cause a mismatch in fields display or page layouts will be ineffective .

1) So for edit functionality , should I create 4 apex pages to display  fields form 4 correspodning page layouts and check which record type is checked , So the Vf page can be dynamically choosen ?
2) And what about autocomplete VF page? since this functionality is common , Can I convert this Vf page to VF component ,so It can be used in all 4 page layouts?
Regarding the 

  • March 14, 2017
  • Like
  • 0
Hi,

I have managed package installed in ord and accessing the web service from mobile app.

As I am new to managed package hence could someone help on below queries:
So from where we can check that what type of web service is used, what are method or input/output of the web service method.
Can we able to download the wsdl from managed package?

Thanks
Preyanka