• apex code share
  • NEWBIE
  • 25 Points
  • Member since 2011

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 14
    Questions
  • 8
    Replies
Hi,

I have 3 custom objects and their feilds are :-

 

1> Object :-Salesreturn  ///////Feild:- Internal UIN

2>object:- UIN MASTERS///// Feild:- Extenal_uin_master,Registered_At_Depot_masters

3> object:- UIN PRODUCTS/////Feild:- a>Internal_UIN_products(this internal uin can be of Mechanic or retailer or reborer i.e max 3) ,,b> Registered_At_Depot_products(checkbox),,,c> Status:-submitted,in process,Start

 

Now, 

When we enter any Internal Uin in salesreturn object then it checks in UIN Products that this internal exists in UIN Product and if it exists and its status is not equal to submitted then Registered_at_Depot_products should get unchecked.

Also,this internal_uin_products is related to any Extenal_uin_master(which is there in UIN MASTERS object) and Hence,Registered_At_Depot_masters at uin masters should also get unchecked.

And a mail should go to a user say raj@abc.com

Hi,

I have 3 custom objects and their feilds are :-

 

1> Object :-Salesreturn  ///////Feild:- Internal UIN

2>object:- UIN MASTERS///// Feild:- Extenal_uin_master,Registered_At_Depot_masters

3> object:- UIN PRODUCTS/////Feild:- a>Internal_UIN_products(this internal uin can be of Mechanic or retailer or reborer i.e max 3) ,,b> Registered_At_Depot_products(checkbox),,,c> Status:-submitted,in process,Start

 

Now, 

When we enter any Internal Uin in salesreturn object then it checks in UIN Products that this internal exists in UIN Product and if it exists and its status is not equal to submitted then Registered_at_Depot_products should get unchecked.

Also,this internal_uin_products is related to any Extenal_uin_master(which is there in UIN MASTERS object) and Hence,Registered_At_Depot_masters at uin masters should also get unchecked.

And a mail should go to a user say raj@abc.com

Hi,

I have an custom object SALES RETURN:- in this i have a field EXTERNAL UIN.
Now when any input is given in this field.Firstly it should check whether this UIN already exist in the custom object UIN MASTER.
NOW, if it exists then it should check whether external UIN which is associated with 3 internal uin (i.e for mechanic,reborer and retailer) in another object say Coupon submission and therefore if the status field for any of the internal UIN is "submitted" then it should show an ERROR message 'INVALID UIN' .
-------------------------------------------------------------------------------------------------------------------------------------------------
just for understanding:
We have erternal UIN which are associated with internal UIN's (1 or 2 or can be 3)
Now we are just checking whether any external UIN or any of its associated internal uin is already submitted in the system.

Hi,

 

I have an custom object SALES RETURN:- in this i have a field EXTERNAL UIN.

Now when any input is given in this field.Firstly it should check whether this UIN already exist in the custom object UIN MASTER.

NOW, if it exists then it should check whether external UIN which is associated with 3 internal uin (i.e for mechanic,reborer and retailer) in another object say Coupon submission and therefore if the status field for any of the internal UIN is "submitted" then it should show an ERROR message 'INVALID UIN' .

 -------------------------------------------------------------------------------------------------------------------------------------------------

 just for understanding:

We have erternal UIN which are associated with  internal UIN's (1 or 2 or can be 3)

Now we are just checking whether any external UIN or any of its associated internal uin is already submitted in the system.


Hi,

 

i have an custom object INDIVIDUAL CUSTOMER:-

In this object i have a picklist field Customer Type: 1> mechanic 2> Reborer 3> Retailer.

Now based on this Customer type there should be a unique field having the unique id say contact id.

 

For Eg:-  If the customer type is MECHANIC then the unique id field should be like {MEC-0000}

                 If the customer type is REBRER then the unique id field should be like {REB-0000}

                  If the customer type is RETAILER then the unique id field should be like {RET-0000}

 

Also, for each next Record created for mechanic it should be MEC-0000 then MEC-0001,MEC-0002 in the uniqueid field(contact id).

Simmilarly, 

                     for each next Record created for Rebrorer it should be REB-0000 then REB-0001,REB-0002 in the uniqueid field(contact id).

                     for each next Record created for RETAILER it should be RET-0000 then RET-0001,RET-0002 in the uniqueid field(contact id).


 

Hi,

 

I have created a visualforce page for barcode generation. but my barcode(which should be in to a box) is coming out of the box for which i will have to use CSS in my visual force page.

 

Please help me  to set the bar code in to the box.



 

I have a custom object-Scheme line(which has three record types i.e mechanics,reborer and  Retailers)  in this i have   fields Denomination and Quantity.

 

Now i want to have formula fields :-  value for mechanics,value for Reborer,value for Retailers {which is Denomination * Quantity(say 50*10)}

 

but in the field (value for mechanics) i want only those value which is filled in the fields (Denomination and Quantity) of record type of mechanics only

Simmilarly, for Value for Reborer will have values filled in the fields (Denomination and Quantity) for the the record type reborer only

I have a custom object-Scheme line(which has three record types i.e mechanics,reborer and  Retailers)  in this i have   fields Denomination and Quantity.

 

Now i want to have formula fields :-  value for mechanics,value for Reborer,value for Retailers {which is Denomination * Quantity(say 50*10)}

 

but in the field (value for mechanics) i want only those value which is filled in the fields (Denomination and Quantity) of record type of mechanics only

Simmilarly, for Value for Reborer will have values filled in the fields (Denomination and Quantity) for the the record type reborer only


 


Hi,

 

I have a custom object SCHEME for which i have Record types standard and Additional and i have a picklist field TYPE(in both the record types) values in picklist field "TYPE":- 1> mechanics 2> reborer 3> mechanics + reborer

 

ON the scemes we have SCHEME LINE ITEMS related list. 

 

Which has record types: 1> mechanics 2> reborer 3> mechanics + reborer

 

So if i select the mechanics in the TYPE(picklist value in SCHEME) than the SCHEME LINE ITEMS record type for the reborer and mechanics + reborer should not be selected i.e only record type of scheme line item should be selected for which we have a picklist value in scheme.

Hi,

 

I have a custom object name "Product Segments"  and when someone click new to enter new product segments then it should check whether the record already exist or not ,,if exist then it should throw an error 

 

trigger should check on these field "Product Segment Name",,"Product Segment Code" and "Product Category Name".

 

if any record consist of same values in above field which already exists in system then it should not be saved. 

Hi,

 

I have a custom object name "Product Segments"  and when someone click new to enter new product segments then it should check whether the record already exist or not ,,if exist then it should throw an error 

 

trigger should check on these field "Product Segment Name",,"Product Segment Code" and "Product Category Name".

 

if any record consist of same values in above field which already exists in system then it should not be saved. 

I have a look field having some vales and i want when i select any value in this look up then the values related to that look up should reflect in another look -up field values .......its something like controlling and dependent scenario....please help me in acheiving this.

Hi ,

 

I have a look-up field having some values ...now bases on those values i want the values related to that value to reflect in another look-up. 

 

 

/*****************************************************************************
Name     : Update Owner Manager on the opportunity from the User object

Purpose  : defaults the Owner Manager field of the opportunity from the User


******************************************************************************/
trigger UpdateOwnerManager on Opportunity (before insert, before update ){
  /**
  1. For each opportunity being inserted add User Id value in in Set of User Ids.
  2. Fetch all Users whose Id is in the Set.
  3. Add these fetched Users in a Map <User Id, User object>
  4. for each opportunity being inserted get User from the map and update the field values  
  **/  
  

 //holds User Ids
  Set<Id>setUserIds=new Set<Id>();
  
  //holds a list of Users
  List<User> listUser = new List<User>();
  
  //holds key value pairs of User Id and User Object
  Map<Id, User> mapUserObj = new Map<Id, User>();

  //holds User object
  User UserObj;
   
  //For each opportunity being inserted add User Id value in in Set of User Ids.
  for(Opportunity oppObj : Trigger.new){
    if(oppObj.OwnerId != null){
      setUserIds.add(oppObj.OwnerId);
    }
  }
  
  //Fetch all Users whose Id is in the Set.
  listUser = [Select u.Manager.Email, u.ManagerId From User u];
  if(listUser.size() == 0){
    return;  
  }
  
  //Add these fetched Users in a Map <User Id, User object>
  for(User usrObj : listUser){
    mapUserObj.put(usrObj.Id, usrObj);  
  }
  
  //for each opportunity being inserted get User from the map and update the field values
  for(Opportunity oppObj : Trigger.new){
    //get User object
    if(oppObj.OwnerId != null){
      if(mapUserObj.containsKey(oppObj.OwnerId)){
        UserObj = mapUserObj.get(oppObj.OwnerId);
        //map opportunity fields to User fields
        oppObj.Manager_of_record_owner__c = UserObj.Manager.Email;
      }  
    }
  }
}

Hi,

 

i have an custom object INDIVIDUAL CUSTOMER:-

In this object i have a picklist field Customer Type: 1> mechanic 2> Reborer 3> Retailer.

Now based on this Customer type there should be a unique field having the unique id say contact id.

 

For Eg:-  If the customer type is MECHANIC then the unique id field should be like {MEC-0000}

                 If the customer type is REBRER then the unique id field should be like {REB-0000}

                  If the customer type is RETAILER then the unique id field should be like {RET-0000}

 

Also, for each next Record created for mechanic it should be MEC-0000 then MEC-0001,MEC-0002 in the uniqueid field(contact id).

Simmilarly, 

                     for each next Record created for Rebrorer it should be REB-0000 then REB-0001,REB-0002 in the uniqueid field(contact id).

                     for each next Record created for RETAILER it should be RET-0000 then RET-0001,RET-0002 in the uniqueid field(contact id).


 

Hi,

 

I have created a visualforce page for barcode generation. but my barcode(which should be in to a box) is coming out of the box for which i will have to use CSS in my visual force page.

 

Please help me  to set the bar code in to the box.



 

I have a custom object-Scheme line(which has three record types i.e mechanics,reborer and  Retailers)  in this i have   fields Denomination and Quantity.

 

Now i want to have formula fields :-  value for mechanics,value for Reborer,value for Retailers {which is Denomination * Quantity(say 50*10)}

 

but in the field (value for mechanics) i want only those value which is filled in the fields (Denomination and Quantity) of record type of mechanics only

Simmilarly, for Value for Reborer will have values filled in the fields (Denomination and Quantity) for the the record type reborer only

Hi,

 

I have a custom object SCHEME for which i have Record types standard and Additional and i have a picklist field TYPE(in both the record types) values in picklist field "TYPE":- 1> mechanics 2> reborer 3> mechanics + reborer

 

ON the scemes we have SCHEME LINE ITEMS related list. 

 

Which has record types: 1> mechanics 2> reborer 3> mechanics + reborer

 

So if i select the mechanics in the TYPE(picklist value in SCHEME) than the SCHEME LINE ITEMS record type for the reborer and mechanics + reborer should not be selected i.e only record type of scheme line item should be selected for which we have a picklist value in scheme.

We are looking for a Salesforce.com Project Manager and Business Analyst in the greater Los Angeles area.

This is for a Fortune 500 company and project is long term (1 year+).

Please send resumes to jobs@onwardsystems.com

Ph: 909-851-3911

 

Hi,

 

I have a custom object name "Product Segments"  and when someone click new to enter new product segments then it should check whether the record already exist or not ,,if exist then it should throw an error 

 

trigger should check on these field "Product Segment Name",,"Product Segment Code" and "Product Category Name".

 

if any record consist of same values in above field which already exists in system then it should not be saved. 

 

 

/*****************************************************************************
Name     : Update Owner Manager on the opportunity from the User object

Purpose  : defaults the Owner Manager field of the opportunity from the User


******************************************************************************/
trigger UpdateOwnerManager on Opportunity (before insert, before update ){
  /**
  1. For each opportunity being inserted add User Id value in in Set of User Ids.
  2. Fetch all Users whose Id is in the Set.
  3. Add these fetched Users in a Map <User Id, User object>
  4. for each opportunity being inserted get User from the map and update the field values  
  **/  
  

 //holds User Ids
  Set<Id>setUserIds=new Set<Id>();
  
  //holds a list of Users
  List<User> listUser = new List<User>();
  
  //holds key value pairs of User Id and User Object
  Map<Id, User> mapUserObj = new Map<Id, User>();

  //holds User object
  User UserObj;
   
  //For each opportunity being inserted add User Id value in in Set of User Ids.
  for(Opportunity oppObj : Trigger.new){
    if(oppObj.OwnerId != null){
      setUserIds.add(oppObj.OwnerId);
    }
  }
  
  //Fetch all Users whose Id is in the Set.
  listUser = [Select u.Manager.Email, u.ManagerId From User u];
  if(listUser.size() == 0){
    return;  
  }
  
  //Add these fetched Users in a Map <User Id, User object>
  for(User usrObj : listUser){
    mapUserObj.put(usrObj.Id, usrObj);  
  }
  
  //for each opportunity being inserted get User from the map and update the field values
  for(Opportunity oppObj : Trigger.new){
    //get User object
    if(oppObj.OwnerId != null){
      if(mapUserObj.containsKey(oppObj.OwnerId)){
        UserObj = mapUserObj.get(oppObj.OwnerId);
        //map opportunity fields to User fields
        oppObj.Manager_of_record_owner__c = UserObj.Manager.Email;
      }  
    }
  }
}