• Deepak Tumkur Shivanandaiah
  • NEWBIE
  • 4 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 3
    Questions
  • 2
    Replies
Hey,
Here is the requirement.. Its big bear with me..

This is for a food delivery app which is coded with salesforce in the back. The user of the app can select when they want their food delivered, like a specific date or a day. But I want to restrict them in choosing dates like on christmas or some other internal function. 
Basically the client wants to select a date when they do want to deliver food and it should be disabled in the app so that the user cannot not select it. Also for now they dont want to deliver on weekends, but they want to have the option to enable delivery on weekends after some time.

In a nut shell, They want to select multiple dates when they dont want to deliver also days they dont want to deliver.
I have been banging my head on how to do this in salesforce.

Got a few ideas like creatind a text field and tell clients to enter dates in a perticuler way and parse it as json and send it to the front end developer.

But this is not a good way to deliver to our client. And we cannot put a calender like we used to do in java.

Please help me out. This is URGENT!!
Thanks in Advance.
Hey,
Here is the requirement.
Basically I have to add a button to the Contact related list in the Account Layout. When that button is clicked it sould redirect to a Visualforce Page with all the related Contacts and the contact details for that Account and the details should be editable with a save button.
Its basically Mass Update for Related List Details.
I was able to get all related contacts and give inline edit support for them and wrote a save function for the same. I don't know what is wrong but you can edit but when you click save it wont save to salesforce DB.

Here is the controller,
public class stanset_EX_Controller1{
    
    private final Contact setCon;
    
    public stanset_EX_Controller1(ApexPages.StandardSetController controller)
    {
        this.setCon = (Contact) controller.getRecord();
    }

    List<Contact> Conts;

    public List<Contact> getConts(){
        return Conts;
    }

    public ApexPages.StandardSetController  doSomething{
    get {
        // do something with the selected records
        doSomething = new ApexPages.StandardSetController(
                        Database.getQueryLocator([
                                SELECT  Phone,
                                        Name,
                                        AccountId,
                                        Email,
                                        FirstName,
                                        Id,
                                        LastName,
                                        Title
                                FROM Contact
                                WHERE AccountId
                                        = :ApexPages.currentPage().getParameters().get('id')


                        ]));
     return doSomething;
 }
 private set;
}

 public List<Contact> getAccountContactsPagination() {
        //system.debug(doSomething.getRecords()+'ppp');
        return (List<Contact>) doSomething.getRecords();  
}
public PageReference save() {
        system.debug(getAccountContactsPagination());
        //update(getAccountContactsPagination());
        PageReference pageRef = ApexPages.currentPage();
        pageRef.setRedirect(true);
        return pageRef;

    }


   
    
}

Here is the Visualforce page,
 
<apex:page
  standardController="Contact"
  recordSetVar="contacts"
  extensions="stanset_EX_Controller1" showHeader="true" sidebar="false">
  <apex:form >
     <apex:pageBlock >
       <apex:pageBlockTable value="{!accountContactsPagination}" var="contact">
         <apex:column value="{!contact.name}"/>
         <apex:column value="{!contact.FirstName}"/>
         <apex:column value="{!contact.LastName}"/>
         <apex:column value="{!contact.Title}"/>
         <apex:column value="{!contact.Id}"/>
         <apex:column>
         <apex:outputField value=" {!contact.Email}">
         	<apex:inlineEditSupport disabled="false"/>
         </apex:outputField>
     	 </apex:column>
         <apex:column value="{!contact.Phone}"/>
         <apex:inlineEditSupport />
       </apex:pageBlockTable>
       <apex:pageBlockButtons location="bottom">
         <!-- <apex:commandButton value="Do Something" action="{!doSomething}"/> -->
         <apex:commandButton value="Save" action="{!save}" />
       </apex:pageBlockButtons>
     </apex:pageBlock>
  </apex:form>
</apex:page>
Tried many things dont know what is wrong with the code.
HELP!! Thanks In Advance! Cheers!
I have imported all the contacts given in the download exel. I even deleted all the previous exsisting contacts and accounts before import.
I made seperate csv files for Accounts, Contacts, Hobbies, Opportunities and ContactHobbies and used Dataloader.io to import.
All was imported without any probelm.
 
After import I tired to check challenge and I am getting some wierd error.
It says,
"Challenge Not yet complete... here's what's wrong: 
Whoops! We found at least one contact with a mailing state that is longer than two characters."

I queried all the contacts but no contact has mailing state longer than characters. (Cause no contact has even a single State, I didnt even map it while importing as it was not required or not important)   

User-added image

Been trying to do this for almost 2 days. Dont't know what this is.
Any input on this matter would be really usefull.
Thanks in advance.
Hey,
Here is the requirement.
Basically I have to add a button to the Contact related list in the Account Layout. When that button is clicked it sould redirect to a Visualforce Page with all the related Contacts and the contact details for that Account and the details should be editable with a save button.
Its basically Mass Update for Related List Details.
I was able to get all related contacts and give inline edit support for them and wrote a save function for the same. I don't know what is wrong but you can edit but when you click save it wont save to salesforce DB.

Here is the controller,
public class stanset_EX_Controller1{
    
    private final Contact setCon;
    
    public stanset_EX_Controller1(ApexPages.StandardSetController controller)
    {
        this.setCon = (Contact) controller.getRecord();
    }

    List<Contact> Conts;

    public List<Contact> getConts(){
        return Conts;
    }

    public ApexPages.StandardSetController  doSomething{
    get {
        // do something with the selected records
        doSomething = new ApexPages.StandardSetController(
                        Database.getQueryLocator([
                                SELECT  Phone,
                                        Name,
                                        AccountId,
                                        Email,
                                        FirstName,
                                        Id,
                                        LastName,
                                        Title
                                FROM Contact
                                WHERE AccountId
                                        = :ApexPages.currentPage().getParameters().get('id')


                        ]));
     return doSomething;
 }
 private set;
}

 public List<Contact> getAccountContactsPagination() {
        //system.debug(doSomething.getRecords()+'ppp');
        return (List<Contact>) doSomething.getRecords();  
}
public PageReference save() {
        system.debug(getAccountContactsPagination());
        //update(getAccountContactsPagination());
        PageReference pageRef = ApexPages.currentPage();
        pageRef.setRedirect(true);
        return pageRef;

    }


   
    
}

Here is the Visualforce page,
 
<apex:page
  standardController="Contact"
  recordSetVar="contacts"
  extensions="stanset_EX_Controller1" showHeader="true" sidebar="false">
  <apex:form >
     <apex:pageBlock >
       <apex:pageBlockTable value="{!accountContactsPagination}" var="contact">
         <apex:column value="{!contact.name}"/>
         <apex:column value="{!contact.FirstName}"/>
         <apex:column value="{!contact.LastName}"/>
         <apex:column value="{!contact.Title}"/>
         <apex:column value="{!contact.Id}"/>
         <apex:column>
         <apex:outputField value=" {!contact.Email}">
         	<apex:inlineEditSupport disabled="false"/>
         </apex:outputField>
     	 </apex:column>
         <apex:column value="{!contact.Phone}"/>
         <apex:inlineEditSupport />
       </apex:pageBlockTable>
       <apex:pageBlockButtons location="bottom">
         <!-- <apex:commandButton value="Do Something" action="{!doSomething}"/> -->
         <apex:commandButton value="Save" action="{!save}" />
       </apex:pageBlockButtons>
     </apex:pageBlock>
  </apex:form>
</apex:page>
Tried many things dont know what is wrong with the code.
HELP!! Thanks In Advance! Cheers!
Hi,

i am getting below error while completing "Lightning Experience Rollout Specialist Superbadge Step #8"
Challenge Not yet complete... here's what's wrong:
Knowledge must be enabled for the org.
.User-added image


i have alredy enabled knowledge settings..

User-added image

Thank you.