• vish h
  • NEWBIE
  • 30 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 6
    Replies
Hi,

I have scenario where I have 3 teams(A,B, C) and one custom object X. Team members of A should not see each other records in the Object X . and Team members of B should be able to see each other records in object X. and Team members have should be having full permissions of object X.

Here I followed the steps to implement this.

1. I have  profile with CRED permissions on Object X and assigned it all Teams A,B,C members and all belong to same Role hierarchy.
2. I have set the OWD for Object X is private. (so here Team A members cant see each other records).
3. I have created permission set with View and modify all on the object X and assigned it to Team C users.

4. For Team B, I have created public group called Team B group. I have created sharing rule on Object X(Read Only) and share the records created by anyone from Team B group to Team B group. But this is not working. I dont know where its going wrong. Team B members can create records on object X but they cant see each other records. Please help me to resolve this

Thanks
VIsh


 
Hi ,

I'm attempting to update the lookup field in the object and unable to do so.. Please anyone guide me the correct way of updating the field in apex.

PO_requisition__c poreq = new PO_requisition__c();
            poreq = [select SecondApprover__r.FirstName from PO_requisition__c where ID ='a0J9000000tinJl'];
            poreq.SecondApprover__r.Id = UserInfo.getUserId();
            update poreq;
            System.debug('----------------------This is approved now-----'+poreq.SecondApprover__r.Id);


getting below error..

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

Thanks
VIshwa
  • September 13, 2015
  • Like
  • 0
Hi,

I'm new to Salesforce and I want to know how can I get back the user details that I stored ID in string data type. Ex

public class vSFDCuseinfo{
public string auserid {get;set;}
public string aName{get;set;}
public vSFDCuseinfo (){
     
      auserid= UserInfo.getUserId();
      aName = auserID.username;    // how to get the username (firstname, lastname etc) from ID stored in string format? 
      

}
Thanks 

Vish
  • September 10, 2015
  • Like
  • 0
Hi,

I have a requirement to create Purchase order requistions. In short, to generate any PO order in pdf, first submitted PO request  should get approvals from RU unit heads ( 4 to 6 member approvals based on cost) . Client has many RU units(>100) each RU unit has different approvers.
>> Suggestion is given to create RU unit object and save/define the RU approvers in the object.  
>> Whenver PO request is created with RU unit number, it should read the RU approvers from RU object and get the approvals from concerned approvers defined in the object through approval process.

Can we achieve above requirement? if so, how can we achieve this?  Please give me hints.

Thanks
Vish
  • September 06, 2015
  • Like
  • 0
Hi,

I have a requirement to create Purchase order requistions. In short, to generate any PO order in pdf, first submitted PO request  should get approvals from RU unit heads ( 4 to 6 member approvals based on cost) . Client has many RU units(>100) each RU unit has different approvers.
>> Suggestion is given to create RU unit object and save/define the RU approvers in the object.  
>> Whenver PO request is created with RU unit number, that should read the RU approvers from RU object and get the approvals from concerned approvers defined in the object through approval process.

Can we achieve above requirement? if so, how can we achieve this?  Please give me hints.

Thanks
Vish
  • September 05, 2015
  • Like
  • 0
Hi,

I'm new to salesforce. I want to populate the lookup field values to other input fields on the page as soon as I select the lookup field. Please help me how to pass the value related input field on the page. Here is my code 

VF page : 
<apex:page sidebar="false" controller="SampleController" >
    <apex:form >
        <apex:pageBlock id="pg" >
            <apex:pageBlockSection columns="2">
                <apex:inputField value="{!poReq.Company_Name__c}">
                    <apex:actionSupport event="onchange" action="{!getDetails}" rerender="pg"/>
                </apex:inputField>
                <apex:inputField value="{!poreq.Company_Name__r.Street__c}" label="Street"/>
           </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Controller :

public with sharing class SampleController {
    public po_requisition__c poReq {get;set;}
    public vendor__c vend {get;set;}
    
    public SampleController(){
      poReq = new po_requisition__c();
      vend = new Vendor__C();
    }
    //public string cname;
    public void getDetails(){
   // cname = poReq.Company_Name__c;
   
  
        system.debug('----------------------Company name ------'+poReq.Company_Name__c);
        vend = [Select Street__c from Vendor__c where Id =: poReq.Company_Name__c];
        system.debug('----------------------Street Is  ------'+vend.Street__c);   //Up to here code is working fine
        poreq.Company_Name__r.Street__c = vend.Street__c; // Its not passing the value to related field here and giving below error
    }

}


System.NullPointerException: Attempt to de-reference a null object
Error is in expression '{!getDetails}' in page vsfdcvaluepass: Class.SampleController.getDetails: line 17, column 1
Class.SampleController.getDetails: line 17, column 1
  • September 02, 2015
  • Like
  • 0
Hi,

I have scenario where I have 3 teams(A,B, C) and one custom object X. Team members of A should not see each other records in the Object X . and Team members of B should be able to see each other records in object X. and Team members have should be having full permissions of object X.

Here I followed the steps to implement this.

1. I have  profile with CRED permissions on Object X and assigned it all Teams A,B,C members and all belong to same Role hierarchy.
2. I have set the OWD for Object X is private. (so here Team A members cant see each other records).
3. I have created permission set with View and modify all on the object X and assigned it to Team C users.

4. For Team B, I have created public group called Team B group. I have created sharing rule on Object X(Read Only) and share the records created by anyone from Team B group to Team B group. But this is not working. I dont know where its going wrong. Team B members can create records on object X but they cant see each other records. Please help me to resolve this

Thanks
VIsh


 
Hi ,

I'm attempting to update the lookup field in the object and unable to do so.. Please anyone guide me the correct way of updating the field in apex.

PO_requisition__c poreq = new PO_requisition__c();
            poreq = [select SecondApprover__r.FirstName from PO_requisition__c where ID ='a0J9000000tinJl'];
            poreq.SecondApprover__r.Id = UserInfo.getUserId();
            update poreq;
            System.debug('----------------------This is approved now-----'+poreq.SecondApprover__r.Id);


getting below error..

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

Thanks
VIshwa
  • September 13, 2015
  • Like
  • 0
Hi,

I'm new to Salesforce and I want to know how can I get back the user details that I stored ID in string data type. Ex

public class vSFDCuseinfo{
public string auserid {get;set;}
public string aName{get;set;}
public vSFDCuseinfo (){
     
      auserid= UserInfo.getUserId();
      aName = auserID.username;    // how to get the username (firstname, lastname etc) from ID stored in string format? 
      

}
Thanks 

Vish
  • September 10, 2015
  • Like
  • 0
Hi,

I have a requirement to create Purchase order requistions. In short, to generate any PO order in pdf, first submitted PO request  should get approvals from RU unit heads ( 4 to 6 member approvals based on cost) . Client has many RU units(>100) each RU unit has different approvers.
>> Suggestion is given to create RU unit object and save/define the RU approvers in the object.  
>> Whenver PO request is created with RU unit number, that should read the RU approvers from RU object and get the approvals from concerned approvers defined in the object through approval process.

Can we achieve above requirement? if so, how can we achieve this?  Please give me hints.

Thanks
Vish
  • September 05, 2015
  • Like
  • 0
Hi,

I'm new to salesforce. I want to populate the lookup field values to other input fields on the page as soon as I select the lookup field. Please help me how to pass the value related input field on the page. Here is my code 

VF page : 
<apex:page sidebar="false" controller="SampleController" >
    <apex:form >
        <apex:pageBlock id="pg" >
            <apex:pageBlockSection columns="2">
                <apex:inputField value="{!poReq.Company_Name__c}">
                    <apex:actionSupport event="onchange" action="{!getDetails}" rerender="pg"/>
                </apex:inputField>
                <apex:inputField value="{!poreq.Company_Name__r.Street__c}" label="Street"/>
           </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
</apex:page>

Controller :

public with sharing class SampleController {
    public po_requisition__c poReq {get;set;}
    public vendor__c vend {get;set;}
    
    public SampleController(){
      poReq = new po_requisition__c();
      vend = new Vendor__C();
    }
    //public string cname;
    public void getDetails(){
   // cname = poReq.Company_Name__c;
   
  
        system.debug('----------------------Company name ------'+poReq.Company_Name__c);
        vend = [Select Street__c from Vendor__c where Id =: poReq.Company_Name__c];
        system.debug('----------------------Street Is  ------'+vend.Street__c);   //Up to here code is working fine
        poreq.Company_Name__r.Street__c = vend.Street__c; // Its not passing the value to related field here and giving below error
    }

}


System.NullPointerException: Attempt to de-reference a null object
Error is in expression '{!getDetails}' in page vsfdcvaluepass: Class.SampleController.getDetails: line 17, column 1
Class.SampleController.getDetails: line 17, column 1
  • September 02, 2015
  • Like
  • 0