• Shashank Srivatsavaya
  • NEWBIE
  • 5 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 13
    Replies
Hi guys,
I need a push in the right direction. 
I have a table with a field that contains a code. I'll call this the "code field".
I need to automatically fill another field: I need to calculate a "password" based on that code. So I'll call this the "password field". Every time the "code field" changes, the "password field" needs to change. 
The method to calculate the password requires complex code. In its current form, it's more than 10 pages, with a lot of for-next-things and so on.
So the simple formulae editor will not suffice. I need a Java or C#-like language.
I've looked to Apex and VisualForce the past few days, but I can't get my head around it, I still don't know how to start.
Can someone push me in the right direction?
Another important question: I'm testing this out with a free developer Account. In the development console, I can create new Apex classes and so on.
But in the account I use from my business, I can't create a new Apex class. It's a Group Edition account (we have a few Group Edition accounts). Why is this? 
Thanks a lot in advance,
Leen
Hi ,

i have a requirments where i want to access salesforce from external system . the externat system will pass a number to salesforce and salesforce will search and return data to external system based on that number.

what i need to do from salesforce side. 
Hello: I am a newbie in dev forum and would appreciate some guidance in automating something for our organization. We need to store a list of salesforce object ids in our native sql server database. Thinking of this approach below:
- Create a trigger upon record deletions to pass on the deleted record ID to a web service hosted at our production platform
- The web service will take the id and save in our sql db

Question #1: Is there a better approach to automate our needs? If so please advise.

Question #2: If the web service based approach above is a good one too then in that case kindly give me some guidance on how to proceed. I know the basics of the trigger but not sure about the syntax of a web service call, specially does the web service need to be created WSDL etc.?

Thanks very much in advance.
What code does:
When the Update button is clicked on an Alert record, it creates a new one, pulling all information from previous Alert and updates the Master Alert if it isn't empty.  Would also like it to create the junction object within this class.  I've tried with some code I use on other junction object creation, but I'm getting the following error:
insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Case]: [Case]

I have it updating the Case and Alert fields that are required, but I'm obviously not doing something right.  Can anyone please help?

Class:
public class CW_alertUpdate{
public final Alerts__c alertID;
public Alerts__c newAlert{get;set;}
      public CW_alertUpdate(ApexPages.StandardController controller) {
        //gets fields from previous case
        alertID = [SELECT Id, Master_Alert_Lookup__c FROM Alerts__c WHERE Id = :ApexPages.currentPage().getParameters().get('alertID')];
     }
     public pageReference autorun(){
         //create a new Alert
         Alerts__c newAlert = new Alerts__c(Id = ApexPages.currentPage().getParameters().get('newid'));
        // Fill in the values for the new record from previous case
        if(alertID.Master_Alert_Lookup__c == NULL)
        {
         newAlert.Master_Alert_Lookup__c = alertID.Id;
         }
         //Update the new Alert record
        update newAlert;
       
        //create a new Case Alert Association - Junction Object
        Case_Alert_Association__c newCAA = new Case_Alert_Association__c();

         // Fill in the values for the new record
         newCAA.Alerts__c = newAlert.id;
         newCAA.Case__c = newAlert.Incident_Ticket_Number__c;
              
         //Insert the new Case Alert Association record
          Database.insert (newCAA);


        system.debug(newAlert);
        PageReference retPage = new PageReference('/' + newAlert.id);
        return retPage;
       } }

Button Code:
/a0H/e?retURL={!Alerts__c.Id}&00Ne0000000jigO={!Alerts__c.Incident_Start__c}&00Ne0000000jifu={!Alerts__c.Product__c}&00Ne0000000jigd={!Alerts__c.Team_List__c}&CF00Ne0000000jigi={!Alerts__c.Incident_Manager__c}&CF00Ne0000000jigi_lkid={!Alerts__c.Incident_ManagerId__c}&00Ne0000000jigT={!Alerts__c.Incident_Reported__c}&00Ne0000000jifk={!Alerts__c.Subject__c}&CF00Ne0000000jigs={!Alerts__c.Account_Name__c}&CF00Ne0000000jigs_lkid={!Alerts__c.Account_NameId__c}&
00Ne0000000jifz={!Alerts__c.Customer_Impact__c}&00Ne0000000jig4={!Alerts__c.Completed_Actions__c}&00Ne0000000jig9={!Alerts__c.Next_Actions__c}&CF00Ne0000000jigE={!Alerts__c.Incident_Ticket_Number__c}&CF00Ne0000000jigE_lkid={!Alerts__c.Incident_Ticket_NumberId__c}&00Ne0000000dZZQ={!Alerts__c.CGM_P1_AMERICAS_MANNED__c}&00Ne0000000dZZL={!Alerts__c.CGM_P1_APD_MANNED__c}&00Ne0000000dZZH={!Alerts__c.CGM_P1_Command__c}&00Ne0000000dZZG={!Alerts__c.CGM_P1_EAME_MANNED__c}&CF00Ne0000000uccj={!Alerts__c.Master_Alert_Lookup__c}&CF00Ne0000000uccj_lkid={!Alerts__c.Master_Alert_LookupId__c}&saveURL=/apex/CW_AlertUpdate?alertID={!Alerts__c.Id}
  • May 13, 2014
  • Like
  • 0
I want to know on the 'Warehouse & Inventory Management' workflow and features/functionalities in the salesforce.com. I am currently a trial version user and i can only see the basic functionality of CRM. I need help in Warehouse and Inventory management connected with CRM.

  
Hi,

I am trying to integrate salesforce and some application via azure service bus. Code i used is: 
            Http h = new Http();
            HttpRequest req = new HttpRequest();
            // ** Getting Security Token from STS
            String Url = 'https://XXXX.accesscontrol.windows.net/WRAPv0.9/';
            // String encodedPW = EncodingUtil.urlEncode([password]', 'UTF-8');
            req.setEndpoint(Url);
            req.setMethod('POST');
            req.setBody('wrap_name=SenderTest&wrap_password=XXXXX==&wrap_scope=http://XXXX.servicebus.windows.net/MenuService');
            req.setHeader('Content-Type','application/x-www-form-urlencoded');
            HttpResponse res = h.send(req);
            result = res.getBody();


And I am getting result =  
Error:Code:400:SubCode:T0:Detail:ACS90004: The request is not properly formatted.:TraceID:848b16db-dd8c-406e-8239-d96428e70f11:TimeStamp:2014-05-13 11:39:31Z

I am not able to get token. please help me out for the same...
Can anyone help me on fetching the current opened primary tab id n service cloud console.I'm using like this & this will called on click of a button in window.open(.....)

<apex:includeScript value="/support/console/25.0/integration.js" />
    <script type="text/javascript">
        function buttonClick() {
            alert('Testing');
            alert(sforce.console.getFocusedPrimaryTabId(showTabId));
        }
        var showTabId = function showTabId(result) {
            alert('Tab IDs: ' + result.ids);
        };
    </script>
Is it possible to count the number of lines in an attached file in the email?

Thank you!

Messaging.EmailFileAttachment csvPJ = new Messaging.EmailFileAttachment();
blob csvBlob = Blob.valueOf(contenuCSV);
string csvNom = 'cases_fermes_'+Date.today().format()+'.csv';
csvPJ.setFileName(csvNom);
csvPJ.setBody(csvBlob);
Messaging.SingleEmailMessage email =new Messaging.SingleEmailMessage();
String[] adressMail = new list<string> {mailSouhaite};
String subject = 'Report - '+Date.today().format();
email.setSubject(subject);
email.setToAddresses( adressMail );

email.setPlainTextBody('mail....');
email.setFileAttachments(new Messaging.EmailFileAttachment[]{csvPJ});
Messaging.SendEmailResult [] envoyer = Messaging.sendEmail(new Messaging.SingleEmailMessage[] {email});
Somethig like: csvPJ.getLineNumber();

Thank you
Hi,

We are planning to integrate Salesforce with external system using webmethods. Can anyone please share the details of configuration that is required at Salesforce end for this integration. Also if there are any limitations or specific points that we have to take care please let me know.

Regards,
Nagesh
Hi, while calling rest service from Soap UI, I am getting following error as,

Tue May 13 15:55:39 IST 2014:DEBUG:>> "GET /services/apexrest/Lead/doGet/00QU000000HNKhZ HTTP/1.1[\r][\n]"
Tue May 13 15:55:39 IST 2014:DEBUG:>> "Accept-Encoding: gzip,deflate[\r][\n]"
Tue May 13 15:55:39 IST 2014:DEBUG:>> "Authorization: Bearer 00DU0000000HkOk!ARAAQOIzC8_c2FB8Y0lfXFYa91i0zexb2_MKni.ZB4zW8gBLTc3x4GRJbzai.KyLu3EHq2RQ24WXl.Sn1IW6UaxXSTP04jJC[\r][\n]"
Tue May 13 15:55:39 IST 2014:DEBUG:>> "Host: na12.salesforce.com[\r][\n]"
Tue May 13 15:55:39 IST 2014:DEBUG:>> "Connection: Keep-Alive[\r][\n]"
Tue May 13 15:55:39 IST 2014:DEBUG:>> "User-Agent: Apache-HttpClient/4.1.1 (java 1.5)[\r][\n]"
Tue May 13 15:55:39 IST 2014:DEBUG:>> "[\r][\n]"
Tue May 13 15:55:40 IST 2014:DEBUG:<< "HTTP/1.1 401 Unauthorized[\r][\n]"
Tue May 13 15:55:40 IST 2014:DEBUG:<< "Date: Tue, 13 May 2014 10:25:47 GMT[\r][\n]"
Tue May 13 15:55:40 IST 2014:DEBUG:<< "Content-Type: application/json;charset=UTF-8[\r][\n]"
Tue May 13 15:55:40 IST 2014:DEBUG:<< "Transfer-Encoding: chunked[\r][\n]"
Tue May 13 15:55:40 IST 2014:DEBUG:<< "[\r][\n]"
Tue May 13 15:55:40 IST 2014:DEBUG:<< "64[\r][\n]"
Tue May 13 15:55:40 IST 2014:DEBUG:<< "[{"message":"This session is not valid for use with the REST API","errorCode":"INVALID_SESSION_ID"}]"
Tue May 13 15:55:40 IST 2014:DEBUG:<< "[\r][\n]"
Tue May 13 15:55:40 IST 2014:DEBUG:<< "0[\r][\n]"
Tue May 13 15:55:40 IST 2014:DEBUG:<< "[\r][\n]"

Please let me know what should i do ??


Is there a recommended app that will go out and get the Longitude and Latitude of an account based on a custom field "Physical Location" and update custom Lat and Long fields in SFDC.  We tried using Google Maps but it is not working for us.
public class insertionOrderPdf {
public String OppId;
public String OpportunityNumber{get;set;}
Public boolean site{get;set;}
Public integer discount{get;set;}
public String SiteType{get;set;}
Public List<OpportunityLineItem> lstOpplineItem{get;set;}
Public Opportunity PrimaryOpp{get;set;}
public insertionOrderPdf()
    {
        OppId           = Apexpages.currentPage().getParameters().get('OppId');
        SiteType        = Apexpages.currentPage().getParameters().get('SiteType');
       
        if(OppId != Null && SiteType!= Null)
        {
                PrimaryOpp              =       new Opportunity();
                lstOpplineItem  =       new List<OpportunityLineItem>();
                lstOpplineItem  =   [
                                                        select
                                                        Opportunity.Billing_Notes__c,
                                                        Opportunity.Billing_Terms__c,
                                                        Opportunity.Name,
                                                        Opportunity.Client_PO_Number__c,
                                                        Opportunity.Activity_Start_Date__c,
                                                        Opportunity.Activity_End_Date__c,
                                                        Opportunity.Description,
                                                        Opportunity.Account.Name,
                                                        Opportunity.Account.billingPostalcode,
                                                        Opportunity.Account.Billing_Email__c,
                                                        Opportunity.Account.BillingStreet,
                                                        Opportunity.Account.BillingCity,
                                                        Opportunity.Account.BillingCountry,
                                                        Opportunity.Account.BillingState,
                                                        Opportunity.Buyer__r.Name,
                                                        Opportunity.Buyer__r.Email,
                                                        Opportunity.Buyer__r.Phone,
                                                        Opportunity.Buyer__r.Title,
                                                        Opportunity.Vendor__r.name,
                                                        Opportunity.Success_metrics__c,
                                                        Opportunity.Agency_Discount_Percentage__c,
                                                        Opportunity.Order_Notes__c,
                                                        PricebookEntry.Product2.Name,
                                                        Opportunity.Opp_Number__c,
                                                        Description,
                                                        Start_Date__c,
                                                        End_Date__c,
                                                        Geo_Target__c,
                                                        Quantity,
                                                        ListPrice,
                                                        Gross__c,
                                                        UnitPrice,
                                                        TotalPrice,    
                                                        Site__c
                                                        from    OpportunityLineItem
                                                        where OpportunityId =:OppId
                                                        and      Site__c =:SiteType
                                                        ];
                                                       
                if(lstOpplineItem.size() > 0)
                {
                        if(lstOpplineItem[0].site__c.tolowercase() == 'inform')
                        {
                            Site = true;
                        }
                        PrimaryOpp = lstOpplineItem[0].Opportunity;
                        if(PrimaryOpp.Opp_Number__c!= null)
                        {
                            if(PrimaryOpp.Opp_Number__c.contains('-'))
                            {
                             String[] s = new String[]{};
                             s = PrimaryOpp.Opp_Number__c.split('-');
                             OpportunityNumber = s[1];
                            }
                        } 
                                            
                        if(PrimaryOpp.Agency_Discount_Percentage__c == '10%')
                        {
                            discount = 10;
                        }else if(PrimaryOpp.Agency_Discount_Percentage__c == '15%')
                        {
                            discount = 15;
                        }
                        else if(PrimaryOpp.Agency_Discount_Percentage__c == '20%')
                        {
                            discount = 20;
                        }
                        else
                        {
                            discount = 0;
                        }
                }
        }
    }

}