• Sujeet Patel
  • NEWBIE
  • 110 Points
  • Member since 2018
  • Salesforce Developer


  • Chatter
    Feed
  • 4
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 27
    Replies

Hi Everyone Please help me out from this scenario

 I want to update Account record owner incase custom state field is anyone selected from picklist(Gujarat,Rajasthan,Bihar,etc) with higher role and role checked 

User-added image
four levels above in role hiearchy if state chandigarh is select then (SOCG (SalesOfficer Chandigarh)) in this role the user will be updated on record owner and if no user in role of (SOCG) then above him(ASM CG) user is update on record owner this level go up to last level at (RM CG) 
and if RMCG in this role there is no user then by default  record owner will be update to this role user(RM CG)
 
We have nonprofit asssociations that are responsible for different areas in Sweden. When I create a new contact in lightning I want the association field to be autofilled or suggested for the user with the corresponding association based on the Contact's postalcode.

We will have a table with each association and their respective postalcodes. So based on the postalcodes in this table I want to suggest a association for the contact that has a corresponding postalcode.

Is this possible? I'm not sure how to implement this requirement and would be grateful for some assistance.
Hello Community

I have a custom object MyCustomObj__c which has 2 relashionship lookups on Contact Object. Contact1__c and Contact2__c
How can I insert with apex a record in Contact1__c  ?
  • January 29, 2019
  • Like
  • 0
Hi, I am new to salesforce and i am facing an issue in writing trigger.

The Requirement is like this:
If the Contract has an account then the Status(custom field,picklist type) field of the corresponding  account must be set to Active.

Please help in resolving the issue.
Any help would be appreciated.


Trigger to update account field if the contract has an account.

Hi Everyone Please help me out from this scenario

 I want to update Account record owner incase custom state field is anyone selected from picklist(Gujarat,Rajasthan,Bihar,etc) with higher role and role checked 

User-added image
four levels above in role hiearchy if state chandigarh is select then (SOCG (SalesOfficer Chandigarh)) in this role the user will be updated on record owner and if no user in role of (SOCG) then above him(ASM CG) user is update on record owner this level go up to last level at (RM CG) 
and if RMCG in this role there is no user then by default  record owner will be update to this role user(RM CG)
 
My PMs want to see which other opportunities have been signed when they receive an approved opportunity.  I created a VF page add an opportunity related list and it works, but I can't figure out how to ONLY show those where StageName = 'SIGNED'.  

Any help would be appreciated...
 
<apex:page standardController="Opportunity" showHeader="false" sidebar="false" readOnly="true">
<style type="text/css">
.actionColumn {display:none; visibility:hidden}
</style>

    <apex:relatedList list="Account.Opportunities">
    <apex:facet name="header"><center><b></b></center></apex:facet>
    </apex:relatedList>

</apex:page>

 
Hello everyone,
Not sure if this is the right place for this but I am working on installing Salesforce CLI and finally got it to work, only problem is I have to drill down from my C:\User\*name*> all the way down to where the Files are in C:\Program Files. when i see all the tutorials online, people seem to be able to open it immediately while in their user directory in command prompt. Is there a way to set it so I can do this as well?
We have nonprofit asssociations that are responsible for different areas in Sweden. When I create a new contact in lightning I want the association field to be autofilled or suggested for the user with the corresponding association based on the Contact's postalcode.

We will have a table with each association and their respective postalcodes. So based on the postalcodes in this table I want to suggest a association for the contact that has a corresponding postalcode.

Is this possible? I'm not sure how to implement this requirement and would be grateful for some assistance.
Can somebody help me on how to create a event or class or with JavaScript remoting..
If I login as ABC User then I go to CustomObject then click the record, if CustomObject has Assigned To__c=ABC User (current user) then there will be an error message (showToast if possible), “Sorry, you don’t have access to this CustomObject record.”

It’s like preventing the current user from viewing the specific record.

Please help.
Hello Community

I have a custom object MyCustomObj__c which has 2 relashionship lookups on Contact Object. Contact1__c and Contact2__c
How can I insert with apex a record in Contact1__c  ?
  • January 29, 2019
  • Like
  • 0
Hello,
I am looking to create a trigger to populate contact name (system field) with customer name in case entity.

trigger Images2_case on Case (before insert, before update) {
    for(Case c : Trigger.New) {
    string img = c.ContactId;

       if(ContactId=null){
 
               c.ContactId = Customer_Name__c;
        
        System.debug(img);
    }

    
    
}
}

however, its not working and giving error as Error: Compile Error: Condition expression must be of type Boolean: String at line 5 column 11

Can you please help. Thanks 
I need help to write test class for below class? Its urgent

public class TriggerHelper {
 
    public static void validateInFavourOf(List<Disbursement__c> newList){
        if(Trigger.isBefore){
            Set<Id> setCustDetail = new Set<Id>();
            Map<Id, Loan_Contact__c> mapCustDetail; 
            for(Disbursement__c disb : newList){
                if(disb.Customer_Detail__c != null){
                  setCustDetail.add(disb.Customer_Detail__c);    
                }
            }
            If(!setCustDetail.isEmpty()){
              mapCustDetail = new Map<Id,Loan_Contact__c>([SELECT Id, customer_name__c FROM Loan_Contact__c WHERE Id IN : setCustDetail]);    
            }
            
            for(Disbursement__c disb : newList){
                if(disb.Cheque_Favouring__c == null && disb.Customer_Detail__c != null){
                    if(mapCustDetail.containsKey(disb.Customer_Detail__c)){
                      System.debug('Favouring value : ' + mapCustDetail.get(disb.Customer_Detail__c).customer_name__c);
                      disb.Cheque_Favouring__c = mapCustDetail.get(disb.Customer_Detail__c).customer_name__c;    
                    }
                    else{
                        disb.addError('No such Customer found');
                    }
                }
                else if(disb.Cheque_Favouring__c != null && disb.Customer_Detail__c != null){
                    if(disb.Cheque_Favouring__c != disb.Customer_Detail__r.customer_name__c){
                        disb.addError('Customer Name do not match for Cheque Favouring');
                    }
                }
                else if(disb.Customer_Detail__c == null && disb.Cheque_Favouring__c == null){
                    disb.addError('Please provide value for Cheque Favouring either in Favoring Customer Name or Favouring');
                }
            }
        }
    }    
}
I need to send a notification to some of my users every time a file is uploaded. 
I understand that files does not have the option to create workflows. 
So I need to create an apex trigger to do this. 
I have never written anything like this before and I would appreciate some quidance. 
All the best, 
Aidel Bruck
  • November 05, 2018
  • Like
  • 1
Hi,

this query is showing an error : 

for(Project__c objProject : [SELECT Id,Name,(SELECT Id,Estimated_Value__c, Total_Actual_Sales__c 
                                            FROM Opportunities) FROM Project__c WHERE Id IN: set_Opportunity])

Opportunity is a child object to Project , and its a lookup relationship.

I am using this query in a trigger..  but getting below error

Didn't understand relationship 'Opportunities' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names. at line 14 column 33

While creating account record I want to set the status to Open by default and after creation, I want to change status to complete if linked contact records are 10 or greater than 10?
Hi,

i need help in developing a trigger that calculates values from Parent Object Inquiry to child object Inquiry Details.

So every Inquiry record will have a field call  Cushion Number( this acts as a code) and Act Sales.

I need to capture information of sum of ActSales against a cushion number and store it in a child object field Actual Sales..

how can I achieve this ?

 
Hi,

I am trying to make a callout from a Queuable Class that allows callouts.

public without sharing class ClassA implements Queueable, Database.AllowsCallouts {
 
  public void execute(QueueableContext context) {
    sendRef(varA, varB);
  }

  public static void sendRef(String varA, String varB) {
    
      HTTP call1 = new HTTP();
      HTTPRequest request1 = new HTTPRequest();
      .....
     response = call1.send(request1)
    ...
}

This class is called from a) Batch process and also from b) Custom Button.

When called from batch:
 System.enqueueJob(
                new ClassA(Parm1, Parm2)
            );

When called from button:
ClassA.sendRef(Parm1, Parm2);


Now the issue is that the statement http.send(request) is not working recently from Batch. Can anyone please help.

The same piece of code is working when submitted as a queuable .
  • October 26, 2018
  • Like
  • 0
Hi everyone,
I am currently designing a vf page where I am using html input tag but I am not sure how to pull that value into the controller. If I use <apex:inputText> component it works but I want to use html input tag in the vf page rather. Below is a simple example of what I want to do. If there is a textbox and a button then how do I retrieve that value in a controller when the button is clicked.

VF Page:
<input type="text" name = "name"/>
<input type= "submit" value = "submit"/>

Controller:
public string name {get; set;}

public void submit() {
   System.debug('The value entered for name is: '+ name);
}

Any help is appreciated.

Thanks!