• sailee hande
  • NEWBIE
  • 50 Points
  • Member since 2015

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 18
    Replies
Hey Everyone! 

I want fields (picklist and text fields) in my Case Object to be linked to similar fields in the Account Object. I am trying to use Flow Designer + Process Builder to accomplish this, but I can't seem to get it to trigger. Can anyone help me out with this?

Thanks!
Attached is a button in contact with to change the status of contact, if this solution is recommended by Salesforce, since dml direct from the button.
{!REQUIRESCRIPT("/soap/ajax/39.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/39.0/apex.js")} 

var con = new sforce.SObject("Contact");
con.Id = '{!Contact.Id}';
con.Contact_Status__c = 'Deactivated';

var result = sforce.connection.update([con]);
if('{!Contact.Contact_Status__c}' == 'Deactivated') {
    alert('Contact has been already deactivated');
} else {
    if(result[0].getBoolean("success"))
    {
       alert('Contact is deactivated');
       window.location.reload();
    }
    else{
      alert('Error : '+result);
    }
}
Hi Folks,

i have two custom fields in both account and conatct i,e state and city now i want to make auto populate for those fields in contact when i try to create new contact in related list.
What are the steps in creating a portal user and cloning the new account?
How do you write a unit test in Apex? What’s the method signature?
Duration and Enddate both are not null at same time , and if both are provied a value then the value of both is equal then only record will be saved. otherwise through an error.
the null part is done like this( ISBLANK( Duration__c )&& ISBLANK( End_Date__c ) ) but how to check the value of duration and enddate.
 
We have a VF page in a community to display Accounts when the user clicks the My Customers tab.  What would be the apex code I need to add to the following controller apex code to filter for Account_Status__c = 'Active'?

public without sharing class ANIMyAccountsController {

    public ANIMyAccountsController(ApexPages.StandardController controller) {
    }

    public List<Account> getAccountsList()
    {
       return [Select id,name,vendor__C,Phone,Type,Ownerid,BillingState,BillingStreet,BillingCity,BillingPostalCode,Primary_Line_of_Business__c,Tax_ID__c, Tax_Status__c, NPI_Org__c, Medicare_Provider_ID__c from Account where vendor__C = :userinfo().accountid];
    }

     private user userinfo(){
        return [Select id,name,profile.name,accountid from User where id=:UserInfo.getUserId()];
    }

}  
 
Hi everyone - I am Keita, preliminary user in Sales Force hence excuse me in advance if my question is "out of whack" .

I am trying to implment the following formula column for one of the summary reports I have generated to capture the days until "Bid due date", but every time I click "OK" to run the formula I encounter an error as per red description in the screen capture ("Error: Invalid custom summary formula definition: Field Bid_Due_date does not exist. Check spelling")

Formula: Bid_Due_date - TODAY (  )

1. Is there a specific sequence (i.e. number of spaces, Capital rules, underbar rules) when citing a Field in the formula?
2. How can I rectify this issue?

I have gone through the training material of which I can access, but do not understand what I am doing wrong here.
Appreciate your kind inputs!

Thanks,
Keita

User-added image 
 
I am trying to deploy a Trigger and also an Apex class which the trigger is using.

In Sandbox, I wrote a test case which gives the Apex Class 85% coverage and the Trigger says it has 100% code coverage.

I put these both in an outbound change set and push to production.

On production I validate it and then it fails on code coverage and says my trigger has 0% coverage?

Thanks
Hi i have written the trigger  in such away that when i update the  contact record , another Contact  record  hasto be inserted .But when i try to update the existing record it throwing the error like  " execution of BeforeUpdate caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.wed: line 39, column 1" 

and my code is as below,

trigger wed on Contact(Before insert, Before Update)
{

Public Account a;

Public List<Contact> ab;

if(Trigger.isinsert==TRUE)
{
For(Contact c:Trigger.New)

{

ab=new List<Contact>();

 a= [select Phone from Account where ID=:c.AccountID];
 
 c.Phone=a.Phone;
 
 ab.add(c);
 
}

}

if (Trigger.isUpdate==TRUE)
{

For(Contact ct:Trigger.New)
{

String stv=ct.FirstName;

Contact cts=new Contact();

cts.FirstName='ram';
cts.LastName=ct.LastName;

ab.add(cts);

}
insert ab;

}

}

So please suggest me any one, where iam doing the error.




 
Hi all,

I have the following code
 
public static void submitSplitApprovalStepOne(Id recordId, String firstApprover){

  		approval.ProcessSubmitRequest step1 = new Approval.ProcessSubmitRequest();
		
        step1.setComments('The approver passed is: ' + firstApprover);
        
        step1.setObjectId(recordId); 
        
        step1.setNextApproverIds(new Id[] {firstApprover});
        
        approval.ProcessResult result = Approval.process(step1);

    }


When this method is called and passed a record for an object with a pre redfined approval process activated on it, it successfully creates a step and submits it to the first Approver ID.

How can I extend this code so that I can add another step and set the approver via apex? I know I'll probably have to query the ProcessInstance table to track my job, but I'm not sure how to add a step with an approver via code.

Hey Everyone! 

I want fields (picklist and text fields) in my Case Object to be linked to similar fields in the Account Object. I am trying to use Flow Designer + Process Builder to accomplish this, but I can't seem to get it to trigger. Can anyone help me out with this?

Thanks!
Hi,

I have one custom object, in that I have one date field like "Valid date" with date datatype. Here whenever I insert one new record into that that "Valid date" field should update date like today's date + 90 days.

How to acheive this, can anyone help me out?
Thanks.
When i execute the below test code:

@isTest
public class TestAfterInsert {   
    static testmethod void AItest(){   
     Account  a1 = new Account (Name = 'After Insert1', Phone = '1234567890');              
        Test.startTest();
        insert a1;
        Test.stopTest();
        Contact c = [Select LastName, Phone from contact where ID = :a1.id];       
        system.assertequals(c.lastname,a1.name);
        system.assertequals(c.phone,a1.phone);      
       }
     }

for below trigger :

trigger AfterInsert on Account (after insert) {
    List<Contact> cons = new List<Contact>();
    For(account a: trigger.new){       
        contact c = new contact();
        c.AccountId = a.Id;
        c.LastName = a.Name;
        c.Phone = a.Phone;       
        cons.add(c); 
    }
    insert cons;       
    }

I am receiving "System.QueryException: List has no rows for assignment to SObject"  error. Can someone please help me out to resolve the error?
 
Hello.
I would like to write a SOQL query in Data Loader that would include a list of 100 specific Contact record ID's to export (only) those records.
This is as close as I came but it is not returning the expected results.

SELECT Id,
FROM Contact
WHERE ID IN ('a4fa0000000KzbV','a4fa0000000KzbW',...........)

Any help would be greatly appreciated.
 
I've started writing a Test Case so I can deploy my trigger. These are both for custom objects, however these are also on a managed package.

I am getting the following error when executing my test case:
 
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, pse.handleTimecardHeaderChange: execution of AfterInsert

caused by: System.NullPointerException: Attempt to de-reference a null object

I assume there is a perticular field which is used in an existing Trigger called pse.handleTimecardHeaderChange. However it has not been made mandatory, therefore the field is null?

If I am correct, how can I go about troubleshooting this as when I create the record through the Page it works fine and I cannot see any other fields that are populated by default.

Thanks
I'm trying to create a formula in Process Builder's, Define Criteria for this Action Group, to create a new record in a custom object (DRET__c) when a checkbox on the Account = true and a text field on the Account is not blank and no record exists in the custom object (DRET__c) that is related to the Account object.

I tried the below formula syntax but I am receving an error of "The formula expression is invalid: Field ISBLANK does not exist. Check spelling.​"
 
AND ( ([Account].checkbox__c = True ) && ([Account].field__c <> ISBLANK ) && ([Account].Dret__c.Id = BLANKVALUE ) )


Any help on this is appreciated. Thanks!