• Atul Gupta
  • NEWBIE
  • 140 Points
  • Member since 2013
  • Independent Software Consultant/Developer(5X)
  • CloudVandana


  • Chatter
    Feed
  • 4
    Best Answers
  • 0
    Likes Received
  • 23
    Likes Given
  • 9
    Questions
  • 58
    Replies
Hello,

I would like to create possibly a trigger for dates that selects the real number of days according to availability.

For example if I have an Account that has available days only Monday and Tuesday every week, but selects for example Off Days between 16.05.2016 (Monday) till 22.05.2016 (Sunday), I don't want it to roll-up the days and count 7 days, but use the Availabilty and show me only the real 2 day count for that period.

Is there a way to do this?

Thank you!
Hi,
When I first started Trailhead whenever I would get a badge it would ask if I wanted to share it on LinkedIn and I would say no. After my 4th badge I decided that I did want to share it on LinkedIn however, when I got my 5th badge it did not ask me.

Is there anyway that I can share my badges on LinkedIn?
I'm facing a weird issue. I am converting leads in after insert Lead Trigger, but I'm not able to fire Before Triggers on Contact that is being created on Lead conversion.

Yes I've checked the "Require Validation for Converted Leads" checkbox, but still the before triggers are not firing.

User-added image
While doing the Salesforce1 Mobile App Trailhead course.

I got the following error while doing exercise on this page (https://developer.salesforce.com/trailhead/salesforce1_mobile_app/salesforce1_mobile_app_compact_layouts)

User-added image

I'm not sure why this error is coming up.
 
I have a visualforce page that is exposed on Force.com site publicly.

I've used cache = false attribute in <apex:page> tag, if I update anything in the page and try to view the site again in the same browser, I don't see the updated page. 
It shows me the old one before the update.

I'm using bootstrap in my vf page.

I've also tried these meta tags in the head section of the page, but still not able to get it working.
 
<meta http-equiv='cache-control' content='no-cache'></meta>
<meta http-equiv='expires' content='0'></meta>
<meta http-equiv='pragma' content='no-cache'></meta>

This is a major issue, as page will be pulling ever changing data.
 
Hi Guys,

Please help me with this.

Can I set a Visualforce Tab's visibility in Permission Set ?

I'm able to find Tab visibility option for Custom Objects but not sure about Visualforce Tabs.

Hi Guys,

 

I'm stuck with this issue. I've been trying to use the new feature of testing webservice callouts for soap web services.

 

But i'm having issues with creating sample response data.

 

The example given in the developer guide, the response is pretty simple, just a "String".

My response is a little bit more complex, its a whole wrapper class :P

 

I've tried to replicate the response by passing the real webservice callout response to the wrapper class's instance in my test class but I've failed to do so.

 

Anybody have any idea how to create a dummy response or how to pass it to the class ???

I'm not able to see the overall Test Coverage of one of my Classes in the lower right section of the Developer Console.

 

I can see the individual method's coverage but not the overall coverage.

 

please help me out here.

 

 

 

Hi Guys,

 

I'm trying to get the !$Profile.Name in a var in an onclick javascript.

 

I need to some substring and indexOf operations on the profile name.

 

But every time I get an error that "Object Profile Name has no method subString".....

 

Please help me out here guys.

Hi,

 

I want to conditinally hide an inline vf page embedded in contact page layout.

 

Don't want to use sidebar javascripts.

 

Please advice.

Need to fetch URL parameter in an inline visual force page's controller ??

 

I've tried

 

String CALLID = ApexPages.currentPage().getParameters().get('CALLID');
String CALLIDsystem = System.currentPagereference().getParameters().get('CALLID');

 

I've also tried to fetch the parameter on the page itself :

 

CALLID : <apex:outputText value="{!$CurrentPage.parameters.CALLID}"/>

 

 

none of this is working ?? Any idea guys.....

Hello,

I would like to create possibly a trigger for dates that selects the real number of days according to availability.

For example if I have an Account that has available days only Monday and Tuesday every week, but selects for example Off Days between 16.05.2016 (Monday) till 22.05.2016 (Sunday), I don't want it to roll-up the days and count 7 days, but use the Availabilty and show me only the real 2 day count for that period.

Is there a way to do this?

Thank you!
Hi,
I want to check the case if some fields have blank or null values, if either of null or blank values then I want to make value as 0 , the sql server query is like this :-  select isnull(field,0) from table ,
can anyone give me soql to the above?..
Thanks in advance
Hi Friends, Thanks in advance

I need test class for following method please any body help me reagrding below code.
private static void OppLineItemSchedule(Map < Id, Opportunity > oppList) {
        List < OpportunityLineItem > oppProductLines = [SELECT Station__c, Product_Name__c, Revenue_Category__c, Revenue_Type__c,
            Quantity__c, OpportunityId, Market__c, PricebookEntryId, UnitPrice,
            Amount_Input__c, Start_Date__c, End_Date__c,
            Opportunity.Agency_Commission__c, Opportunity.Synced_Proposal__c
            FROM OpportunityLineItem
            WHERE OpportunityId IN: oppList.values()
        ];

        Map < Id, List < OpportunityLineItem >> mapOppLines = new Map < Id, List < OpportunityLineItem >> ();

        for (OpportunityLineItem oli: oppProductLines) {
            
            if (!String.isBlank(oli.Opportunity.Synced_Proposal__c)) {
                if (mapOppLines.containsKey(oli.Opportunity.Synced_Proposal__c)) {
                    mapOppLines.get(oli.Opportunity.Synced_Proposal__c).add(oli);
                } else {
                    mapOppLines.put(oli.Opportunity.Synced_Proposal__c, new List < OpportunityLineItem > {
                        oli
                    });
                }
            }
        }

        if (mapOppLines.size() > 0) {
            List<OpportunityLineItem> oliToDelete = new List<OpportunityLineItem>();
            for (List<OpportunityLineItem> olis : mapOppLines.values()) 
                oliToDelete.addAll(olis);

        }   
    }

Thanks & regards
RohithaSfdc

Hi All,

I have a scenario where Person A and Person B are 2 helpdesk representatives who login using partner community portal.
Person A should not be able to view "Cases" assigned to Person B and vice versa.
How can i achieve this?
 

Hello I'm currently developing an API that will link orders and customers to salesforce. I someone did something similar or if there is a similar project, please do share.
Hello!

I'm trying to create an email template that pulls the related opportunities from a record on the Parent Opportunity record type.The opportunities are linked by a Parent Opportunity field from Financial Force PSA. I'm able to get the email template to work if I use the PSA field as my api reference with __r, but that doesn't get me the related opportunities to the parent record. It gives me the parent record looking from the child opportunity. I've tried using Opportunities__r to no avail. It appears to be looking at another related list called Opportunities. below is a screen shot of the field details. What I really need is the API name for the related list for the Child Opportunities. Any ideas on how I might find this.

User-added image
I'm stuck on Creating a Controller Extension.  My increment button is not displaying and I've started the exercise over from scratch now 3 times.
What am I missing that the button does not appear?
Hello ,
Do we have an option to send an email alter format in a Send email message .
As in Email Alert ..we have
Subject Line
To ,From nd CC
Body
In body we give the detailed description etc.
For example :I would like to send an email to the customer regarding an product .
So how can i get it formatted in an sendemail message .
Any example very much appreciated.

 
Hi friends, My Task is to write a Trigger

when a Product is added to Opportunity, Check for previous Orders related to Opportunity account and
and if no orders exists then update a picklist field on Opportunity as (New).

if any Orders exists then check for the latest orders price and compare it with our new product price that we are adding.

if it is greater than new product's price then update  picklist on opportunity as Loss
if less then update as WOn.

I have Written a trigger to achieve this and was stuck at this point. Needed help to proceed further..!


trigger triggeronopportunity on Opportunity (before insert,before update) {
    List<opportunity> oppo = new List<opportunity>();
    List<Account> acc = new List<Account>();
    List<OpportunityLineItem> oppl = new List<OpportunityLineItem>();
   Set<ID> OppIds = new Set<ID>();
    Set<ID> accIds = new Set<ID>();
    for(Opportunity opp : trigger.new){
        if(oppl.size() == 0){
            opp.Revenue_Type__c = 'New';
            }
   for(Order o : [SELECT Id FROM Order WHERE id in :accIds]){
         //======== Strucked Here =============
        }   
    }
    
}

How to Proceed further....! (Or) any other way to do this...!
  • April 11, 2016
  • Like
  • 1
Hi,
how to remove selected items from selectlist ?

Thanks,
Nansi
I will explain what the script below achieves. We have a custom "Properties" object. On a properties record we have buttons that users select to generate documents. For example, "generate document". Once they select this button the document is generated through conga and automatically a new record is created in a new custom object called Properties Documents with the attached document. The script below was created by a team before my time. I am trying to replicate this process for two new custom objects. Those custom objects being "Resales" and "Resales Documents". Same idea, when users are on a resales record and they select a button to generate a document I want the document to be generated and automatically a new resales documents record is created with the attachment. I'm not familiar with Apex classes so if you could please help it would be greatly appreciated. The api name for Resales is Resales__c and for Resales Documents it is Resales_Documents__c.



public with sharing class AttachmentTriggerHandler {

  //public void OnBeforeInsert(Attachment[] newObjects){
    
  //}
  
  public void OnAfterInsert(Attachment[] newObjects){
    //creates new properties documents and copies the attachment to it.
      list<Attachment> aList = new list<Attachment>();
      for(Attachment a : newObjects){
        if(a.ParentId.getSobjectType() == Schema.Properties__c.SObjectType){
          aList.add(a);
        }
      }
      if(aList.size() > 0){
        PropertiesAttachment pa = new PropertiesAttachment();
        pa.CreateNewPropertiesAttatchment(aList); 
      }
  }
  
/*  public void OnBeforeUpdate(Attachment[] oldObjects, Attachment[] updatedObjects, map<id,Attachment> MapNewMap, map<id,Attachment> MapOldMap){

  }
  
  public void OnAfterUpdate(Attachment[] oldObjects, Attachment[] updatedObjects, map<id,Attachment> MapNewMap, map<id,Attachment> MapOldMap){
  
  }
  
  public void OnBeforeDelete(Attachment[] ObjectsToDelete, map<id,Attachment> MapNewMap, map<id,Attachment> MapOldMap){
  
  }
  
  public void OnAfterDelete(Attachment[] deletedObjects, map<id,Attachment> MapNewMap, map<id,Attachment> MapOldMap){
  
  }
  
  public void OnUndelete(Attachment[] restoredObjects){
  
  }
*/
}
Hi Guys,

Pretty new to using SOQL but trying to run a query for an external report that we want to generate but need to join two tables in salesforce in order to do that. What i am trying to achieve is to show a description of the services they are entitled to- Secon Services contains the description and names and Entitlements contains what they actually have ... all very confusing if you have how I can do the below query 

SELECT Service_Type__c FROM Entitlement WHERE AccountId = 'X'

 IF Service_Type__c FROM Entitlement  = 'CARE Contract' THEN  - How do i do this to link the to querys?

SELECT Name, Description FROM Secon_Services__c WHERE Name = 'CARE Contract'
I would like to place an image of a diagram next to a set of fields in the Contact record (when a user is filling out the information) that users can refer to to better fill out that section. Is there a way to code for this or do this at all?
Hi,
I want to check the case if some fields have blank or null values, if either of null or blank values then I want to make value as 0 , the sql server query is like this :-  select isnull(field,0) from table ,
can anyone give me soql to the above?..
Thanks in advance
Hi Friends, Thanks in advance

I need test class for following method please any body help me reagrding below code.
private static void OppLineItemSchedule(Map < Id, Opportunity > oppList) {
        List < OpportunityLineItem > oppProductLines = [SELECT Station__c, Product_Name__c, Revenue_Category__c, Revenue_Type__c,
            Quantity__c, OpportunityId, Market__c, PricebookEntryId, UnitPrice,
            Amount_Input__c, Start_Date__c, End_Date__c,
            Opportunity.Agency_Commission__c, Opportunity.Synced_Proposal__c
            FROM OpportunityLineItem
            WHERE OpportunityId IN: oppList.values()
        ];

        Map < Id, List < OpportunityLineItem >> mapOppLines = new Map < Id, List < OpportunityLineItem >> ();

        for (OpportunityLineItem oli: oppProductLines) {
            
            if (!String.isBlank(oli.Opportunity.Synced_Proposal__c)) {
                if (mapOppLines.containsKey(oli.Opportunity.Synced_Proposal__c)) {
                    mapOppLines.get(oli.Opportunity.Synced_Proposal__c).add(oli);
                } else {
                    mapOppLines.put(oli.Opportunity.Synced_Proposal__c, new List < OpportunityLineItem > {
                        oli
                    });
                }
            }
        }

        if (mapOppLines.size() > 0) {
            List<OpportunityLineItem> oliToDelete = new List<OpportunityLineItem>();
            for (List<OpportunityLineItem> olis : mapOppLines.values()) 
                oliToDelete.addAll(olis);

        }   
    }

Thanks & regards
RohithaSfdc
Is there a way for me to find out if we are currently using a self signed certificate with any of our SFDC applications?  I can see that we created one  (or someone created one for us) a couple of years ago.  I received a notification that it will soon be expiring but I'm not aware of us actually using it for anything.
I've made it almost completely through this challenge but am encounter difficultly with the chatter portion of this chatter.  I've enabled the chatter in reports and dashboard settings, but I still don't have anything show up in my feed that allows me to follow, and when I hover over my chart in dashboards it doesn't give me the menu to take a snapshot it instead says "click to go to full report".  Help please!!

Hi All,

I have a scenario where Person A and Person B are 2 helpdesk representatives who login using partner community portal.
Person A should not be able to view "Cases" assigned to Person B and vice versa.
How can i achieve this?
 

I'm on the using report formats and I'm having problems creating the report. It says that I have already created it, but when I check challenge it says that I have not created the report.
I'm stuck on Creating a Controller Extension.  My increment button is not displaying and I've started the exercise over from scratch now 3 times.
What am I missing that the button does not appear?
We have developed a REST service that should be pinged from Authorize.net's Silent Post URL feature with an XML post that we can ingest. It works when we test it manually from the apex workbench, but we're seeing nothing come through from Authorize.net. Authorize.net has given us the specific IP addresses we should see traffic from, is there any way to see a log to know if any attempts were even made? 
Hello, 

I'm using the triggered send from ET for the forgot password mail to a client. But for some reason the URL gets double encoded 
Created / Passed fromback-end (java)https://example.com/tools/resetpassword.reset.html?key=xuklHH9758Zny1zGDn0eG1kVuUvkUlgxLeV9hjKY7sg%3D
Stored in Marketing Cloudhttps://example.com/tools/resetpassword.reset.html?key=xuklHH9758Zny1zGDn0eG1kVuUvkUlgxLeV9hjKY7sg%3D
Presented in Email Linkhttps://example.com/tools/resetpassword.reset.html?key=xuklHH9758Zny1zGDn0eG1kVuUvkUlgxLeV9hjKY7sg%3D
After clicking link, the link from above loads in the browser and is then redirected to:https://www.example.com/tools/resetpassword.reset.html?key=xuklHH9758Zny1zGDn0eG1kVuUvkUlgxLeV9hjKY7sg%253D

Below is the HTML coed that I have used 

<a class="mcnButton" title="Password Reset"  decodeURIComponent(href="%%reset_url%%") target="_blank" style="font-weight: normal;letter-spacing: normal;line-height: 100%;text-align: center;text-decoration: none;color: #FFFFFF;mso-line-height-rule: exactly;-ms-text-size-adjust: 100%;-webkit-text-size-adjust: 100%;display: block;">Reset Password</a>

As you can see I have used the DecodeURI, but that doesn't work either. Since the URL is broken it does take me to the page ,but it doesn't reset the password.  
Kindly help me. 
Below is code/method from sample project:

 private String invokeRestAPI(String endpointURL)
 {
      WebClient wc = buildWebClient();
       return wc.DownloadString(endpointURL);
  }

In above code "wc.DownloadString(endpointURL)" gives error "The remote server returned an error: (400) Bad Request." while returning result. This problem exist when i do bulk update of records(1000 +).

Can any buddy help me out to solve this out?? Is there any time out problem?? Or any other configurational change needed to sole it out???

 
I have implemented single sign on between my salesforce org and Identity Provider(i.e. okta). Its working as expected. But now i want Oauth access token for my implementation with existing SAML implementation. For this i am referring https://help.salesforce.com/apex/HTViewHelpDoc?id=remoteaccess_oauth_SAML_bearer_flow.htm&language=en. I am sending post request to https://login.salesforce.com/services/oauth2/token with signed assertion. I have created connected app in salesforce org. I am using client id of connected app as an issuer in assertion.

Using this flow i am getting "Failed: Missing Consumer Key Parameter" under user Login History section.

Also i want to know about use of Oauth 2.0 token endpoint which gets generated after doing Single sign on setting in salesforce org using saml. I am talking about the flow which is mentioned in below link.
https://help.salesforce.com/apex/HTViewHelpDoc?id=remoteaccess_oauth_web_sso_flow.htm&language=en

I want to use one of the two approaches mentioned above.Please help me on this.
We have a couple of managed apps, that when installed (like a customer), appear outside of 'Referenced Packages' folder in eclipse. I don't understand why other apps show up inside 'Referenced Packages' while mine doesn't.
Can, we as a vendor, control the install location?
 
  • April 11, 2016
  • Like
  • 1
Hi friends, My Task is to write a Trigger

when a Product is added to Opportunity, Check for previous Orders related to Opportunity account and
and if no orders exists then update a picklist field on Opportunity as (New).

if any Orders exists then check for the latest orders price and compare it with our new product price that we are adding.

if it is greater than new product's price then update  picklist on opportunity as Loss
if less then update as WOn.

I have Written a trigger to achieve this and was stuck at this point. Needed help to proceed further..!


trigger triggeronopportunity on Opportunity (before insert,before update) {
    List<opportunity> oppo = new List<opportunity>();
    List<Account> acc = new List<Account>();
    List<OpportunityLineItem> oppl = new List<OpportunityLineItem>();
   Set<ID> OppIds = new Set<ID>();
    Set<ID> accIds = new Set<ID>();
    for(Opportunity opp : trigger.new){
        if(oppl.size() == 0){
            opp.Revenue_Type__c = 'New';
            }
   for(Order o : [SELECT Id FROM Order WHERE id in :accIds]){
         //======== Strucked Here =============
        }   
    }
    
}

How to Proceed further....! (Or) any other way to do this...!
  • April 11, 2016
  • Like
  • 1
Hi,
how to remove selected items from selectlist ?

Thanks,
Nansi
It happend since two days ago, I can not save anything in developer Console. It always display "saving: ....*", no error retured. in the process tab, The status for all entried is finished though. I have tried to cancel save or cancell all deployments, and create a new workplace. none of those worked. Could anyone help?
I have a custom visual force page that calculates prices when fields are changed. The only problem is I have a required field that does not need to be required in order to do the calculations but is required in order to save.  I'm not great with styling and everything is in the exact spot I need it in using the code I have provided. Is there a way to just ignore that field?
 
<apex:page standardController="EventPackageRevenueBreakdown__c"
		   extensions="EventPackageRevenueBreakdownExt" standardStylesheets="true"
		   tabstyle="EventPackageRevenueBreakdown__c"
		   docType="html-5.0">
	<apex:form >
		<apex:sectionHeader title="{!$ObjectType.EventPackageRevenueBreakdown__c.label} {!$Label.new}"
							subtitle="{!EventPackageRevenueBreakdown__c.Name}"
							help="{!$Label.NIBaseHelpURL}#cshid= event_package_revenue_breakdown_new">
		</apex:sectionHeader>
		<apex:pageBlock mode="edit"
						title="{!$ObjectType.EventPackageRevenueBreakdown__c.label} {!$Label.new}">
			<apex:pageblockbuttons >
				<apex:commandbutton action="{!save}" value="{!$Label.Package_Save}"></apex:commandbutton>
				<apex:commandbutton action="{!SaveAndNew}"
									value="{!$Label.Package_SaveAndNew}"></apex:commandbutton>
				<apex:commandbutton action="{!cancel}"
									value="{!$Label.Package_Cancel}"></apex:commandbutton>
			</apex:pageblockbuttons>
			<apex:pagemessages ></apex:pagemessages>
			<apex:pageblocksection title="{!$Label.Package_Information}" id="block123">
				<apex:actionFunction name="CalculateInclusive" action="{!CalculateInclusive}"
									 rerender="block123"></apex:actionFunction>
				<apex:actionFunction name="CalculateExclusive" action="{!CalculateExclusive}"
									 rerender="block123"></apex:actionFunction>
				<apex:pageBlockSectionItem >
					<apex:outputpanel layout="block" styleClass="requiredInput"></apex:outputpanel>
				</apex:pageBlockSectionItem>
				<apex:outputpanel layout="block" styleClass="requiredBlock"></apex:outputpanel>
				<apex:inputfield required="true"
								 value="{!EventPackageRevenueBreakdown__c.UnitPrice__c}" label="inclusive label" onChange="CalculateInclusive()">	</apex:inputfield>
				<apex:inputfield required="false"
								 value="{!EventPackageRevenueBreakdown__c.Location__c}"></apex:inputfield>
				<apex:pageBlockSectionItem rendered="{!NOT(showInclusivePrices)}">
					<apex:outputLabel value="{!inclusiveLabel}"></apex:outputLabel>
				</apex:pageBlockSectionItem>
				<apex:pageBlockSectionItem rendered="{!showInclusivePrices}">
					<apex:outputLabel value="Inclusive Rate"></apex:outputLabel>
					<apex:input type="number" value="{!InclusiveRate}" onChange="CalculateExclusive()"  onkeypress="if (event.keyCode==13) {CalculateExclusive(); return false;} else return true;"></apex:input>
				</apex:pageBlockSectionItem>
				<apex:inputfield value="{!EventPackageRevenueBreakdown__c.BookingPackageEvent__c}"/>
				<apex:inputfield required="true"
								 value="{!EventPackageRevenueBreakdown__c.RevenueClassification__c}" onChange="CalculateInclusive()"></apex:inputfield>

				<apex:inputfield required="true"
								 value="{!EventPackageRevenueBreakdown__c.Name}"  ></apex:inputfield>
			</apex:pageblocksection>
			<apex:pageblocksection title="{!$Label.AdminChargeAndGratuity}">
				<apex:inputfield required="false"
								 value="{!EventPackageRevenueBreakdown__c.AdminCharge__c}" onChange="CalculateInclusive()"></apex:inputfield>
				<apex:inputfield required="false" value="{!EventPackageRevenueBreakdown__c.Gratuity__c}" onChange="CalculateInclusive()"></apex:inputfield>
			</apex:pageblocksection>
			<apex:pageblocksection title="{!$Label.InclusivePrice}"
								   rendered="{!showInclusivePrices}"
								   collapsible="true">
				<apex:inputcheckbox value="{!EventPackageRevenueBreakdown__c.AdminIsIncludedInInclusivePrice__c}" onChange="CalculateInclusive()"></apex:inputcheckbox>
				<apex:inputcheckbox value="{!EventPackageRevenueBreakdown__c.GratuityIsIncludedInInclusivePrice__c}" onChange="CalculateInclusive()"></apex:inputcheckbox>
			</apex:pageblocksection>
		</apex:pageBlock>
	</apex:form>
</apex:page>

 
Hi Guys,

Pretty new to using SOQL but trying to run a query for an external report that we want to generate but need to join two tables in salesforce in order to do that. What i am trying to achieve is to show a description of the services they are entitled to- Secon Services contains the description and names and Entitlements contains what they actually have ... all very confusing if you have how I can do the below query 

SELECT Service_Type__c FROM Entitlement WHERE AccountId = 'X'

 IF Service_Type__c FROM Entitlement  = 'CARE Contract' THEN  - How do i do this to link the to querys?

SELECT Name, Description FROM Secon_Services__c WHERE Name = 'CARE Contract'
I would like to place an image of a diagram next to a set of fields in the Contact record (when a user is filling out the information) that users can refer to to better fill out that section. Is there a way to code for this or do this at all?
I tried converting a lead with attachments in my dev org using the Salesfoce Lightning, and found out that the Attachments didn't convert into the Contacts.

Anyone ever experienced this?

Lead with attachment --> Convert to Contact --> Attachment doesn't show up in Contact or Account as per documentation below:
http://help.salesforce.com/HTViewSolution?id=000231874

I'm expecting either the attachments to be in Accounts/Contact and I don't see it either places