• kiranmutturu
  • PRO
  • 3752 Points
  • Member since 2011


  • Chatter
    Feed
  • 137
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 31
    Questions
  • 1345
    Replies
hi,

I have a task like this..

User receives an Email with a link, When he/she clicks on the link it will redirect to page (Say HelloWorld)..

After entering details on that page and hit save, it should be (Helloworld page) converted as pdf and Saved to Purticular Custom Object (Say Yahoo) as Attachment.

Is there any ways to achieve it?

thanks
We have a requirement to display a message "Record has been created successfully" on standard detail page of case object upon clicking Standard Save button.

Please let me know how to meet this requirement.
Thank you in advance.
HI folks,
           Can anyone tell me how to validate the uploaded file as image?
My vfp:
<apex:page standardController="Contact" sidebar="false" extensions="DpConnectApiExt">
    <apex:form >
        
        <apex:outputPanel id="ProfilePicturePanel">
            <apex:pageMessages ></apex:pageMessages>
            <apex:outputText ><b>Current User Profile Picture Using Connect API</b></apex:outputText><br/>
            <apex:actionRegion >
            <center> <apex:image url="{!UserfullPhoto}" />    </center><br/><br/>
            </apex:actionRegion>
        </apex:outputPanel>
            <apex:outputtext > <b> Uploading Image Via Connet API </b></apex:outputtext>
            <apex:inputfile value="{!file}"></apex:inputfile>
            <apex:commandButton value="Submit" action="{!upload}"  />
            
        
    </apex:form>
  
</apex:page>

and my controller:
 
global class DpConnectApiExt {
    
    global String UserfullPhoto { get; set; }
    global transient Blob file{get;set;}
    global DpConnectApiExt(ApexPages.StandardController controller) {
         
        ConnectApi.Photo p = ConnectApi.ChatterUsers.getPhoto(null, UserInfo.getUserId());
        UserfullPhoto =p.fullEmailPhotoUrl;
    }
    public void upload(){
            system.debug('File:'+file);
//I want to validate here

            ConnectApi.BinaryInput b=new ConnectApi.BinaryInput(file,'image/jpeg','myimage');
            

            ConnectApi.ChatterUsers.setPhoto(null,userinfo.getUserId(),b);   
        
        
    }
}

I dont know how to validate the blob data type
any help would be appreciatble
Thanks in advance
Karthick
I have a list of checkboxes in Visualforce Page.
I want that if no checkbox is checked then automatically submit button will be disabled and if use checks any them it should be enabled to click.
This has to take effect as soon as user deselect or select any checkbox.
Can this be done without using JavaScript? Through the Controller?
Here i am trying to append "Updated"  to all of my accounts but no luck. 


public class INFSimpleBatchExp implements Database.Batchable<sobject> {
  
    public Database.QueryLocator start(database.BatchableContext bc )
    {
        String query = 'select id, name from Account';
        return Database.getQueryLocator(query);
    }
   
    public void execute (Database.BatchableContext bc, List<Account> scope )
    {
      
        for(Account acc : scope)
        { 
          
            acc.name = acc.name + 'updated';
        }
    update scope;
    }
   
   
    public void finish(Database.BatchableContext bc)
    {
       
    }
}
----------------------------------------------------------------------------------------------------------------------

I am using following statemets in Developer console

INFSimpleBatchExp inF = new INFSimpleBatchExp();
Database.executeBatch(inF, 200);

Anyone kindly let me know where it went wrong?

wwwwwwThanks,
Prakki 

Hi, i am still relatively new to DML operations such as insert. 

Let's say for whatever reason, my new list of leads is empty. What are the errors caused by inserting an empty list? Does Sf already know not to insert an empty list?

For example,

List<Lead> newLeads = new List<Lead>();

insert newLeads;

Is it recommended that I use the ".isEmpty()" method to only perform an Insert operation when the list is not empty?

if( !(newLeads.isEmpty())
insert newLeads;
Hi guys, 

 I want to enable API but don't find option to enable API in my trial account.

please tell me can i enable api to trial account.
i'm integration with dotnet system, what field type is picklst to map with .net fileds 


I am not able to see any error in eclipse while saving. It only shows "Files saved locally".
I facing this issuw since summer 14 release.
Anyone else facing same kind of issues?
Under setup --> Develop --> Appex Classes there is no "New" button please see the image below.
User-added image

I have clicked on developer console then in developer console window File --> New --> Appex Class
Give the new class name but when click on create button get the following error.

User-added image

Please help me how can i fix this so that i can create my custom controller class.
Thanks in advance.
Hi All,

I have to query on ApexCodeCoverageAggregate. I tried like this, but not able to get the result, is there any one have sample codes on this can you please post it. I need how use these Tooling API Objects. Please post with sample class and procedure how to execute these.

I tried like below.

public class SampleClass
{
      public List<ApexCodeCoverageAggregate> getCoverage()
      {
                 List<ApexCodeCoverageAggregate> apexCodeCoverageList = [SELECT NumLinesCovered, NumLinesUncovered, ApexClassorTriggerId FROM ApexCodeCoverageAggregate];
                 System.debug('@@@:apexCodeCoverageList:  '+apexCodeCoverageList);
                 return apexCodeCoverageList;
      }
This code is not working.

Thanks
Venkat


Hi ,

Am created a un-managed package. Earlier my logic and everything works fine, when i created a this package entire sytem field,class apis are changed with some namespace prefix.
Actually i implemented a button logic to execute my apex class. Earlier it was executed, Now when i click on it was showing an error which is in below image. if i added name space prefix to class name also throwing same error.
class:

global class cls_RewardFeedSent{
     webservice static string rewardfeedsend(ID rewrdid){
       Reward__c rew =new Reward__c();
        rew = [select  id,name,Active__c,Rward_Amount__c,Time_Based_Mgmnt__c,User__c  from Reward__c where id=:rewrdid];
}
}
Button logic :

sforce.connection.sessionId = "{!$Api.Session_ID}";
var rwrd = '{!QnxSPM__Reward__c.Id}';
var result = sforce.apex.execute("cls_RewardFeedSent", "rewardfeedsend", {rewrdid:rwrd});
alert(result);

Can anybody suggest me the solution for this, Thanks in adavnce.
User-added image
@isTest
public class test2_test{
   public static testMethod void getDataTest()
   {
     property__c ptest = new property__c(name='test',type__c='1-bhk',lease_term__c = 1,address__c = 'testAddress',parking__c='depend upon owner');
     insert ptest;
    // apexpages.standardsetcontroller ssc = new apexpages.standardsetcontroller(ptest);
  
    test2 t2 = new test2();
    t2.getData();
   }
 
}

 i am getting continuously same error message . please tell me where i am exactly making the mistake.
I have written a trigger to automate deletion process if user checks the checkbox.

trigger checkCheckBox on Registration__c(after update) {
    //List to contain Registration(s) to be deleted.
    Registration__c[] toBeDeleted = new list<Registration__c>();

    for (Registration__c Register : Trigger.new) {
       if (Register.Registration_cancel__c== True) {
          toBeDeleted.add(Register);
       }
    }
    delete toBeDeleted;
}

The above code sample is throwing following exception:

caused by: System.SObjectException: DML statment cannot operate on trigger.new or trigger.old
Trigger.deleteDeletedOrgs: line 10, column 1.

How to resolve this?
Hello,

It is possible to enter a request SOQL in input text of a Visualforce page and after use this request in Apex class?
How do I do this?

I tried this, but that didn't work:

APEX CLASS:
....
public List<case> caseTT {get; set;}
.....
List<case> caseFermeList = caseTT ;

VISUALFORCE:
.....
Request : <apex:inputText value="{!caseTT}"/><br /><br />

Thank you!!!
Hi All,

This is driving me a little crazy! I have written a simple trigger which creates or updates the PriceBookEntry in the Standard Pricebook when the Product is inserted or updated. It works when doing it manually but as soon as I upsert using the Data Loader or Jitterbit, it only fires on the first record.

I can't seem to figure out why and was hoping someone may be able to take a look at the code and identify the issue.

Any help would be very much appreciated :)

Code:

trigger CreatePBE on Product2 (after insert, after update) {

sObject s = [select ID from Pricebook2 where IsStandard = TRUE];
Set<ID> ids = new Set<ID>();
list<PricebookEntry> entries=new list<PricebookEntry>();

for (Product2 p : Trigger.new) {ids.add(p.Id);}
   
if(trigger.isinsert){
    for (Product2 p : Trigger.new) {
    entries.add(
    new PricebookEntry(
    Pricebook2Id=s.ID,
    Product2Id=p.Id,
    UnitPrice=p.Item_Cost__c,
    IsActive=p.IsActive,
    UseStandardPrice=FALSE)
    );
    }
    insert entries;
    }

  
List <PriceBookEntry> pbe = [select ID, UnitPrice FROM PricebookEntry WHERE Product2ID IN :ids AND Pricebook2ID = '01s20000000FVFV' AND IsActive = TRUE];
  
if(trigger.isupdate){
    for (Product2 p : Trigger.new) {
PriceBookEntry.UnitPrice=p.Item_Cost__c;
       }
Update pbe;
}
}
I have a custom object A, it has a type field
if I have the following records in A
Name.       Type
aaa.           Checking
bbb.            Checking
ccc.            Investment
ddd.            Saving

I want to build a page showing 3 sections 
Checking
aaa
bbb

Investment
ccc

Saving
ddd

it is possible that the data doesn't contain Saving type of record, then I don't want Saving section showing up. It is possible that new types are added, for example, we have another Type Retirement added. 
eee. Retirement
then I want to have another section rendered. Basically I can't hard code the name of the Type because it can change/expand, and I can't put fixed number of sections in page because it could change based on Tyes. 
Is there any way to achieve this?


Hi this is my class am using this in one button

can you please any one tell me how to write test class for the web services method.

 

global class letter
{
    WebService static string letter(string id)
    {
        try
        {
            Opportunity opp=[Select o.AccountId, o.Delivery__c,  from Opportunity o where o.id=:id];
            
            Quote Qt=new Quote();
            Qt.name='test';
            Qt.OpportunityId=opp.id;
            if(opp.Delivery__c!=null|| opp.Deliverys__c!='')
            {
                newQt.Delivery__c=opp.Delivery__c;
            }
            
            
            insert Qt;
            return 'letter';
        }
        catch(exception ex)
        {
            return 'Error';
        }
        
    }
    
}

 

Thanks for your replay

Hi all.

 

I have logos.zip into static resource, which contains images with names: 'first.jpg' and 'second.jpg'.
'first' and 'second' are variables, which I retrieve from some field in custom object.

 

<apex:variable var="propertySlide" value="{!property.PropertyCode__c}.png" />
<apex:image url="{!URLFOR($Resource.logos, propertySlide)}" />

I need to be sure that if this field was empty or, for example, it equals 'third', I shouldn't see doesn't found image icon.

 

 

What should I need to do?

1. created a test class and inserted an opportunity with stage value as 'started';

2. once the insertion was done changed the stage value to 'in progress' and used update statement to update the same.

3. its entering in to the before trigger event but not firing the class method based on th below condition.

 

test class:

    opprtunity opp = new opportunity(stagename = 'started', name = 'test name');

insert opp;

opp.stagename='in progress';

update opp;

 

if(trigger.new[0].stagename == 'in progress' && trigger.old[0].stagename == 'started')// this is covering.

     hadnler.getoppor(trigger.new[0]);///This is not executing in my scenario

 

 

plez help me out in this

i am getting the new case creation page from custom button in VF page in service cloud console. But after saving the case the case number is not populating there it is still giving New case text on the tab .. how to resolve this?

i have a flow on account detail page.. it will be intiated via button click from the detailed page....in that flow i have some picklist values defaulted to values called "Yes". I selected "No" from the drop down and updating the record in the flow and completed the process.  Later I opened the flow from the detail page still it is showing the default value but not the value from the current record.. help me out in this?

i am unable to get the vf page as a xls file in iOS(iPAD). I am getting the same in desktops. Even i tried to open a static file which was placed as a static resource , but this is also failed to open... as per these scenarios iOS is not supporting file mangers i think so .. any ideas on this how can i view the excel sheet from salesforce in iPAD?

how can i use SSO?

 

we are planning to create a java based application. we are considering 2 approaches. So please guide me which is possible and best.

 

1. Logging in to that external application through salesforce

2. Logging in to salesforce from that application.

 

Info:  both the application users are same. External application is going to be built on JAVA with external database(data will not be there in force.com database). Simply it needs the same salesforce user login to enter in to that ext app but i need to send some user info(i.e. if i used scenario1 from above). Based on that they will populate the data in that external application

2. may be i can use SSO in the second scenario.

 

Please guide me the best and possible way to implement..

 

 

how can i call a .htc file from a style sheet.. i zipped the htc file along with the css but it is not loading...

i need to get the aggreagted result of opportunity records where there is not conitional pick up... it may go lakhs in future...but my applicaiton is running on force.com platform......any one can help me how to pick up the records in bulk mode......

i need to send the json string to charts ...i am getting the data as an aggregate result.. help me out in this. i didn't try with wrapper class conversion.. if there is direct way please let me know with out wrapper class.. thank you

i am getting an error Foreign key external ID: 114.000000 not found for field Source_Account_ID__c in entity Account

 

when i am upserting the opportunites.. but Source_Account_ID__c is a text fiels in account and it is a primary key in account ...but in account it stored as 114 only.. 

 

 

i need to connect to oracle database and fetch the records from there and need to insert in to salesforce...

 

1. we are using oracle 10g --> how to get the drivers for this

 

2. where I need to place these drivers in the process.

 

3. how to refer the jdbc driver in the process .?

 

could any body give me the procedure to connect to oracle database and fetch the records from there and uplaod in to salesforce.... thank you

shall i give access to some of the users in the organization only....and how to remove the chatter component from home page...

i need to upload accounts and contacts in to salesforce but once we upload the accounts how can we map accounts to contacts...

i am unable to login in to dataloader 23.0 but able to connect previous versions .. i am getting the below error

failed to send request to https://login.salesforce.com/services/soap/u/23.0...

i need to built a button on avf page where it needs to give more than 50000 records in an excell... 

is it possible to connect to different datasource objects in a single go? like i need to install the accounts contacts and opportunities in a single shot. from external datasource or 3 individula csv files....what is the best way to implement this?

i am developing a vfpage which contains some heavy data like datatables and google charts.... is the same solution can be viewed in all the mobile devices that are supported by the salesforce.?  what are all the limitations in this.. 

 

vfpage solution is working fine in the salesforce native platform but this can be the same in mobile or not if this page is mobile ready page...

 i need a button which generates an excel file with more than 1 million records...will there be any limit in the excell storage also?

when ever we click on dashbaord tab automatically the last used dashboard is rendered but i need to change the behavious like when ever i clicked on the tab i have an another dashboard page called homepage. and i want to land evry time when i click the dashboard standard tab.  will this be possible?

 

 

Thank you

i developed a vf component for a dasboard . in that i am having a link .. when i clicked the link the url seems to be like this

https://cs6.salesforce.com/01ZN00000008ekOMAQ?inline=1   .. that inline=1 is the extra parameter causes me the problem.  I am directing to another dashboard page while clicking on the link...if i remove the inline=1 i am able to get my desire result.. so please help me out in this

I have made lightningStyleSheet=true for my visualforce pages which are used in sites Community portal. I'm able to see lightning look and feel in SF org. How do i enable same lightning look and feel in Communty.
  • May 01, 2018
  • Like
  • 0
Hello awesome devs!

I am attempting to create a VF page with 4 fields for user inputting.  2 of these fields are Date fields which when filled in like MM/DD/YYY when I press the search button to call my custom controller the date in the field populated has its format changed to Tue Dec 26 00:00:00 GMT 2017 and doesnt seem to be being applied in the search itself as all records are returned and not ones just for the date entered. 

Can someone help me with gettign the format to stay as I think this is the cause of the date field not being used in the search criteria. 

Please see my VF Page and controller code below. 

Thank you very much for any help you can provide,

Shawn

VF Page Code - 
 
<apex:page controller="SubSearchController">
    
    <apex:form>
    	<apex:pageBlock id="pb">
        	<apex:pageBlockButtons>
                <apex:commandButton action="{!searchRecords}" value="Search" rerender="pb"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection columns="2">
                <apex:outputLabel value="Account Id" />
                <apex:inputText value="{!AccId}"/>
                <apex:outputLabel value="Status" />
                <apex:inputText value="{!SubStatus}"/>
                <apex:outputLabel value="Service Activation date" />
                <apex:inputText value="{!SAD}"/>
                <apex:outputLabel value="Term End Date" />
                <apex:inputText value="{!TermEnd}"/>
            </apex:pageBlockSection>
            <apex:pageBlockTable var="record" value="{!records}" id="pbTable">
                <apex:column value="{!record.Name}" />
                <apex:column value="{!record.Zuora__Status__c}" />
                <apex:column value="{!record.Zuora__ServiceActivationDate__c}" />
                <apex:column value="{!record.Zuora__TermEndDate__c}" />
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
    
</apex:page>

Controller Code -

public class SubSearchController {

    public String AccId {get;set;}
    public String SubStatus {get;set;}
    public Date SAD {get;set;}
    public Date sadDate = Date.valueOf(SAD);
    public Date TermEnd {get;set;}
    public Date TermDate = Date.valueOf(TermEnd);
    
    public List<Zuora__Subscription__c> records {get; private set;}
    
    public SubSearchController(){
        records = new List<Zuora__Subscription__c>();   
    }
    
    public PageReference searchRecords() {
        
        records = [SELECT Zuora__Account__c, Zuora__Status__c, Zuora__ServiceActivationDate__c, Zuora__TermEndDate__c, OpportunityId__c, Total_Booking_Amount__c, Id, Name
                  FROM Zuora__Subscription__c WHERE Zuora__Account__c = : AccId AND Zuora__Status__c = : SubStatus AND (Zuora__ServiceActivationDate__c = : sadDate OR Zuora__TermEndDate__c = :TermDate)];
        return null;
        
    }
    
}

 
Hi All,

I am trying to complete the exercise where API name 'Trail__c' is required.

Create a custom object with 'Trail' as the Label and Object Name. The resulting API name will need to be 'Trail__c'.

It clearly mentions in the error  blank spaces or consecutive underscores not allowed. How do I achieve this? Thanks in advance.
public List<Account> Accountlist { get; set; }

public SelectOrganization(ApexPages.StandardSetController controller) {

    }

public List<Account> getAccounts() {
if(Accountlist == null) {
Accountlist = new List<Account>();
for(Account a: [select Id, Name from Account limit 25]) {

// As each Account is processed we create a new Account object and add it to the accountList
Accountlist.add(new Account(a));
}
 return Accountlist;

}


    }
Error:SObject constructor must use name=value pairs at line 16 column 17
Please help.
What needs to be done.
 

Hi Folks,
 

I did not set debug logs for an User but I want to find the operations performed by the User on a particuar day. Is is possible to query on all objects to find out what an user did on particular day?

Hi all,

I am going to create a package which consists apex classes, vf pages, custom settings, static resources.
now my question is i have created some custom labels and called in visual force pages, can i create package along with custom labels??

Thanks in advance.
 
  • September 10, 2015
  • Like
  • 0
hi,

I have a task like this..

User receives an Email with a link, When he/she clicks on the link it will redirect to page (Say HelloWorld)..

After entering details on that page and hit save, it should be (Helloworld page) converted as pdf and Saved to Purticular Custom Object (Say Yahoo) as Attachment.

Is there any ways to achieve it?

thanks
Hello everyone,

I have hit a wall and need help on how to test @future methods which are called from a trigger.

I think it has something do with the fact that @future methods are no necessarily processed immediately and as such my assertions are not passing, any help on how to get my code covered would be greatly appreciated,

What the trigger does is reassigns open and waiting cases to a queue when a user is disabled.

The trigger:
trigger user_deactivated_reassign_case on User (before update) {
    
    for(User u : trigger.new){
        User oldUsr = Trigger.oldMap.get(u.Id);
        if(oldUsr.IsActive==TRUE && u.IsActive==FALSE){
            User newUsr = Trigger.newMap.get(u.Id);
            string recordIds = u.Id;
            user_deactivation_reassign_case_class.reassign_case(recordIds);
        }
    }
}

The @future Apex Class:
public class user_deactivation_reassign_case_class {
    @future
    public static void reassign_case(string recordIds){
        List<Case> cas = [SELECT Id, Type FROM Case WHERE OwnerId=:recordIds];
        List<Case> casesTobeUpdated = new List<Case>();
               
        for(Case currentCase : cas){
            if(currentCase.Status=='Open'||currentCase.Status=='Waiting Response'||currentCase.Status=='On Hold'){
                if(currentCase.Type=='AU.COM'||currentCase.Type=='Customer Service'){
                    currentCase.OwnerId='00G90000001mq6F'; //Premium Support L2
                    casesTobeUpdated.add(currentCase);
                }
                else if(currentCase.Type=='Management'){
                    currentCase.OwnerId='00G90000001mq5m'; //Management
                    casesTobeUpdated.add(currentCase);
                }
                else if(currentCase.Type=='Administration'||currentCase.Type=='Domain Dispute'){
                    currentCase.OwnerId='00G90000001mq65'; //Premium Admin
                    casesTobeUpdated.add(currentCase);
                }
                else if(currentCase.Type=='EDU.AU'||currentCase.Type=='GOV.AU'||currentCase.Type=='Corporate'){
                    currentCase.OwnerId='00G90000001mzrl'; //Corporate
                    casesTobeUpdated.add(currentCase);
                }
                else if(currentCase.Type=='VPS Unmanaged'||currentCase.Type=='VPS Managed'){
                    currentCase.OwnerId='00G90000001nJfA'; //VPS Unmanaged
                    casesTobeUpdated.add(currentCase);
                }
                else if(currentCase.Type=='Sales'||currentCase.Type=='Social Media Sales'||currentCase.Type=='Online Marketing Sales'){
                    currentCase.OwnerId='00G90000001mzrH'; //Retail Sales
                    casesTobeUpdated.add(currentCase);
                }
                else if(currentCase.Type=='Online Marketing Support'){
                    currentCase.OwnerId='00G90000001mzrR'; //Online Marketing Support
                    casesTobeUpdated.add(currentCase);
                }
                else if(currentCase.Type=='Web Design'){
                    currentCase.OwnerId='00G90000001mzT4'; //Web Design
                    casesTobeUpdated.add(currentCase);
                }
                else if(currentCase.Type=='Website Security'){
                    currentCase.OwnerId='00G90000001nAl0'; //Website Security
                    casesTobeUpdated.add(currentCase);
                }
                else if(currentCase.Type=='Credit Control'){
                    currentCase.OwnerId='00G90000001nAlK'; //Credit Control
                    casesTobeUpdated.add(currentCase);
                }
                else{
                    currentCase.OwnerId='00G90000001mq6F'; //Premium Support L2
                    casesTobeUpdated.add(currentCase);
                }
            }
        }
    update casesTobeUpdated;
    }
}

And the test class which I can't figure out:
@isTest
public class user_deactivation_reassign_case_test {
    public static testmethod void test_user_termination(){
        User thisUser = [SELECT Id FROM USER WHERE Name='System Automation'];
        
        system.runAs(thisUser){
        User u = new User(FirstName='Test',
                          LastName='Test',
                          Username='apextest@netregistry.com', 
                          Email='apextest@netregistry.com', 
                          Alias='test', 
                          CommunityNickname='test', 
                          TimeZoneSidKey='Australia/Sydney', 
                          LocaleSidKey='en_US', 
                          EmailEncodingKey='UTF-8', 
                          ProfileId='00e90000001NAum', 
                          LanguageLocaleKey='en_US');
        
        insert u;
        Account acc = new Account(Account_Ref__c='1',Name='Test', Reseller_Id__c=1, Virtualisation_Id__c=1);
        insert acc;
        Case cas = new Case (AccountId=acc.Id,OwnerId=u.Id,Type='AU.COM',Status='Open',Brand__c='Netregistry');
        insert cas;
        update u;
        string recordIds = u.Id;

        system.assertEquals(cas.OwnerId, '00G90000001mq6F');
        }
    }
}


I have read other posts saying I need to use Test.startTest(); and Test.stopTest(); but I can't figure out where this fits into a @future class being called via a trigger
Hi,

I'm trying to consume/call a webservice from SAP/APIGEE. I have already the target endpoint to remotes sites settings, etc.

Given the WSDL file from SAP/APIGEE team, I have generated the stub class using "Generate from WSDL"

But when trying to call the service, i am getting this error:
System.CalloutException: Web service callout failed: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' but found 'urn:sap-com:document:sap:soap:functions:mc-style:GetEmployeeResponse'

Here's the WebServiceCallout.invoke lines (if it matters: i can see that the expected response is correctly specified, and yet it looks for something else)
WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'urn:sap-com:document:sap:soap:functions:mc-style',
              'GetEmployee',
              'urn:sap-com:document:sap:soap:functions:mc-style',
              'GetEmployeeResponse',
              'HLG_sapComDocumentSapSoapFunctionsMcS.GetEmployeeResponse_element'}
            );

I tried to simulate the call using SOAPui, and the result/response is something like this:
<ns1:GetEmployeeResponse xmlns:ns1="urn:sap-com:document:sap:soap:functions:mc-style">
   <Empinfo>
      <EmployeePersonalNumber>10033928</EmployeePersonalNumber>
      <UserName>abhyrtj</UserName>
      <AssignmentType>AB</AssignmentType>
      <AssignmentTypeDescription>test description</AssignmentTypeDescription>
      <CompanyCode>CC</CompanyCode>
      <CmapnyName>Test Company</CmapnyName>
      <Ctps>test</Ctps>
      <CtpsSerie>test</CtpsSerie>
      <CtpsUF>test</CtpsUF>
      <Imss>test</Imss>
      <Nationality>US</Nationality>
      <CountryName>USA</CountryName>
      <AnnualSalary>435345.02</AnnualSalary>
      <AnnualSalaryCurrency>$</AnnualSalaryCurrency>
      <AnnualCurrencyDescription>test description</AnnualCurrencyDescription>
      <WorkContract>AB</WorkContract>
      <WorkContractDescription>test description</WorkContractDescription>
      <EndDate>2017-12-25</EndDate>
      <EmploymentPercentage>98.25</EmploymentPercentage>
      <HoursPerWeek>9.00</HoursPerWeek>
   </Empinfo>
</ns1:GetEmployeeResponse>

THANK YOU SO MUCH IN ADVANCE!
Hello dear community, I have a PDF as a visualforce-component and I want this to be sent automatically as an attachment by a trigger when a new account is added. Any advices ?

Thanks in advance ! :)
Hi,

I want to iterate though the records of Account object inside a trigger of another Object. I tried to do it as follows,

trigger CCTriggerToUpdateAccounts on CC__c (before insert, before update) {
    List<Account> accountList = [SELECT MyField__c FROM Account];
    CC__c[] configs = Trigger.new;
    
    for (Configuration__c c :configs){
        for(Account a: accountList){
            a.Sync_to_AG__c = c.CCID__c;
        }
        update accountList;
    }
}

It works. But The Account iteration goes for several times. I only have 1 Account in my list. 

How can I make it to iterate according to the number of records in the Account object?

Please Help me. Thank you very much in advance.
 
Hello Everyone,
I  am making a callout to external webservices ,I am not getting any error ,
Here is my problem ,When i update values on contact that wont value are not passing to external webservices.
Its passing the random records.
Below is my trigger code and apex Class

trigger Rephistorytracking on contact (after update,before update) {  
    RepTriggerHandlerclass contactHandler = new RepTriggerHandlerclass ();
    Jcoreutil    JcoreHandler= new Jcoreutil();
    if(Trigger.isAfter && Trigger.isUpdate) {
        contactHandler.onAfterUpdate(Trigger.New, Trigger.oldMap);
    }
    
    if(Trigger.IsAfter && Trigger.isUpdate)
    {
        contactHandler.onAftercontactUpdate(Trigger.New);
    }
     if(Trigger.IsUpdate && Trigger.isBefore)
    {
         Jcoreutil.JcoreAdd();
    }
 
}

###################APEX CLASS####################################


public class Jcoreutil {
     @future(callout=true)
     public static void JcoreAdd()
      {
        Set<Id> TerminateCntId= new Set<Id>();
        Set<Id> RepIdsValue= new Set<Id>();
        List<Id> CntListIds= new List<Id>();
        List<contact> TerminateCntList= new List<contact>();
        String LicenseNumber;
         for( contact TerminateCntQuery :[Select Id,Name,CRD__c,FirstName,LastName,Middle_name__c,Gender__c,Address_Type__c,
                                          MailingStreet,MailingCity,MailingState,MailingPostalCode,Email,MobilePhone,
                                          QAM_DSP__r.Name,QAM_DSP__r.CRD__C,QCC_DSP__r.CRD__C,QAM_DSP__r.FirstName,
                                           QAM_DSP__r.LastName,QCC_DSP__r.FirstName,QCC_DSP__r.LastName,Birthdate,Rep_Status__c,
                                           QCC_DSP__c,Term_Date__c,Start_Date__c,LastModifiedDate,HomePhone,Phone,OtherPhone
                                            from Contact where (Rep_Status__c='Terminated'OR Rep_Status__c='Converted') Limit 1])
         {
              system.debug('TerminateQuery@@@@'+TerminateCntQuery);
               if(TerminateCntQuery.Rep_Status__c=='Converted')
               {         
             TerminateCntList.add(TerminateCntQuery);
             TerminateCntId.add(TerminateCntQuery.id);
             List<License__c> lstLicensesValues=new List<License__c>();
             License__c LicensesValues=[Select Id,License__c from License__c where contact__c  IN:TerminateCntId Limit 1] ;
             lstLicensesValues=[Select Id,License__c from License__c where contact__c  IN:TerminateCntId];
             integer LicensesValue;
             LicensesValue=lstLicensesValues.size();

Please help me

I Tried to pass the list of ids,but its give error while calling method in trigger.

Thanks.

Regards,
Jyo
 

hello community, when I was executing with a debug to check on my class this occured:

User-added image

that's the code for the class:

public class HelperContactTrigger {
    //static method
    public static List<Account> sendEmail(List<Account> accounts) {

        //query on template object
        EmailTemplate et=[Select id from EmailTemplate where name= 'Sales: New Customer Email' limit 1];

        system.debug(et);   //debug to check the template

        //list of emails
        List<Messaging.SingleEmailMessage> emails = new List<Messaging.SingleEmailMessage>();

        //loop
        for(Account con : accounts){

            //check for Account
            if(con.PersonEmail == null && con.PersonEmail != null){

                //initiallize messaging method
                Messaging.SingleEmailMessage singleMail = new Messaging.SingleEmailMessage();

                //set object Id
                singleMail.setTargetObjectId(con.Id);

                //set template Id
                singleMail.setTemplateId(et.Id);

                //flag to false to stop inserting activity history
                singleMail.setSaveAsActivity(false);

                //add mail
                emails.add(singleMail);
            }
        }

        //send mail
        Messaging.sendEmail(emails);
        return accounts;
    }
}

What do I do? I checked the code and everything a million times.
I was having difficulties running a test class for this programm (System.QueryException: List has no rows for assignment to SObject)
so I have to check if the query statement really does what it's supposed to, it has to work as a mailtrigger when a new account is added but the query is having issues so I have to know what the real problem is.

This is the test class:

@isTest
private class HelperContactTriggerTestneuer {
public static testMethod void myTestMethod() {

        Account acc = new Account(Name = 'Test Test');
        insert acc;

        List<Account> sendMail = [select id from account where (Name='Test Test') and id=:acc.id];
   EmailTemplate testTemplate=new EmailTemplate(Name='Neuer Kunde',DeveloperName='Neuer_Kunde',FolderId=Userinfo.getUserId());
   insert testTemplate;

        HelperContactTrigger.sendEmail(sendMail);
        System.assert(acc !=null);
        
        }
        }


thanks in advance :)

Hi,
 In my visualforce page i am using getContentAsPDF() for generating feeditem.
After saving the data i am generating feeditem. At this point Feeditem is not having recently saved data.
i suspect getContentAsPDF() not getting the recent data.
Can anybody help me on this?

 
I have made changes and it is still not compiling or saving to SFDC.....  here is my modified code after debugging.  Can anyone see what I am missing.

First thing that should happen is when a new buyer record is saved or updated (identified by the Active_Buyers__c) field is search through system for records that have (Active_Seller__c) field checked.

Then it should query the account records and pull the ID, name, List Price, Price Range, Owner Email, and Last Modified Email. from the account object where the List Price <= to the Price range  and store the results temporarily.

After matches are returned there should be an email notification sent to the LastModifiedByID.email of the record that has the Active Seller field checked. with the 

Subject being New Buyer Found, 
Body should contain the account name (hyperlink) owner name and owner email of the account with the Active buyers field checked




trigger BuyerSellerMatchTrigger on Account (after insert,after update){
// Capture all records that have Active_Buyers__c field equals true
      List <Account> BuyerList = new List<Account>();
      Set<String> nameSet= new Set<String>();
      Set<String> emailSet;
      Boolean Active_Buyers = true;
         for(Account a:trigger.new){      
           if(Active_Buyers__c) {
            buyerList.add(a.);
            nameSet.add(a.name);
         }
        }
//check to determine size and the query fields of accounts for the buyer list
        if(buyerList.size()>0 && nameSet.size()>0){
       List<Account>listOfAccounts=[ select id, name, owner.email, Maximun_Price_Range__c, Price_range__c 
           from Account where (name in: nameSet) and Active_Seller__c = True and Listed_Price__c <= Price_Range__c];
//Map the result set of active buyers to active sellers
         Map<Id, Set<String>>mapOfAccounts=new Map<Id, Set<String>>();
         for(Account a:listOfAccounts){
            for(account trgrAccountbuyerList){
               if(trgrAccount.Active_Seller__c = True){
                 if(mapOfAccounts.containsKey(trgrAccount.id)
                 &&!mapOfAccounts.get(trgrAccount.id).contains(a.owner.email))
            }
    }
  emailSet=mapOfAccounts.remove(trgrAccount.id);
                            emailSet.add(a.owner.email);
                            mapOfaccounts.put(trgrAccount.id,emailSet);
                        }
                       else {
                            emailSet=new Set<String>();
                            emailSet.add(a.owner.email);
                            mapOfaccounts.put(trgrAccount.LastModifiedByid,emailSet);
                        }
                    }
                }
            }
// Email notification trigger
            for(Id idey:mapOfaccounts.keySet()){                              
                String emailMessage='Buyer Email account-https://na7.salesforce.com/'+ idey;
                Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
                String[] toAddresses=new List<String>();
                toAddresses.addAll(mapOfaccounts.get(idey));
                mail.setToAddresses(toAddresses);
                mail.setReplyTo('noreply@salesforce.com'); 
                mail.setSenderDisplayName('Buyer Email'); 
                mail.setSubject('Subject');
                mail.setPlainTextBody(emailMessage);
                mail.setHtmlBody(emailMessage);
                Messaging.sendEmail(new Messaging.SingleEmailMessage[]{mail});                               
            }       
        }   
}
}
Hi Everyone,

i have a vf page which contains a button, with a record.
i want to enable button based on record owner.contion here i want to enable it only if record owner is other than created user of record.
EX: lets say User A is create record.if user is opened that opened the page contains this record.this time button needs to disabled.
If user B opened this page contains user A created record.this time it needs to be enabled.

can some one help tel me the condtion please.

Regards
Lakshman
 
I wrote a trigger to create a new case when a closed case receives a mail. It works absolutely fine on sandbox but not working on production.

trigger EmailMessageAfterUpdate on EmailMessage (after insert) {
   
// limit 1001 used, else it was giving error "System.LimitException: Too many query rows: 50001".

   List<case> caseList = [Select id, Status from Case where Status = 'Closed' limit 1001];
            for (EmailMessage newEmail : Trigger.new) 
            {     for(case cc : caseList){
                       if(cc.Status == 'Closed' && cc.id == newEmail.ParentId){ 
                            Case newCase = new Case();
                            newCase.Subject = newEmail.Subject;
                            newCase.Parent_Case__c=newEmail.ParentId;
                            newCase.Category__c = newEmail.Parent.Category__c;
                            newCase.BusinessHours = newEmail.Parent.BusinessHours;
                            newCase.Status = 'Re-Opened';
                            newCase.Sub_Status__c = newEmail.Parent.Sub_Status__c;
                            insert newCase;
                         }
                   }
             }
}
I have written a trigger that when an account record is inserted or updated and the Active_buyers__c field equals True, it will search the system for all accounts that have the field Active_seller__c = true and the the List price from the account that has the active seller eqquals true is less than or equal to the price range of the account with the active buyers equal true.

If a match is found it would then send an email notification to the lastmodifiedBy user of the active seller equals true record to notify them of a potential buyer.

I am getting errors with this code and it will not compile..... 

Can someone look at my code and tell me where I went wrong?


trigger BuyerSellerMatchTrigger on Account (after insert, after update) {
        List<Account> buyerList=new List<Account>();
        Set<String> nameSet=new Set<String>();
        Set<String> citySet=new Set<String>();
        Set<String> emailSet;
        for(Account a:trigger.new){
            if(a.Active_buyers__c='True'){
                buyerList.add(a);
                nameSet.add(a.name);
           
            }
        }
        if(buyerList.size()>0 && nameSet.size()>0){
            List<Account> listOfAccounts=[select id,name,BillingCity,owner.email,Price_range__c from account where (name in :nameSet) and Active_seller__c='True'];
            Map<Id,Set<String>> mapOfAccounts=new Map<Id,Set<String>>();
            for(Account a:listOfAccounts){
                for(account trgrAccount:buyerList){
                    if(trgrAccount.Active_Seller__c='True' && trgraccount.list_price__c=a.Price_range__c){
                        if(mapOfAccounts.containsKey(trgrAccount.id) && !mapOfAccounts.get(trgrAccount.id).contains(a.owner.email)){
                            emailSet=mapOfAccounts.remove(trgrAccount.id);
                            emailSet.add(a.owner.email);
                            mapOfaccounts.put(trgrAccount.id,emailSet);
                        }else {
                            emailSet=new Set<String>();
                            emailSet.add(a.owner.email);
                            mapOfaccounts.put(trgrAccount.LastModifiedByid,emailSet);
                        }
                    }
                }
            }
            for(Id idey:mapOfaccounts.keySet()){                              
                String emailMessage='Buyer Email account-https://na7.salesforce.com/'+ idey;
                Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
                String[] toAddresses=new List<String>();
                toAddresses.addAll(mapOfaccounts.get(idey));
                mail.setToAddresses(toAddresses);
                mail.setReplyTo('noreply@salesforce.com'); 
                mail.setSenderDisplayName('Buyer Email'); 
                mail.setSubject('Subject');
                mail.setPlainTextBody(emailMessage);
                mail.setHtmlBody(emailMessage);
                Messaging.sendEmail(new Messaging.SingleEmailMessage[]{mail});                               
            }       
        }   
    }