• Ankit Gupta
  • NEWBIE
  • 90 Points
  • Member since 2013

  • Chatter
    Feed
  • 1
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 13
    Replies
Hi guys,
I'm a newbie force.com developer: I'm triyng to implement a VF page using URL function passing parameter based on the selected record from a list in the previous VF page, but I have a problem with the autopopulating of a lookup field: can anyone help me, please?

This is the code for my VF page: 


<apex:page controller="Sebi_ControllerSelezionaMacchina">

  <apex:outputLabel value="{!exec_message}" id="msg"/>
<apex:pageBlock >

<apex:PageBlockTable value="{!ListaCar}" var="c" columns="3">
   <apex:column value="{!c.Name}"/>
   <apex:column value="{!c.AvailabilityLights__c}"/>
   <apex:column value="{!c.RatingCar__c}"/>
   <apex:column >
       <apex:form >
         
             <apex:commandButton value="Select" action="{!URLFOR($Action.Journey__c.New,null
,['Car_Select' = '{!$c.Id}' ])}" />


<!-- 'lookupRecordId'= '{!currName.Id}'  ['lookupFieldId'=value]  ['Car_Select__c' = '{!c.Id}' ] -->

          
       </apex:form>
   </apex:column>   
</apex:PageBlockTable>
</apex:pageBlock>

</apex:page>

Hi,

A user is running a class in without sharing context and still the user is not able to insert AccountShare object record through  apex code. When i searched online , I found that a user should have modify all data permission to insert the AccountShare record.

But when there is another custom object to which the user has absolutely no access , he is able to insert the record through apex code.

Is this a salesforce bug or what?How can i overcome this.

Any ideas are much appreciated.

Regards,
Ankit 
Hi,

I have a scenario whenever a person goes to the Home Tab,he is taken to a Disclaimer Page and whenever he/she accepts the terms,a new section is rendered of the same VF page which has a standard controller and apex tags like inputfield which have a default value set at the field level.But I am not able to get the default values as soon as I hit Accept Terms and conditions button.

But if I have two different VF Pages,this works very fine and I am able to get the default values.
Any inputs are highly appreciated.

Regards,
Ankit Gupta
SFDC Developer



Hi,

I have a scenario whenever a person goes to the Home Tab,he is taken to a Disclaimer Page and whenever he/she accepts the terms,a new section is rendered of the same VF page which has a standard controller and apex tags like inputfield which have a default value set at the field level.But I am not able to get the default values as soon as I hit Accept Terms and conditions button.

But if I have two different VF Pages,this works very fine and I am able to get the default values.
Any inputs are highly appreciated.

Regards,
Ankit Gupta
SFDC Developer



Hey guys trying to get comfortable with the Salesforce CLI, and went to deploy my code changes to my Dev Org but I keep getting the following error message. I checked out the link that they listed, but couldn't seem to figure out what issue was. I modified the JSON with the folder name that I'm trying to deploy, but still had no luck. 
 
Error deploying or retrieving source: The file or directory that you tried to deploy or retrieve isn't in a package directory that's specified in your sfdx-project.json file. Add this location to your "packageDirectories" value, or deploy or retrieve a different file or directory. For details about sfdx-project.json, see: https://developer.salesforce.com/docs/atlas.en-us.sfdx_dev.meta/sfdx_dev/sfdx_dev_ws_config.htm

 
im trying to send the notes and attachment of custom object to the contacts of accounts through a apex page if any one did this before can u refere me any blog r code for this im working this requriment about 2 days bt i can send the mail bt i dnt knw how to fetch the notes with the mail
can any knw pls help me in this requirement
Hi there,

I have an extension that someone from the forum assisted me in writing. It is used for autofilling the account field (from the URL) and saving a custom object - Destiny Survey. This is a child of account. Basically, the extension is designed so that should the url to the force.com site is appended with acct={!Account.Id} it will autofill Account__c and therefore upon completion of the survey it will place the record into the correct account.

I was hoping someone could help me do the same, except for a picklist field "Which_Product_Service__c" and more importantly Office__c which is a lookup field. Accounts also have a lookup to office if this helps?

This is what the extension looks like:

public class extDestinySurvey
{
    public Destiny_Survey__c Dess {get;set;}

    private Id AccountId
    {
        get
        {
            if ( AccountId == null )
            {
                String acctParam = ApexPages.currentPage().getParameters().get( 'acct' );
                try
                {
                    if ( !String.isBlank( acctParam ) ) AccountId = Id.valueOf( acctParam );
                }
                catch ( Exception e ) {}
            }
            return AccountId;
        }
        private set;
    }
 

    public extDestinySurvey(ApexPages.StandardController controller)
    {
        Dess = (Destiny_Survey__c)controller.getRecord();
    }

    public PageReference saveDestinySurvey()
    {
        Dess.Account__c = AccountId;
        upsert Dess;

        // Send the user to the detail page for the new account.
        return new PageReference('/apex/Destiny_Survey_Thank_You');
    }
}


This is my ATTEMPT at a method which will do the same for the office__c field.
private Id OfficeId
    {
        get
        {
            if ( OfficeId == null )
            {
                String OffIdParam = ApexPages.currentPage().getParameters().get( 'OffId' );
                try
                {
                    if ( !String.isBlank( OffIdParam ) ) OfficeId = Id.valueOf( OffIdParam );
                }
                catch ( Exception e ) {}
            }
            return OfficeId;
        }
        private set;
    }

Please help, any advice or ehlp would be much appreciated
Hi guys,
I'm a newbie force.com developer: I'm triyng to implement a VF page using URL function passing parameter based on the selected record from a list in the previous VF page, but I have a problem with the autopopulating of a lookup field: can anyone help me, please?

This is the code for my VF page: 


<apex:page controller="Sebi_ControllerSelezionaMacchina">

  <apex:outputLabel value="{!exec_message}" id="msg"/>
<apex:pageBlock >

<apex:PageBlockTable value="{!ListaCar}" var="c" columns="3">
   <apex:column value="{!c.Name}"/>
   <apex:column value="{!c.AvailabilityLights__c}"/>
   <apex:column value="{!c.RatingCar__c}"/>
   <apex:column >
       <apex:form >
         
             <apex:commandButton value="Select" action="{!URLFOR($Action.Journey__c.New,null
,['Car_Select' = '{!$c.Id}' ])}" />


<!-- 'lookupRecordId'= '{!currName.Id}'  ['lookupFieldId'=value]  ['Car_Select__c' = '{!c.Id}' ] -->

          
       </apex:form>
   </apex:column>   
</apex:PageBlockTable>
</apex:pageBlock>

</apex:page>

Hi,

A user is running a class in without sharing context and still the user is not able to insert AccountShare object record through  apex code. When i searched online , I found that a user should have modify all data permission to insert the AccountShare record.

But when there is another custom object to which the user has absolutely no access , he is able to insert the record through apex code.

Is this a salesforce bug or what?How can i overcome this.

Any ideas are much appreciated.

Regards,
Ankit 
Hi,

I have a scenario whenever a person goes to the Home Tab,he is taken to a Disclaimer Page and whenever he/she accepts the terms,a new section is rendered of the same VF page which has a standard controller and apex tags like inputfield which have a default value set at the field level.But I am not able to get the default values as soon as I hit Accept Terms and conditions button.

But if I have two different VF Pages,this works very fine and I am able to get the default values.
Any inputs are highly appreciated.

Regards,
Ankit Gupta
SFDC Developer



Can anyone recommend a Bootstrap based Datepicker which works with Visualforce ?

I have tried my hand at a few options but none of them seem to work properly!

 

 

  • November 28, 2013
  • Like
  • 0

Hello, I'm trying to finalize a trigger to update. I am receiving an error on foreign key invalid relationships.

 

- Implementation_Site__c is child to Grant__c

- Country__c field is on Implementation_Site__c

- Countries__c is on Grant__c  - this is the field that needs to be populated with infinite number of Country__c values coming from child records. 

 

Current code:

 

//This Trigger will fire after insert, update, delete and undelete
trigger trgConCatCountries on Implementation_Site__c (after insert, after update, after delete, after undelete) {

//If the event is insert or undelete, this list takes New Values or else it takes old values
List<Implementation_Site__c> ProjStrategyList = (Trigger.isInsert|| Trigger.isUnDelete) ? Trigger.new : Trigger.old;

//to store Project Ids
List<Id> ProjectIds = new List<Id>();

//Loop through the Records to store the project Id values from the Implementation Site
for (Implementation_Site__c proj_Strat : ProjStrategyList) {
ProjectIds.add(proj_Strat.Grant__c);
}

//Sub-query to get the projects and all its Child Records where Id is equal to the Ids stored in ProjectIds
//Implementation_Sites__r is the Child Relationship name appended by '__r' as it is a custom object

List<Grant__c> ProjectList = [
select
id,
(select id,Name, Grant__r.Name, Country__c, District_State__c from Implementation_Sites__r),
Grant__c
from
Grant__c
where
id in :ProjectIds];
//Loop through the List and store the Child Records as a String of values in Long Text Area Field i.e Countries__c

for (Grant__c proj : ProjectList) {

if(proj.Implementation_Sites__r.size() > 0)
{
proj.Countries__c = string.valueOf(proj.Implementation_Sites__r[0].Country__c);

for(integer i=1;i < proj.Implementation_Sites__r.size();i++)
{
proj.Countries__c = proj.Countries__c + '; ' + string.valueOf(proj.Implementation_Sites__r[i].Country__c);
}
}
else
proj.Countries__c = null;

}

//update the List
update ProjectList;


}

 

 

Help! Thanks!

 

  • August 09, 2013
  • Like
  • 1

I'm having some issues getting the values in my var attribute when using apex:column and apex:outputText.

 

Say I have the following pageBlockTable:

<apex:pageBlockTable value="{!charges}" var="a" id="adjustment_charges">
  <apex:column headerValue="Amend Action" value="{!a.Local_Price__c}" />
  <apex:column headervalue="test">
    <apex:outputText >
       <apex:param value="{!a.Local_Price__c}"/>
     </apex:outputText>
                    
   </apex:column>
</apex:pageBlockTable>

 For me, the first column prints out the local price, while the second "test" column prints out blank

 

Any ideas what I am doing wrong?

Hi all,

 

Diff between with sharing and with out sharing keyword?what is  default sharing while writing apex class?

 

Public class accclass{ }---this class  with sharing or with out sharing?

 

 

 

 

Thanks,

 

vicky 

 

Hi all,

 

I need to make a call out to an external web service from Salesforce. The administrator of the server has sent me a certificate for https communications.

 

How can I upload this certificate into Salesforce? I read something about generating a CA-signed certificate from Salesforce but, my question is, cant I just upload the certificate I got directly into Salesforce?

 

Thanks a lot. Regards,

 

Antonio

For an application that I'm building I'm trying to incorporate the Twitter Bootstrap CSS libraries, but there are a couple instances of this causing conflicts with the default Visualforce CSS. The most obvious instance is when trying to use a button other than the default, e.g.

 

<apex:button value="Click Me" styleClass="btn btn-primary"/>

This results in a button that's somewhere between Visualforce's default and the intended final result.

 

I know that the standard stylesheets can be turned off entirely, but I don't want to remove the header in order to do it.

 

One solution I can think of is to try and tell Visualforce that the Bootstrap libraries should have a higher priority, but I'm not sure how to do it, if it's even possible.

 

Any help would be appreciated.