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


  • Chatter
    Feed
  • 4
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 30
    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.
I'm attempting to write a trigger on 'before insert' and 'before update' for ObjectA__c. In my code I have a need to find related records based on a custom lookup field. 

ObjectA__c has a custom field we'll call ObjVersion__c.
ObjectB__c also has a custom field we'll also call ObjVersion__c.

Both of these lookup fields are related to a custom object 'Version__c'.

When ObjectA__c is inserted or updated, I'd like to look at the ObjVersion__c field on the update and find all the ObjectB__c that also have that relationship to that Version__c object.
 
List<ObjectB__c> areas = [
        SELECT Name, ObjVersion__c FROM ObjectB__c
        WHERE ObjVersion__c
        IN :Trigger.New];

However, I get an error stating:
Invalid bind expression type of ObjectA__c does not match domain of foreign key

What would be the proper way to accomplish this in a SOQL?

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

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 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!