• Akash_CRM
  • NEWBIE
  • 65 Points
  • Member since 2015

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 1
    Questions
  • 13
    Replies
Hi , 

I was wondering if it's possible to dynamically assign record types of a child object based on a parent objects record type. 

Currently we use the case object to handle a lot of our business processes, and we are just starting to use custom objects. We provide different services such as warranties or exchanges, etc. for different parts, and these are handled through case record types. We recently created a master-detail relationship for a case part that allows the user to add multiple parts to a single case, but part information views will be different depending on the service we offer. 

What I'm looking for is if the user selected an exchange case record type, and added a new related list part instead of seeing part record types for warranties and exchanges, they would automatically open the part exchange record type. 

The only solution I've tried is creating custom buttons and modifying the URL (URL Hacking), but I've read this isn't a best practice, if there was a better way I'd love to learn how to do it. 

/a0Q/e
?CF...={!Case.CaseNumber}
&CF..._lkid={!Case.Id}
&retURL=%2F{!Case.Id}
&RecordType= #######

Above is my URL Hack where CF... is the link to my Custom Object ID and RecordType is equal to the specific record type I want to display.

I just like to know best practices as I'm still learning.

I appreciate it, thanks!
Dustin
I have a custom field (Tenant__c) which represents a lookup value for Accounts. I am trying to write a SOQL query to extract the names in this field, rather than the 18 character case safe value. I know when you are trying to to pull the name for the Account field, you express it as "Account.Name", but I cannot get the correct syntax for this custom field (Tenant.Name__c does not work). What is the correct syntax in this situation? Thank you.
Hi All,

We have used Salesforce to Salesforce Integration. Connection User is used by Salesforce to internally manage the transaction. We are facing issues due to timestamp difference of Connection User and ORG users. The timezone of Connection user is PST but the default timezone of the ORG is GMT. 

So when Date is getting converted from datetime to date field it is not showing appropriate date when data is coming from another ORG. Any inputs if the time zone of Connection Users can be changed would be appreciated.

Thanks!
Hi Guys,

I am facing an issue which I thought could be easily resolved but I am finding it extreemly difficult to solve. I would have thought that Salesforce would have an out of the box solution for this and please guide me in the right direction if they do but I cannot find it.

I am working with and insurance company who are using an Unlimited Service Cloud Edition of Salesforce. Agents dealing with Cases only receive Policy Numbers (NOT CONTACT NAMES) when dealing with a case. I have created a Custom Object and Called It Policy_Information_c which has a Master-Detail Relationship with Contacts, and stores all of the relavent Policy Information. On the Case Object I have a created a Custom Lookup Field to Policy_Information_c.

The user has requested that the Contact Lookup Field in Cases is Filtered based on the Policy No. Lookup field eg. The user inputs the Policy Number in the Case Record, clicks on the Contact Lookup Icon, and only the Contacts related to that Policy Number will appear. Just so you also know, a Policy No. can be related to more than one Contact. I keep running into a brick wall when trying to build this logic into Salesforce and I am finding it very hard to find a proper solution both on this forum and on the Success Community.

Is there an out of the Box Solution that I have completely missed?

Thanks guys. 
  • August 01, 2016
  • Like
  • 0
I am having a VF page which has input text and i made them required by wrapping in outputlabel.
Like this
 
<apex:pageBlockSectionItem >
               <apex:outputLabel value="Contact Email"/>
               <apex:outputPanel layout="block" styleClass="requiredInput">
               <apex:outputPanel layout="block" styleClass="requiredBlock"/>
               <apex:inputtext label="Email" value="{!contactemail}"/>
               </apex:outputPanel>
            </apex:pageBlockSectionItem>

I would like to display error message when email field is not filled.

I am giving <apex:pagemessages /> in Vf page and below add message in apex class before i upsert contact.

if( Email == null || email== '' ){
    ApexPages.addMessage( new ApexPages.Message( ApexPages.Severity.ERROR, 'Please enter Email'));
   return null;           
}
Still it doesnt work.Please guide me where am i going wrong.
 
Hi , 

I was wondering if it's possible to dynamically assign record types of a child object based on a parent objects record type. 

Currently we use the case object to handle a lot of our business processes, and we are just starting to use custom objects. We provide different services such as warranties or exchanges, etc. for different parts, and these are handled through case record types. We recently created a master-detail relationship for a case part that allows the user to add multiple parts to a single case, but part information views will be different depending on the service we offer. 

What I'm looking for is if the user selected an exchange case record type, and added a new related list part instead of seeing part record types for warranties and exchanges, they would automatically open the part exchange record type. 

The only solution I've tried is creating custom buttons and modifying the URL (URL Hacking), but I've read this isn't a best practice, if there was a better way I'd love to learn how to do it. 

/a0Q/e
?CF...={!Case.CaseNumber}
&CF..._lkid={!Case.Id}
&retURL=%2F{!Case.Id}
&RecordType= #######

Above is my URL Hack where CF... is the link to my Custom Object ID and RecordType is equal to the specific record type I want to display.

I just like to know best practices as I'm still learning.

I appreciate it, thanks!
Dustin
Hi,
While converting lead to opportunity,i want to attach all the attachments from lead to opportunity.
I have written a trigger for this but its nor firing.Can you please help me on this.
 
trigger LeadConvert on Lead (after update) {

List<Attachment> lstattach=new List<Attachment>();



if (Trigger.old[0].isConverted == false && Trigger.new[0].isConverted == true) {


	System.debug('oppid' + Trigger.new[0].ConvertedOpportunityId);
	Attachment aa=[Select Id,ParentId from Attachment where ParentId=:Trigger.new[0].ConvertedaccountId];
	System.debug('attachment in lead' + aa );

if (Trigger.new[0].ConvertedOpportunityId != null) {

for(Attachment a:[Select Id,ParentId from Attachment where ParentId=:Trigger.new[0].ConvertedaccountId]){


  a.ParentId=Trigger.new[0].ConvertedOpportunityId;
  System.debug('parentid' +a.ParentId);

  lstattach.add(a);
}

update lstattach;
}

}


}

 
What page layout or layout is used when a user clicks the "Close" button from a Case List View? I need to know how I can add fields to the page that's displayed there.
Hi,

I'' m trying to put the value of Quantity from Catalog_Line_Item__c to 'Quantity' from Opportunity.
 
/* 
     *  updateQuantity(String ID) 
     *  Updates the Quantity field of the Catalog Line Item with the given Id 
     */
    public PageReference updateQuantity() {
        if(!Catalog_Line_Item__c.sObjectType.getDescribe().isUpdateable()) {
            ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.FATAL,'Insufficient access'));
            return null;
        }
        
        li = [SELECT Quantity__c FROM Catalog_Line_Item__c WHERE Id =: productId LIMIT 1];
        li.Quantity__c = productQuantity;
        update li;
        update myOrder;      
        quantity = li.Quantity__c;
        
        // Stay on current page
        return null;
    }
(variable 'quantity' is double)
 
// Add product and Pricebook to the particular opportunity using OpportunityLineItem 
        OpportunityLineItem oppLineItem = new OpportunityLineItem();
        oppLineItem.OpportunityId = opp.Id;
        oppLineItem.PricebookEntryId = customPriceBookEntry.Id;
        oppLineItem.UnitPrice = customPriceBookEntry.UnitPrice;
        oppLineItem.Quantity = quantity ;
        insert oppLineItem;

This is the error message. that appeats when I Execute the Catalog:
Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING: [Quantity]: [Quantity].

Can someone help me?
Thanks.
Hi All,

I want to insert records when i click on Save button of VF page in another Salesforce organization using Apex. Please help me how to achieve this.Currently I have done locally but how to do ifor inserting records in another Salesforce org.
I have a custom field (Tenant__c) which represents a lookup value for Accounts. I am trying to write a SOQL query to extract the names in this field, rather than the 18 character case safe value. I know when you are trying to to pull the name for the Account field, you express it as "Account.Name", but I cannot get the correct syntax for this custom field (Tenant.Name__c does not work). What is the correct syntax in this situation? Thank you.
Hi,

To implement URL hacking, we use id's in the URL. Wanted to know if the ID's would remian same if we migrate it to different evn ? 

Regards,
Pallavi
  • July 22, 2016
  • Like
  • 0
I am working on a requirment where I have a custom button, which calls the visualforce page , which calls the flow

I want only the users who own the record to be able to click on the custom button, others should get an alert

I need suggestions where should this alert be? (The technical behavior is correct, its not letting user use the button ,however, giving weird error -Unhandled flow exception) I  want to give a friendly message here

Any suggestions?
Hi , 

I was wondering if it's possible to dynamically assign record types of a child object based on a parent objects record type. 

Currently we use the case object to handle a lot of our business processes, and we are just starting to use custom objects. We provide different services such as warranties or exchanges, etc. for different parts, and these are handled through case record types. We recently created a master-detail relationship for a case part that allows the user to add multiple parts to a single case, but part information views will be different depending on the service we offer. 

What I'm looking for is if the user selected an exchange case record type, and added a new related list part instead of seeing part record types for warranties and exchanges, they would automatically open the part exchange record type. 

The only solution I've tried is creating custom buttons and modifying the URL (URL Hacking), but I've read this isn't a best practice, if there was a better way I'd love to learn how to do it. 

/a0Q/e
?CF...={!Case.CaseNumber}
&CF..._lkid={!Case.Id}
&retURL=%2F{!Case.Id}
&RecordType= #######

Above is my URL Hack where CF... is the link to my Custom Object ID and RecordType is equal to the specific record type I want to display.

I just like to know best practices as I'm still learning.

I appreciate it, thanks!
Dustin