• sandeep@Salesforce
  • PRO
  • 2649 Points
  • Member since 2011
  • Project Leader
  • Rsystems International


  • Chatter
    Feed
  • 66
    Best Answers
  • 5
    Likes Received
  • 5
    Likes Given
  • 44
    Questions
  • 1003
    Replies
<td>
                                <ui:inputcheckbox updateOn="change" change="{!c.SaveChanges}" text="{!item.Id}" value="{!item.CSopke1__Complete__c}"/>
                            </td>
                            <td>
                                <ui:inputDate  updateOn="change" change="{!c.searchChange}" value="{!item.CSopke1__Date__c}" displayDatePicker="true" />
                            </td>
                            <td>
                                <ui:inputText updateOn="change" change="{!c.searchChange}" value="{!item.CSopke1__Notes__c}"/>
                            </td>
Helper.js
SaveChanegHelper: function (cmp, event, helper) {
        var action = cmp.get('c.updateProcess');
        var processId = event.getSource().get("v.text");
        var iscompleted = event.getSource().get('v.value');
        var FieldLabel = ???
how I can get to know which field was changed so that I need to pass this fieldApi to further Apex controller toupdate record accordingly.
 
Actually using streaming api to display the changes on another user deatils page using Visual page.

Is it possible to display the changes or something using streaming API in home page or somewhere(if the user using or accessing the someother page in org).
 
Please help to achive my query. It would be greatly appreciated.


 
Hi all! I'm really new to apex code, trying to figure out how to get related records from Account. Any help is appreciated!

VF page:
<apex:page Controller="UseofRepeatOnEpudsController">
<apex:form >
    <apex:pageBlock title="Accounts with assoicated Contacts">
        <apex:repeat value="{!epudsList }" var="epd">
            <apex:pageBlockSection title="{!epd.name} - {!epd.Account1__r.Name}">
                <apex:pageBlockTable value="{!epudsList}" var="epd2">
                    <apex:column value="{!epd2.Absorbent_drum_1__c}"/>
                </apex:pageBlockTable>
            </apex:pageBlockSection>
        </apex:repeat>
    </apex:pageBlock>
    </apex:form>
</apex:page>

Controller:
public class UseofRepeatOnEpudsController {
    public List<Logistic__c> epudsList{get;set;}
    public List<Account> AccountList{get;set;}
    public Id accId{get;set;}
    
    public UseofRepeatOnEpudsController() {
        accId = ApexPages.CurrentPage().getparameters().get('Id');
        epudsList = new List<Logistic__c>();
        epudsList = [SELECT id, Name ,  Account1__R.Name, Absorbent_drum_1__c From Logistic__c where Account1__c =:accId] ;
        accountList = [SELECT id, Name From Account];
    }

​Result:
I can't select VF page when setting up a button. My guess is that I need to use Standard controller="Account" and extention (My controller). I'm not sure how to set it correctly. Getting errors.

Also, epudsList is showing related custom object names which is fine, but PageBlockTable will show records not per custom object reocord - but all custom object records together.

So basically I'd like to press button on account and get related records separated. Accoont - > List of custom object records -> (Values related to one record)

Now its showing like: Account -> List of custom object records -> (Values related to multiple records) which is wrong.

Thanks for helping me out!
I created the following class that updates the Websites field after a new website is added. It basically normalises it by removing 'http://', 'https://', and 'www'.

Here's the class:
 
trigger standardiseWebsitesTrigger on Account (after insert, after update ) {
    if(checkRecursive.runOnce()){
        
        Set<Id> AccIds = new Set<Id>();
        
        List<Account> acctsToUpdate = new List<Account>{};
            
            
            for (Account acc : Trigger.new){
                AccIds.add(acc.Id);
            }
        
        List<Account> accounts = [SELECT Id, Website FROM Account WHERE Id IN :AccIds];
        
        for (Account acc : accounts){
            string website = acc.Website;
            string hostDomain1 = 'http://';
            string hostDomain2 = 'https://';
            string justWWWAddress = 'www';       
            
            if (acc.Website.startsWith(hostDomain1) || acc.Website.startsWith(hostDomain2) && acctsToUpdate.isEmpty()){
                Url u = new Url(acc.Website);
                website = u.GetHost();
                acc.Website = u.getHost().replaceFirst('^(https?://www\\.|https?://|www\\.)','');
                acctsToUpdate.add(acc);
                
            }
            
            if(acc.Website.startsWith(justWWWAddress) && acctsToUpdate.isEmpty()){
                acc.website = website.substring(4);
                acctsToUpdate.add(acc);
                
            }
            
            update acctsToUpdate; 
            
        }
    }
    
    }

However when using the following test the assertion relating to removing the 'www.' component fails:
   
@isTest
    public class standardiseWebsitesTriggerTest {

    static testmethod void standardiseWebsiteTriggerHTTP() {
        testSetup('HTTP', 'http://I_AM_HTTP', true);
    }

    static testmethod void standardiseWebsitesTriggerWWW() {
        testSetup('WWW', 'WWW.I_AM_WWW', false);
    }

    public static void testSetup(String accName, String accWebsite, Boolean webProtocol) {
        Account acc = new Account(
            Name = accName,
            Website = accWebsite
        );
        insert acc;

        Account updatedAccount = [select Website from Account where id = :acc.Id];
        
        if(webProtocol) {
            Url u = new Url(acc.Website);
            System.assert(u.getHost() == updatedAccount.Website);
        } else {
            System.assert(updatedAccount.Website == acc.Website.substring(4));
        }
    }
    }

The error is:
 
>    Assertion failed
Class.standardiseWebsitesTriggerTest.testSetup: line 25, column 1
Class.standardiseWebsitesTriggerTest.standardiseWebsitesTriggerWWW: line 9, column 1

Any idea as to why this test may be failing?




 
Hello,

When i was deploying apex class with the profile i get below error on on of the profile "XYZ" like below:
Unknown user permission: LightningConsoleAllowedForUser
thanks for suggestion !
 

I have two record types  A and B on case object

Now I want to display cases on related list of account page in the form of  two pageblock tables
1st pageblock table should be cases with record type A
2nd pageblock table should be  cases with record type B

 
Hi Friends,
I read in apex developer guide we can't deploy the email service address name. Can  any one help me how we deploy the email service address name?
Thank you
Hi. I am trying to use actionPoller to fetch data updated through a @future call (just the field being updated asyncronously, Future_Date__c), but it seems that the data in the StandardController is stuck in the original value, even though the fetch date is changed. Do you know how to trigger the standard controller to get the new data and refresh that part of the view?
<apex:page standardController="Case" cache="false" >
    <apex:pageBlock >
        <apex:pageBlockSection >
            <apex:outputPanel id="blockToRerender" >
                <apex:form >
                    <apex:outputLabel value="Future Date: " />
                    <apex:actionStatus id="counterStatus" startText="Fetching…" stopText="Done!" rendered="{!ISBLANK(Case.Future_Date__c)}" />
                    <apex:outputText value="{!Case.Future_Date__c}" />
                    <br/><br/>
                    <apex:outputLabel value="Fetch Date: " />
                    <apex:outputText value="{!Now()}" />
                    <apex:actionPoller oncomplete="refreshJS();" interval="5" status="counterStatus" enabled="{!ISBLANK(Case.Future_Date__c)}" />
                    <apex:actionFunction name="refreshJS" reRender="blockToRerender" /> 
                </apex:form>
            </apex:outputPanel>
        </apex:pageBlockSection>
    </apex:pageBlock>
</apex:page>

 
Hello,

I'm very new to apex coding. I was informed that the proper way of creating trigger is to create a trigger then call apex class methods. Is that right?

I tried it on my end with a very simple trigger but I can't make it work.
Basically, what I want is that when I create Account, it will automatically create a Contact under the Account with Account is equal to Account id and contact last name is equal to account last name.

Attached is my trigger and class.

apex trigger 

Class
User-added image

Thank you
Marion
Hi All,

I am currently putting together an Apex script that would normalise all of the website addresses in our database by extracting the host addres and eliminating 'http', 'www' etc from the domain address. For this I am using a for loop. The problem that I am experiencing is that once the code runs (and it runs without errors and the debug produces the desired outcome) the website addresses don't get updated.

Here's the script so far:
public class Standardise_Websites {
    public Standardise_Websites(){
        list<Account> accts = [SELECT Website FROM Account];
               
        for (Account acct : accts){
            string website = acct.website;
            System.debug('Website is ---------->' +website);  
            website = website.replace('http://www.','');
            website = website.replace('https://www.','');
            website = website.replace('https://','');
            website = website.replace('http://','');
            website = website.replace('www.','');
            System.debug('Final website is ---------->' +website); 
            update acct;
            
        }
    update accts;
    }
}

               
    
Hi -

I am trying to navigate to a visual force page, while passing parameters through the URL. Here is what it is without javascript, using the Display in existing window without sidebar or header via URL option.
/apex/QuoteRequestDetailsPage?OpportunitySegmentId={!Opportunity_Segment__c.Id}

I'd like to put this into javascript and add criteria on WHEN we allow people to navigate to this visual force page.

Here's my best try but i'm getting an error:

string url = "/apex/RFPDetailsPage?OpportunitySegmentId="+{!Opportunity_Segment__c.Id}+"&
OpportunityId="+{!Opportunity_Segment__c.Opportunity_ID__c};

window.location.href=url;

 
Hi there!

I've been locked out of another Dev org of which I am the sole administrator. My org ID is 00D46000000YtOt and my username is jstone@visualantidote.com. If I can verify my identity, could I be granted access once again, please?
I have a process that based on checkboxes on the Account object when the Account is created, it will create a child account for the Parent account being created.  This will usually be done during the lead conversion process where the Account gets created and based on the checkboxes selected on the lead the approprate Child Accounts will be created.  Now here is my question.....When the lead conversion is successful and the opportunity is created for the parent account, I would like a trigger to based on the two check boxes on the Parent account (Anywhere or Complete) to create an Opportunity using the same field data from the opp created by the lead conversion for each child account created with a small tweak to the name field and re-pointing the Account ID on the new child opps to point to thier correct Child account again base don the proper checkbox selected and the trigger process.   Can this happen?   If so, can you give me a head start as I woudl like to get this automated and I know we can do this, but I have no idea. 

Please be my saving hero!!!!

Thanks in advance,

Shawn
Hi,

I want to call a Lightning Component event from a Visualforce page in a Community.

I've tried in this way
 
<div id="lightning" style=""></div>

<script>
$Lightning.use("c:TheApp", function() {
	$Lightning.createComponent("c:TheComponent", {},
		"lightning",
		function(cmp) {
			createdCmp = cmp;
			var myExternalEvent;
			myExternalEvent = $A.get("e.c:TheEvent");
			myExternalEvent.setParams({
				"p": 'p',
			});
		myExternalEvent.fire();
	});
});
</script>
It's working but it is not what I exactly want, because in this way the compnent is inserted in the page a runtime.

Is there a way to call the event without inserting the component a runtime, but inserting it in the page with the community builder ?

Thanks in advance.
Hi,
Is there a way I can change the VF page title with the value of item selected in the Lightning component included in the page? 

There is a dropdown in the lightning component and the selected value of the lightning dropdown menu must be reflected in the VF page title.

Thanks in advance,
Binaayo
I'm unable to get data in Kanban view on my custom objects. I  get the Kanban setting window and on save the same setting window reappears. How can I address this issue?

Hello,

InlineEditing allows us to show and hide buttons during and after editing inline.  However buttons I want hidden by default are displayed.

 

For instance, I have several buttons I want to show by default and hide when editing, plus a Save and Cancel button that I want hidden unless told to display by inline editing.  But when the page loads all of these buttons are displayed.  How am I supposed to make Save and Cancel hidden on page load, surely I dont have to use JS or CSS for that, it must be part of the inline editing capability surely?!

 

 

MORE INFO: Im not using a standard controller everything in the page is handled in a class.  Clicking the Save button (which calls a save method which updates the database, as you'd expect) doesnt save any changes made in inline editing.

I'm starting to think that inline editing will only work with a Standard Controller...

Hi,
in the Winter'09 release notes it says "Custom labels are custom text values, up to 1,000 characters in length, that can be accessed from Apex classes or Visualforce pages".
I could easily find how to access these labels from a visualforce page, but nowhere I can find how to access them from an apex class.
I need this because I have a class that dynamically generates labels for a certain table in a vf page. But I want to use Custom Labels (and the translation workbench) to get these translated in various languages.
Is there an object, something like Label with a static function like 'getLabel(String)'? Or is this not released in Winter '09?