• ajitverma
  • NEWBIE
  • 24 Points
  • Member since 2008
  • Technical consultant

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 32
    Questions
  • 24
    Replies
I am new to Lightning app development. I tried "Hello world" sample app given in salesforce quick start guide (https://developer.salesforce.com/resource/pdfs/Lightning_QuickStart.pdf). I first created the App and I was able to preview in browser successfully but when I embedded component into the app then "URL No Longer Exists" error was thrown. I have followed same steps given in the guide but not sure why it is not working. Any help is appreciated.


 
In Update trigger, Is there a way to know how many fields are updated? I have a scenario where a user should be able to update only one specific field on custom object.
There are more than 100 fields on custom object and I do not want to check old and new value for each and every field.

Thanks in advace for viewing this thread.

Currently email alerts for Opportunity are going to all users irrespective of the license types. Users with “Salesforce Platform” license receive emails but cannot access Opportunity records. Is there any way to avoid email notifications sent to platform users.  Emails are sent using workflow email alerts.

Can I use Apex data loader with Windows 2008 Server? I don't find any documentation which says that Apex data loader is compatible with 2008 server. Has anyone use this? and what are the opinions on using data loader on 64 bit machine, does this work fine without any issues?

Hi All,

 

Is there any way to remove 'DEL' option from Email realted list available on Case detail page? Basically we want to prevent the user from deleting Email messages received against the case.

 

This can be achieved by writing trigger on Email Message object but I am looking for any OOB functionality. I don't find any setting available under profile.

 

 

 

 

Hi,

 

While setting up Auto Response Rule for email-to-case, In step 3 under Email adderss I see info (This must be different from the routing address). What I understand by that statement, that I should not use the routing addess configured for email-to-case as Sender's email address e.g. support@company.com. However, I can set the same address and does not see any issues. Everything works fine, reply emails are attached to the case etc.

 

I don't find any documentation on mentioning the statement not to use routing address in sender's email. Does anyone of you have observerd any issues with this setting or use the same routing and sender email address.

 

Thanks

Hi,

 

Is there any way to add Parent Case field visible on Case close layout? Currently this is even not visible in page setup.

 

 

Hi,

 

Current runing user has read only access to Standard Account and Contact object and can view them by selecting from list view. However, user is not able to search those records from home page search box and also from lookup search.

 

What could be the issue, am I missing some configuration?

 

 

Thanks

Hi Folks,

 

I have requirement to configure "Country" as a data category group and have different country values as data categories. This is required to differentiate articles country wise. As per the requirement Article Manager should be able to publish the articles related to his/her country only. But inside kb setup, we cannot define Article Action groups based on category. Is there any way to restrict the Article Manager publishing articles which are not related to his country?

 

Basically I am looking for a way to allow a user to publish the articles for a specifc category value only and not of all categories.

Any idea, how can this be implemented?

 

Cheers

Ajit

Hi,

 

I am using time-based workflow action to send an email in every 15 minutes. but email are sent with delay of 10 minutes, however time of execution displayed in time based workflow queue is correct. Why is the lag of 10 minutes?

 

 

Thanks

 

 

Hi,

 

In Email-to-case scenario, I want to store support email address on case record. This is to identify the email address to which customer has sent email as there are multiple support email addresses provided to customers.

 

One solution I see is to get the address from EmailMessage record by writing a trigger. Is there any other work-around to get this done?

 

 

Thanks

A

 

 

 

Hi Experts,

 

Just a quick question. 

 

One sharing rule on case object to share cases owned by user A with user B  with Read-only access. Sharing rule working fine and does not allow user B to modify the case. However, user B is able to add new case comments to the case but can not delete created by him (B) . While this should not be the scenario as CaseComment should derived security settings of Case object.

 

Thank

AV

HI,

 

I have enabled and configured Entitlment Management in developer instance. Everything (Model, Milestones, Process and Entitlement) has been setup correclty. I have added Entitlement and Milestone related fileds and related list on case page layout correctly. However, I am not able to assign Entitlement on Case record because 'Entitlement Name' field is not displayed on page layout (edit/detail) even it has been included. Other entitlement related fields like Entitlement Process Start Time and Entitlement Process End Time also been included but not displayed on actual layout. 

 

This issue looks weird but not finding the root cause. If anyone has any idea about the issue kindly let me know.

 

Thanks

 

Hi All,

 

I have one approval process defined on one custom object. This process has three steps (Approval One, Approval Two and Approval Three) which have different entry criteria. All these steps are checked when user submits the record for approval and everything works fine. Problem comes only when record is submitted for approval and rejected and submitted for approval. Below is the exact use case.

 

  1. Sales Rep creates the record and submits for approval. (Approval steps is “Approval Two”)
  2. Approval criteria is matched for second steps (only) and request goes to approving authority. (Approval steps is “Approval Two”)
  3. Approving authority rejects the record. (Approval steps is “Approval Two”)
  4. Sales Rep modifies the record and re-submits for approval. (Approval steps is “Approval Two”)
  5. Approving authority approves the record. (Approval steps changes to “Approval One”)

After approval step is changed to the first one no matter if the original step was two or three. Also this happens only if the step is rejected. If the record is approved in first attempt. Approval step remains to original step.



Before Approval

Before Approval

After Approval

After Approval


Thanks for reading this all and any help is appreciated.


 

Hi All,

 

I have requirement where I have to implement Cybersource payment gateway in Salesforce.com. I am trying to use Cybersource Hosted Order Page approach to implement this functionality.

 

Cybersource has provided me some sample JSP pages which I can use in any java based web application and implement the payment gateway within that application and I am able to do that.

 

Now I have to simulate the same functionality in Salesforce.com using Visualforce and Apex. I am able to simulate most of the code in Apex but got stuck while simulating Message Authentication code and secret key. Below is the code written in java which I need to simulate in Apex.

 

 

  public String getPublicDigest(String customValues) throws Exception{
    String pub =  "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC2L8taoXQvBV5xddZp58JE2i3rQauaBe1U1lEQCIYNYlIQSt4J6++F6NBgmCx1vnSCX2s4O0FI3S5b/No7QTfKkO19ofJVYBB6hdlcPStHsnYLV9mDmHuFfiR8Ebk3dUWYVCQX+eyZj99WQmYiTPIEZSAuB54jTMRQwyAE5GsVwIDAQAB";    
    BASE64Encoder encoder = new BASE64Encoder();
    Mac sha1Mac = Mac.getInstance("HmacSHA1");
    SecretKeySpec publicKeySpec = new SecretKeySpec(pub.getBytes(), "HmacSHA1");
    sha1Mac.init(publicKeySpec);
    byte[] publicBytes = sha1Mac.doFinal(customValues.getBytes());
    String publicDigest = encoder.encodeBuffer(publicBytes);
    return publicDigest.replaceAll("\n", "");
  }

Here is the code which I simulated in Apex but the key generated is still invalid.

 

 

    public String getPublicDigest(String customValues){
	String secretKey = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC2L8taoXQvBV5xddZp58JE2i3rQauaBe1U1lEQCIYNYlIQSt4J6++F6NBgmCx1vnSCX2s4O0FI3S5b/No7QTfKkO19ofJVYBB6hdlcPStHsnYLV9mDmHuFfiR8Ebk3dUWYVCQX+eyZj99WQmYiTPIEZSAuB54jTMRQwyAE5GsVwIDAQAB';
        //Blob blobDigest = Crypto.generateDigest('hmacSHA1', Blob.valueOf(pub));
        Blob sha1Mac = Crypto.generateMac('hmacSHA1', Blob.valueOf(customValues), EncodingUtil.base64Decode(secretKey));
        String publicDigest = Encodingutil.convertToHex(sha1Mac);
        return publicDigest;
    }

 

 

Any help is appreciated.

 

 

 

Hi All,
I am consuming a WSDL in SFDC and while invoking its operations getting System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element http://serviceProvider.com/star/=output. When I generate proxy class using wsdl2Apex, I can see separte inner classes generated for output.
I have given the reponse message and generate apex class below. Any help is appreciated.

 

 

//Generated by wsdl2apex

public class wk_biztalk_Star {
    public class TicketNewResponse_element {
        public wk_biztalk_Star.output_type TicketNewResult;
        private String[] TicketNewResult_type_info = new String[]{'TicketNewResult','http://serviceProvider.com/star/','output_type','0','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://serviceProvider.com/star/','true','false'};
        private String[] field_order_type_info = new String[]{'TicketNewResult'};
    }
    public class TicketNew_type {
        public String ApplicationID;
        public String UserEmailAddress;
        public String UserFirstName;
        public String UserLastName;
        public String TicketDataXML;
        private String[] ApplicationID_type_info = new String[]{'ApplicationID','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] UserEmailAddress_type_info = new String[]{'UserEmailAddress','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] UserFirstName_type_info = new String[]{'UserFirstName','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] UserLastName_type_info = new String[]{'UserLastName','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] TicketDataXML_type_info = new String[]{'TicketDataXML','http://www.w3.org/2001/XMLSchema','string','0','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://serviceProvider.com/star/','true','false'};
        private String[] field_order_type_info = new String[]{'ApplicationID','UserEmailAddress','UserFirstName','UserLastName','TicketDataXML'};
    }
    public class TicketNew_element {
        public wk_biztalk_Star.input_type input;
        private String[] input_type_info = new String[]{'input','http://serviceProvider.com/star/','input_type','0','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://serviceProvider.com/star/','true','false'};
        private String[] field_order_type_info = new String[]{'input'};
    }
    public abstract class input_type {} 
    
    public class input_type_TicketNew extends input_type {
        public wk_keith_Star.TicketNew_type TicketNew;
        private String[] TicketNew_type_info = new String[]{'TicketNew','http://serviceProvider.com/star/','TicketNew_type','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://serviceProvider.com/star/','true','false'};
        private String[] field_order_type_info = new String[]{'TicketNew'};
    }
    
    public class BasicHttpBinding_ISTARSoap {
        public String endpoint_x = 'http://sfdc.wkestoreservicesdev.com/WKUS.SFDC.WCF.STAR/STARSoap.svc';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://schemas.microsoft.com/2003/10/Serialization/', 'wk_biztalk_Star_Serialization', 'http://serviceProvider.com/star/', 'wk_biztalk_Star'};
        public wk_biztalk_Star.output_type TicketNew(wk_biztalk_Star.input_type input) {
            wk_biztalk_Star.TicketNew_element request_x = new wk_biztalk_Star.TicketNew_element();
            wk_biztalk_Star.TicketNewResponse_element response_x;
            request_x.input = input;
            Map<String, wk_biztalk_Star.TicketNewResponse_element> response_map_x = new Map<String, wk_biztalk_Star.TicketNewResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              'http://serviceProvider.com/star/ISTARSoap/TicketNew',
              'http://serviceProvider.com/star/',
              'TicketNew',
              'http://serviceProvider.com/star/',
              'TicketNewResponse',
              'wk_biztalk_Star.TicketNewResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.TicketNewResult;
        }
    }
    public class output_type {
        public String Output;
        private String[] Output_type_info = new String[]{'Output','http://www.w3.org/2001/XMLSchema','string','1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://serviceProvider.com/star/','true','false'};
        private String[] field_order_type_info = new String[]{'Output'};
    }
}

 

 

16:51:16.836|CALLOUT_RESPONSE|[602]|
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
	<TicketNewResponse xmlns="http://serviceProvider.com/star/">
		<TicketNewResult>
			<output>&lt;operation success="true" ticket_id="2050334" message=""/&gt;</output>
		</TicketNewResult>
	</TicketNewResponse>
</s:Body>
</s:Envelope>
16:51:16.837|EXCEPTION_THROWN|[602]|System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element http://serviceProvider.com/star/=output
16:51:16.837|METHOD_EXIT|[602]|WebServiceCallout.invoke(APEX_OBJECT, APEX_OBJECT, MAP, LIST)
16:51:16.838|METHOD_EXIT|[149]|wk_biztalk_Star.BasicHttpBinding_ISTARSoap.TicketNew(wk_biztalk_Star.input_type)
16:51:16.838|METHOD_ENTRY|[152]|System.debug(ANY)
16:51:16.838|USER_DEBUG|[152]|DEBUG|##Exception:[System.CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found for element http://serviceProvider.com/star/=output]
CalloutException: Web service callout failed: Unable to parse callout response. Apex type not found

 

 

Thanks,

Ajit

 

Hi All,

 

I have very simple question. I have a WSDL provided by the vendor which has separate XSD import. I know that SFDC does not support such WSDL to generate proxy classes. So I modified the WSDL document and include separate schemas into the same WSDL. This modification is done by me on the fly and nothing has been by the Vendor.

 

I am able to generate the proxy classes using customized WSDL but when I invoke the required operation I got the error message saying 

 

System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: An error occurred during a WCF call: Input parameter is invalid - XML Does not validate against schema: http://endpointaddress/Schema/SchemaName.xsd. Validation Error: The 'http://endpointaddress:ApplicationID' element is not declared. faultcode=s:Client faultactor

 

I just want to confirm wheather this is the right approach to customize the WSDL because I have no choice except modifying the WSDL.

 

Any help is appreciated.

 

Thanks,

 

 

 

Hi,

I am connecting to a webservice using visualforce controller. I have parsed the WSDL into proxy apex classes and have the service methods exposed. Now when I call the method and try to hit the service I get the error message saying.
System.CalloutException: IO Exception: External server did not return any content

When I call the same service using SOAP UI with same input parameters there is no issue and I get positive response from the service.

I validated from the service provider and came to know that when I make call from SFDC service is not getting hit. 

 

Any help is appreciated.

 

I have designed a VF page and using <iframe> tag to open an external site into the page itself. Purpose of embedding this iframe is to allow user to login into another website and view the external details in the same VF page. In Internet explorer, I can see the login screen but when I pass username/password, It does nothing and I can't login into external site. Same VF page is working perfect in Firefox and Chrome and I am able to login successfully and view external details.
Any help is appreciated.

 

I have designed a VF page and using <apex:iframe> tag to open an external site into the page itself. Purpose of embedding this iframe is to allow user to login into another website and view the external details in the same VF page. In Internet explorer, I can see the login screen but when I pass username/password, It does nothing and I can't login into external site. Same VF page is working perfect in Firefox and Chrome and I am able to login successfully and view external details.


Any help is appreciated.

HI,

 

I want to fetch validation/workflow rules metadata existing in the org using java application.  I am able to fetch a particular component in the org e.g. ValidationRule, Workflow etc using ListMetadataQuery object.

here is the code snippet to fetch component.

 

String sComponent = "ValidationRule"; ListMetadataQuery query = new ListMetadataQuery(null, sComponent); FileProperties[] fieFps = metadata_binding.listMetadata(new ListMetadataQuery[] {query});

for(FileProperties fp :fieFps){
logger.debug("Here : " + fp.getFullName());

}

 

 

In this way i get only the name of the rule but not the other attributes like (active, errorConditionFormula, errorMessage).

 

How can i fetch the other attributes of the component, in other words, how can i fetch the component as a particular object.

 

Any help is appreciated.

 

Thanks

Ajit

In Update trigger, Is there a way to know how many fields are updated? I have a scenario where a user should be able to update only one specific field on custom object.
There are more than 100 fields on custom object and I do not want to check old and new value for each and every field.

Thanks in advace for viewing this thread.

Currently email alerts for Opportunity are going to all users irrespective of the license types. Users with “Salesforce Platform” license receive emails but cannot access Opportunity records. Is there any way to avoid email notifications sent to platform users.  Emails are sent using workflow email alerts.

Hi,

 

I created a trigger who will the get the URL of my product's picture.

So far it's working as you can see

but i decided to create a pdf, my pictures will not appear

I don't understand what's happening =/

Sincerely,

 

Anyone has used Demo CTI Adapter??

 

I have installed it and configured my Development Org also. I am able to see Connect CTI Adapter but when I am clicking on this button, nothing is happening.

Can any one tell me what I have done wrong.

Hi All,

 

Is there any way to remove 'DEL' option from Email realted list available on Case detail page? Basically we want to prevent the user from deleting Email messages received against the case.

 

This can be achieved by writing trigger on Email Message object but I am looking for any OOB functionality. I don't find any setting available under profile.

 

 

 

 

Hi,

 

In Email-to-case scenario, I want to store support email address on case record. This is to identify the email address to which customer has sent email as there are multiple support email addresses provided to customers.

 

One solution I see is to get the address from EmailMessage record by writing a trigger. Is there any other work-around to get this done?

 

 

Thanks

A

 

 

 

HI,

 

I have enabled and configured Entitlment Management in developer instance. Everything (Model, Milestones, Process and Entitlement) has been setup correclty. I have added Entitlement and Milestone related fileds and related list on case page layout correctly. However, I am not able to assign Entitlement on Case record because 'Entitlement Name' field is not displayed on page layout (edit/detail) even it has been included. Other entitlement related fields like Entitlement Process Start Time and Entitlement Process End Time also been included but not displayed on actual layout. 

 

This issue looks weird but not finding the root cause. If anyone has any idea about the issue kindly let me know.

 

Thanks

 

Hi All,

 

I have requirement where I have to implement Cybersource payment gateway in Salesforce.com. I am trying to use Cybersource Hosted Order Page approach to implement this functionality.

 

Cybersource has provided me some sample JSP pages which I can use in any java based web application and implement the payment gateway within that application and I am able to do that.

 

Now I have to simulate the same functionality in Salesforce.com using Visualforce and Apex. I am able to simulate most of the code in Apex but got stuck while simulating Message Authentication code and secret key. Below is the code written in java which I need to simulate in Apex.

 

 

  public String getPublicDigest(String customValues) throws Exception{
    String pub =  "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC2L8taoXQvBV5xddZp58JE2i3rQauaBe1U1lEQCIYNYlIQSt4J6++F6NBgmCx1vnSCX2s4O0FI3S5b/No7QTfKkO19ofJVYBB6hdlcPStHsnYLV9mDmHuFfiR8Ebk3dUWYVCQX+eyZj99WQmYiTPIEZSAuB54jTMRQwyAE5GsVwIDAQAB";    
    BASE64Encoder encoder = new BASE64Encoder();
    Mac sha1Mac = Mac.getInstance("HmacSHA1");
    SecretKeySpec publicKeySpec = new SecretKeySpec(pub.getBytes(), "HmacSHA1");
    sha1Mac.init(publicKeySpec);
    byte[] publicBytes = sha1Mac.doFinal(customValues.getBytes());
    String publicDigest = encoder.encodeBuffer(publicBytes);
    return publicDigest.replaceAll("\n", "");
  }

Here is the code which I simulated in Apex but the key generated is still invalid.

 

 

    public String getPublicDigest(String customValues){
	String secretKey = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC2L8taoXQvBV5xddZp58JE2i3rQauaBe1U1lEQCIYNYlIQSt4J6++F6NBgmCx1vnSCX2s4O0FI3S5b/No7QTfKkO19ofJVYBB6hdlcPStHsnYLV9mDmHuFfiR8Ebk3dUWYVCQX+eyZj99WQmYiTPIEZSAuB54jTMRQwyAE5GsVwIDAQAB';
        //Blob blobDigest = Crypto.generateDigest('hmacSHA1', Blob.valueOf(pub));
        Blob sha1Mac = Crypto.generateMac('hmacSHA1', Blob.valueOf(customValues), EncodingUtil.base64Decode(secretKey));
        String publicDigest = Encodingutil.convertToHex(sha1Mac);
        return publicDigest;
    }

 

 

Any help is appreciated.

 

 

Hi All,

 

I have very simple question. I have a WSDL provided by the vendor which has separate XSD import. I know that SFDC does not support such WSDL to generate proxy classes. So I modified the WSDL document and include separate schemas into the same WSDL. This modification is done by me on the fly and nothing has been by the Vendor.

 

I am able to generate the proxy classes using customized WSDL but when I invoke the required operation I got the error message saying 

 

System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: An error occurred during a WCF call: Input parameter is invalid - XML Does not validate against schema: http://endpointaddress/Schema/SchemaName.xsd. Validation Error: The 'http://endpointaddress:ApplicationID' element is not declared. faultcode=s:Client faultactor

 

I just want to confirm wheather this is the right approach to customize the WSDL because I have no choice except modifying the WSDL.

 

Any help is appreciated.

 

Thanks,

 

 

 

Hi,

I am connecting to a webservice using visualforce controller. I have parsed the WSDL into proxy apex classes and have the service methods exposed. Now when I call the method and try to hit the service I get the error message saying.
System.CalloutException: IO Exception: External server did not return any content

When I call the same service using SOAP UI with same input parameters there is no issue and I get positive response from the service.

I validated from the service provider and came to know that when I make call from SFDC service is not getting hit. 

 

Any help is appreciated.

 

I have designed a VF page and using <iframe> tag to open an external site into the page itself. Purpose of embedding this iframe is to allow user to login into another website and view the external details in the same VF page. In Internet explorer, I can see the login screen but when I pass username/password, It does nothing and I can't login into external site. Same VF page is working perfect in Firefox and Chrome and I am able to login successfully and view external details.
Any help is appreciated.

 

I have designed a VF page and using <apex:iframe> tag to open an external site into the page itself. Purpose of embedding this iframe is to allow user to login into another website and view the external details in the same VF page. In Internet explorer, I can see the login screen but when I pass username/password, It does nothing and I can't login into external site. Same VF page is working perfect in Firefox and Chrome and I am able to login successfully and view external details.


Any help is appreciated.

Hi,

 

I am trying to deploy the metadata from sandbox org to production org using ANT. but while deploying Contract object i am facing below error on custom fields declared in the Object.

 

objects/Contract.object(Contract.BusinessUnit__c):exceeded the allowed number of fields to track on a given entity
objects/Contract.object(Contract.MasterAgreementNumber__c):exceeded the allowed number of fields to track on a given entity
objects/Contract.object(Contract.MasterContractId__c):exceeded the allowed number of fields to track on a given entity
objects/Contract.object(Contract.RevisionNumber__c):exceeded the allowed number of fields to track on a given entity

 

 

Thanks

Ajit Verma

Hi All,

 

I have the issue with asynchronous execution of SOQL in Flex. I am trying to execute two SOQL sequentially.
Step 1:
I execute the first SOQL and keep the result in a ArrayCollection.
Step 2:
I execute the second SOQL and keep the result in a Array.
Step 3:
I perform some business logic, and make some changes in the ArrayCollection [initialized in Step 1] on the basis of the values present in the Array [Initialize in Step 2].


Problem:
Because the SOQL in Flex executes in the async mode, Step 3 executes in parallel of Step 2 and Array does'nt have any value for processing.

please have a look into the code.

 

 

 

public static function getAllLocations(sOppId:String, apexConnection:Connection):ArrayCollection{ var locations:ArrayCollection = new ArrayCollection(); var soql:String = "Select l.City__c, l.Country__c, l.Id, l.State__c, l.ZipCode__c from Location__c l"; try{ apexConnection.query(soql, new AsyncResponder( function (qr:QueryResult):void{ if(qr.size <= 0){ // show error }else{ for(var i:int=0; i<qr.records.length; i++ ){ var location:Object = qr.records[i]; locations.addItem({id:location.Id, city:location.City__c, state:location.State__c, country:location.Country__c, zipCode:location.ZipCode__c, choose:false}); } var locIdArray:Array = getAllEnteredOppLocations(sOppId, apexConnection); for(var a:int = 0; i<locIdArray.length; i++){ for(var j:int=0; j<locations.length; j++){ if(locIdArray[a].toString() == locations.getItemAt(j).Id){ locations.getItemAt(j).choose = true; } } } } }, function(fault:Object):void{ Alert.show("Some Fatal Error Occurred............." + fault); } )); }catch(error:Error){ locations.addItem({id:'1', city:'Noida', state:'UttarPradesh', country:'India', zipCode:'201301', choose:true}); locations.addItem({id:'2', city:'Ghaziabad', state:'UttarPradesh', country:'India', zipCode:'301205', choose:false}); } locations.refresh(); return locations; } private static function getAllEnteredOppLocations(sOppId:String, apexConnection:Connection):Array{ var locIdArray:Array = new Array(); var soql:String = "Select Location__c from Opportunity_Location__c o where Opportunity__c = '0068000000LO8g9'"; try{ apexConnection.query(soql, new AsyncResponder( function (qr:QueryResult):void{ if(qr.size <= 0){ Alert.show("Total is less than 0: "); }else{ for(var i:int=0; i<qr.records.length; i++ ){ locIdArray.push(qr.records[i].Location__c); } } }, function(fault:Object):void{ Alert.show("Some Fatal Error Occurred in getAllOppLocations............." + fault); } )); }catch(error:Error){ } return locIdArray; }

 


Thanks
Ajit

I would like to create a Trigger that captures a user's attempt to delete a record and instead mark that record as "Inactive" and cancel the delete request.
 
I have attempted to use the beforeDelete and afterDelete triggers, as well as attempted to allow the delete and then undelete the record afterwards.  I keep running into various walls.
 
I imagine that this is something that is probably fairly common yet I can't find any examples of how best to do this. 
Can anyone give me some ideas or otherwise point me in the right direction?
 
 
Thanks
Jon
 
Hi,

I'm a newbie in APEX. I would like to ask if it's possible to add a javascript inside a trigger. Say for example, I want to add a javascript alert() when the save button of Account is clicked. Is this possible? If it is, can you share me some examples?

Your help will be greatly appreciated.

Thanks a lot,
Ces
  • November 05, 2008
  • Like
  • 0
Hi All,

i need to display related list of opportunities on visual force page with "created date" field. I am using Account as StandardController for the page.
My issue is regarding the format of CreatedDate field, by default it shows the value with time stamp but the desired format is 'dd/mm/yyyy'.
how can i change its format on Visual force page directly.


Thanks
Ajit Verma
Hi,

is there any way to add custom icon image (
like lookup icon image in front of parent account filed on new Account entry page) on New Account Entry page. so that i can open a custom pop-up window.

As per my requirements, i need to open the custom pop window on click event of the image. so that i can select the value from pop window and can populate it in to the desired fields on the New Account Entry Window.
just like the same we do using standard functionality to populate the parent account filed.

Thanks
Ajit
Hello
I need some very basic APEX functionalities to support a small non profit project.
Basically what I need to do is to be able to copy some field values from an Contact to 
an Account upon saving the Contact record.
I am in the process of testing/learning how to do this, and I tried creating the trigger 
below, but I always get an error message.
Would anybody help me pointing me in the right direction of what should I chaneg in the sintax
of this code lines?
 
Thanks
******************
trigger ChangeAccountName on Contact (before insert) {
    
Contact[] contacts = Trigger.new;

Contact c = [select account.name from contact where id = :contacts[0].id];

c.account.name='test organization';

update c.account;
}
******************** 
Error Message:
Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger AddAccount caused an unexpected exception, contact your administrator: AddAccount: execution of BeforeInsert caused by: System.QueryException: List has no rows for assignment to SObject: Trigger.AddAccount: line 10, column 13
 
hi,
 
I need to customize the error message during the approval process, when criteria is not true.
Please help me on this.
 
Thanks
Swati
 
 
Hi,
I am facing problems during the Insatllation Of Force.com IDE for Eclipse 3.3,
 
I followed the these Steps:
 
1.Launch Eclipse, and then click Help > Software Updates > Find and Install.

2.Select "Search for new features to install" and click "Next".

3.Add the Force.com IDE Remote Site:
Click "New Remote Site". The New Update Site dialog opens.
Set the Name to "Force.com IDE" and the URL to "http://www.adnsandbox.com/eclipsetoolkit/release", then click OK.
Select “Europa Discovery Site” and "Automatically select mirrors”, then click “Finish”. Eclipse will search the selected sites for the required plugins.
 
4.When the Updates dialog is displayed, I am not getting Force.com IDE as one of the options.

Also under Europa Discovery Site > Web and JEE Development, i am not getting "Web Standard Tools (WST) Project"
as one of the options which is mandatory to proceed to do the installation.
 
Please help me regarding this.

 
  • July 30, 2008
  • Like
  • 0