• Gobbledigook
  • NEWBIE
  • 250 Points
  • Member since 2010

  • Chatter
    Feed
  • 10
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 37
    Questions
  • 39
    Replies

Hey all,

 

I'm trying to write a trigger that takes the current user's profile id and assign a recordtype automatically depending on the profile, for data filtering processes in the future, but I was wondering how the UserInfo would actually run during a bulk fire.  Who would be the Current User in a bulk trigger?  Since triggers fire in bulk of 200 each, and since the UserInfo would take the current User, and since the trigger itself can fired by multiple Users, what would happen to the getProfileId() method itself? Would it even fill?  

 

I can't really test this since I don't have multiple Users trying to fire the trigger in bulk, hence me coming to the boards.

We have a field on the Account level called "Monthly Fee".  I'd like to create a new field on the parent level so we can see a roll-up summary of the children accounts.  Please help me with writing the trigger! 

Hi,

 

We have a WSDL file which has import from xml schema files.As import  in WSDL file is not supported by salesforce,

can anyone please suggest the way to overcome this issue.

 

 

 

 

Thanks,

Srilakshmi B

Pretty trivial question (maybe)

 

Is there any way to default apex:selectradio, apex:selectlist, apex:selectcheckboxes to be auto selected upon creation?

 

I'm writing a visualforce page to change a Contact from an associated Account to one of the user's choosing, using apex:selectRadio.

 

I want the previous contact to be defaulted selected.  Right now none of them are. 

 

Any ideas?

I am trying to pass a record ID via URL for a VisualForce page and continually receive a URL No Longer Exists error. Any ideas on what I am doing wrong or is URL not properly referenced? See URL below. 

 

The VF page is based on a standardController for a custom object. I plan on extending the standardController but can't even get the basics to work. Any ideas would be much appreciated. Thanks. 

 

https://c.na7.visual.force.com/apex/ReviewData/?id=a0gA0000002BBZa

Hi everybody,
I am trying to populate selectlist options through onload javascript function, but some how this is not working. I have pasted the code below that iam working on, could any body please suggest any changes to make it working.
<apex:page >
<script> window.onload = list1;
function list1()
{
var list=document.getElementById('listchosen');
for(var i=0;i<10;i++)
list.add(new Option('xxx','xxx'));
}
</script>
<apex:outputPanel id="result"> <apex:form >
<b>Please select :</b>
<apex:selectList id="listchosen" multiselect="false" size="1"> </apex:selectList>
</apex:form>
</apex:outputPanel>
</apex:page>

 

Hey all,

 

Just a simple question:  Are triggers executed when lookup fields change from an outside source?

 

I have a Custom Object that references a Contact as a Lookup.  If I change that contact (thus changing the lookup) will that cause an update trigger to fire on that Custom Object?  Or, since the Lookup is a reference to the Contact, and the reference does not change (only the value that is being referenced does) would it not fire?

I was correcting some mistakes when I began to receive this error on something that previously worked and I'm not sure why it's not working now. I've narrowed it down to this section of code:

 

 

List<Contract_Line_Item__c> current_cls=[select Id, hasCPI__c, Name, Product__c, Net_Price__c, Quantity__c, Maintenance_Amount__c, isCheckbox__c from Contract_Line_Item__c where Contract__c=:current.Id];
    
    List<Contract_Line_Item__c> cls=new  List<Contract_Line_Item__c>();
   
    boolean cpiX;
    for(Contract_Line_Item__c cli:current_cls){
     if(cli.Maintenance_Amount__c > 0)
     {	
     	
     	cpiX=false;
     	Contract_Line_Item__c cl = cli.clone(false, true);
     	Contract_Line_Item__c cpi = cli.clone(false, true);
     	cl.Net_Price__c=0;
     	cl.Services_Amount__c=0;
     	if(!cli.isCheckbox__c)
     	{
     	cpi.Net_Price__c=0;
     	cl.Contract__c=c.Id;
     	cl.Net_Price__c=0;
     	if(current.CIPIX_Increase__c=='Yes' && current.CPI_Increase_Percent__c!=null){
      		if(cli.hasCPI__c)
      			cl.Maintenance_Amount__c*=1+(current.CPI_Increase_Percent__c/100);
     		cl.hasCpi__c=true;
     		cpi.hasCPI__c=true;
     		cpi.Contract__c=c.Id;
     		cpi.Maintenance_Amount__c=cl.Maintenance_Amount__c*(current.CPI_Increase_Percent__c/100);
     		cpi.Name=cli.Name;
     		cpi.isCheckbox__c=true;
     		cpiX=true;
     		}
     	cls.add(cl);
     	if(cpiX)
     		cls.add(cpi);
     	
     	a=new Asset();
     	a.AccountId = c.AccountId;
  	    a.Product2Id=cli.Product__c;
   	    a.Name=cli.Name + ' - Asset';
 	    a.ContactId=Cont;
 	    if(c.startDate!=null){
 	    a.installDate=c.StartDate;
 	    date enddate=c.StartDate.addMonths(12).addDays(-1);
 	    a.UsageEndDate=enddate;
 	    }
 	    
 	    insert a;}
 	    else{
 	    	delete cli;}
     	
	  }
    }
   
    insert cls;

 

And when I comment out the "If.isCheckBox__c) sections, I get a 'de-referencing a null object error'. Any advice?

 

Hello.  Does anyone know if it is possible via Visualforce code to substitute a lookup with a picklist?

 

We all know that, by default, salesforce.com creates a lookup situation when associating the master record values on a child record.

 

Well, I am trying to figure out if Visualforce code will allow me to present things a little differently for my users.

Is this possible?  Does anyone have any suggestions?

 

Thanks in advance.

Hey all,

 

Is there some sort of guide (non Visualforce) for mobile development?  As in figuring out how to override standard mobile functionality as one would in Salesforce?

 

There are a few things I want to do using the mobile app, but I'm having a very difficult time customizing it, since there doesn't seem to be a standard override.

 

For instance, I have multiple visualforce pages overriding a Custom Object.  They all work great in salesforce, but when I put the Custom Object as part of the mobile app, these pages are no longer overridden.  (On iPhone iOS 4.2, clicking the + icon next to a new Custom Object (instantiating Object.new) takes me to the standard 1 column display, unlike the Visualforce page that overrides it. 

 

Is there an API or developer's guide out there that I could get my hands on?  (Does one even exist??)

I have a custom list button that invokes a VF page.  This bascially allows user to start something from an object's Activity History related list.  I wonder how I can deploy it properly.  There isn't anything to select for List Buttons in either IDE or SFMT tools.  I don't want to deploy the whole Task object.  I tried just deploying the layout using the button.  The button did seem to cross over, but its URL all screwed up.  I did see "Buttons and Links" in Change Set, but that's a less preferrable approach since it's a beta feature and less automatable.  Any suggestions?

I have a command button, and when I try and use it in the visualforce page I am not able to reterive the paramter from the page, it returns null

 

Here is the visualforce code

 

 

<apex:page standardController="Account" extensions="Controller_DupeChecker">
<apex:form >
<apex:dataTable value="{!DupeAccounts}" var="das" width="100%" border="1px" style="text-align:center">
<apex:column headerValue="Account Names" value="{!das.Name}"/>
<apex:column headerValue="Phone" value="{!das.Phone}"/>
<apex:column headerValue="Shipping Street" value="{!das.ShippingStreet}"/>
<apex:column headerValue="Billing Street" value="{!das.BillingStreet}"/>
<apex:column >
<apex:commandButton action="{!MergeAccounts}" value="Merge" id="theButton">
<apex:param name="acid" value="{!das.id}"/>
</apex:commandButton>
</apex:column>
<apex:column >{!das.id}</apex:column>
</apex:dataTable>

</apex:form>
</apex:page>

 

 

 

 

And here is the apex class

 

	public PageReference MergeAccounts(){
	// aid is not passing a value 	
	Id aid = System.currentPageReference().getParameters().get('acid');
	
	List<Account> mergeAccounts = new List<Account>();
	system.debug('aid: '  + aid);
	
	Account mergeAccount = ([select Id FROM Account WHERE Id =:aid]);
	//merge function doesn't bring over fields
	merge acc mergeAccount;
	return null;
	}

 

 

Please help!

 

Hey all,

 

Recently I posted a problem about manipulating the URL to auto-fill fields without using Visualforce.  The answer turned out to be that to do this, I would need to hard code in the Id values of the fields and then just throw what I wanted in there. 

 

 

/a0F/e?CF00NA0000004riGC_lkid={!Open_Quotes__c.AccountId__c}&CF00NA0000004riGC={!Open_Quotes__c.Account__c}&00NA0000004rmIC={!LEFT(Open_Quotes__c.ERPID__c, (LEN(Open_Quotes__c.ERPID__c) - 3))}&00NA0000004rmFn={!RIGHT(Open_Quotes__c.ERPID__c, 2)}

 

Ok so we got that working, but now I'm sending this to a Visualforce page that mimics standard functionality, and the <label for> Ids are now: j_id0:theForm:thePageBlock:j_id15:j_id17.  So as you may well surmise, it's no longer working.  So I tried to put it the new values into the formula, and it still doesn't work. 

 

Any ideas?

 

Hey all,

 

I'm trying to pass values to a Visualforce Page from another VF page, and when I get to that page, it will automatically assign values of Custom Fields to what is being passed in by System.GetParameters(), and then Automatically call a save, so that the User will only see a pageview, and not the edit functionality. 

 

So to make a bit more simple:

1. User Saves a Record.

2. Parameters get passed into another VF page (by clicking a button) that carries a reference that the first Record needs. 

3. User does some cool stuff on the other page, modifying the reference and sends it back to the first page using a button.

4. Page.edit() opens and automatically dereferences the system.getParameters() and assigns them to values on the page.

5. The system saves the page and goes to Page.view(), firing custom workflow, without any User input.

 

Any ideas?

 

So far this is what I have:

 

 

First Page Controller: 

ublic FirstPage(ApexPages.StandardController stdcontroller) 
    { 
        this.C = (Custom_Object__c)stdController.getRecord(); 
        if(system.CurrentPageReference().getParameters().get('Email') == '1')
        {
            PageReference Test = SaveView();
        }
    }

 

 

So in the controller I look for a field called 'Email' and if it's equal to '1', then call:

 

public PageReference SaveView()
    {
        
        update C;
        PageReference GoBack = new ApexPages.StandardController(C).view();
        GoBack.setRedirect(true);
        return GoBack;
    }

 

 

And on my second page (along with some other data) when I click a button:

 

 

public PageReference SaveAndEmail()
    {
        this.AddCallAttendee();
        Custom_Object__c C = new Custom_Object__c(Id = CA.Call_Report__c);
        PageReference GoBack = new ApexPages.StandardController(C).edit();
        GoBack.getParameters().put('Email','1');
        GoBack.setRedirect(true);
        return GoBack;
    }    
    

 

Since Edit is overridden by the first page, it will keep the values that are saved within the Call Report and pass in EMail = '1'.  When I check the page, it's there, but it doesn't either call SaveView(), or doesn't reference the Email itself.

 

Note: This does Compile and Save, the errors in the code above are the result of my failure to know how to copy and paste.

 

Hi Guys,

          

                    I need to display lookup fields in a Table of VF page. I am getitng Id Instead of Name..Can Anyone Help me on this.

 

Appriciate your help..

Thank You.

Raghu

Ok, so for some reason my Messages aren't being displayed, even though I (Seem to) have everything all set up.

 

VF page setting up the messages:

 

 

<apex:messages rendered="true" style="color:Red;"/>

 

 

Apex Code calling and creating a message:

 

 

 ApexPages.addMessage(new ApexPages.Message(ApexPages.severity.INFO, 'Call Attendees: ' + CallAttendeeSum + 'uploaded'));
            

 

 

I get no compile errors, no errors of any kind at all, the message just does not display. What gives?

Hello there,

 

I'm currently working with a dynamic selectcheckboxes list in Visualforce, and I need to uncheck the checked boxes through Apex whenever a commandbutton is pressed.  I figure it might have something to do with selectOptions list, but I'm not certain. 

Any ideas or help would be appreciated.

Hey all,

 

I am trying to figure out how to use a command button that will save a Visualforce Page, then open a new Visualforce page passing in Parameters for the new page to use. 

 

I know that I would use a controller extension on the first page and include the standard save component, but what would I do afterwards? This is the code for the commandbutton itself and the parameters to pass to the new page

 

 

<apex:pageBlockButtons >
<Apex:commandbutton value="Save and Add Call Attendee" Action="{!save}"><Apex:param name="Account" value="{!Call_Report__c.Account__c}"/><apex:param name="CallReport" value="{!Call_Report__c.Name}"/></apex:commandbutton>
</apex:pageBlockButtons>

 

 

And this is the save component.  How would I open a new page after the save?  Is it a simple PageReference call to the new VF page? Is there something much more complicated? 

 

 

public PageReference save()
    {
        PageReference CRsave = controller.save();
        //I imagine something else would go here...
        return CRSave;
    }

 

 

 

 

 

 

Hey all, this might be a really simple question or it might not.

 

I have a Custom Record that will have multiple Accounts associated with it.  Is there any way to have that Custom Record show up on all the Accounts' related lists?