• hemant rana
  • NEWBIE
  • 60 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 25
    Questions
  • 24
    Replies
hi i have a requirement where at the end of every month a field is set to 0 by itself.
I think about workflow but in worflow i have to create or edit a record then only workflow will fire.
So, please help.
As a recordlist is inserted through controller through insert command. Everytime a record is inserted in that list a mess should be displayed on vf page like say-----------------


in recordlist there is 3 record-
1) Hemant
2) sumit
3) Vishal

As hemant is inserted on vf it shows 1 record inserted
then when sumit is inserted it shows 2 record inserted
and at last 3 record insreted.................

is their any way plz help
Any how can we get the count of all validation rules and workflows  in salesforce org.
I tried---
private static MetadataService.MetadataPort createService()
    {
        MetadataService.MetadataPort service = new MetadataService.MetadataPort();
        service.SessionHeader = new MetadataService.SessionHeader_element();
        service.SessionHeader.sessionId = UserInfo.getSessionId();
        return service;    
    }
MetadataService.MetadataPort service = createService();
        List<MetadataService.ListMetadataQuery> queries = new List<MetadataService.ListMetadataQuery>();     
        MetadataService.ListMetadataQuery queryWorkflow = new MetadataService.ListMetadataQuery();
        queryWorkflow.type_x = 'Workflow';
        queriesWorkflow.add(queryWorkflow);

But no luck plz help its urgent
I have a requirement in which when a record is created manually say on an object "customObject__c" a record is also cretaed on the "opportunity" object . I have done this by trigger. Now they want to create and also redirect the page to the newly created opportunity record edit page?? is it possible to add some code in trigger as i thought to use page reference but that dosenot seems to work. please help... 

This is my trigger---
trigger TriggerOnEngagementForCreatingNewOportunity on Engagement__c (after insert) {
    set<id> engIds=new set<id>();
    set<string> engIdscontact=new set<string>();
    string urls;
    map<id,id> contactAccount=new map<id,id>();
    map<id,id> engagementcontact=new map<id,id>();
    map<id,id> engagementAccount=new map<id,id>();
    List<Opportunity> comms = new List<Opportunity>();
    list<engagement__c> ab=[select Contact_Name__r.Account.Id,Contact_Name__r.Name from engagement__c where Id=:trigger.new];
    for(engagement__c abc:ab)
    {
      engIds.add(abc.Contact_Name__r.Account.Id) ;
        engIdscontact.add(abc.Contact_Name__r.Name);
    }
     
    for(Engagement__c a : trigger.new)
    {
      
       Opportunity comm = new Opportunity ();
        for(Id ii:engIds)
        {
        comm.AccountId=ii;
        }
        for(String ss: engIdscontact)
        {
        comm.Name=ss;
        }
        comm.Contact__c=a.Contact_Name__c;
        comm.CloseDate=system.today();
       
        comm.StageName='Q4 2015';
        comm.Engagement__c=a.Id;
       comms.add(comm);     
    }
    insert comms;
    for(Opportunity opppp: comms)
    urls='https://cs8.salesforce.com/'+opppp.id+'/e?retURL=%2F'+opppp.id;
    public PageReference redirec()
    {
    system.debug('inside page reference');
    PageReference pageAccount = new PageReference('https://cs8.salesforce.com/006L0000005KSS2/e?retURL=%2F006L0000005KSS2');
    pageAccount.setRedirect(true);
    return pageAccount;
    }
}
Hi can we add new custom buttons in the campaign member view when clicked on add new members... like thisUser-added image
I want to remove the campaign member status picklist. is their any way please help...
PLEASE HELP - I am trying to create a new Opportunity but I keep getting this error message:

Error: Invalid Data. Review all error messages below to correct your data. Apex trigger trg_Opportunity caused an unexpected exception, contact your administrator: trg_Opportunity: execution of BeforeInsert caused by: System.QueryException: Non-selective query against large object type (more than 100000 rows). Consider an indexed filter or contact salesforce.com about custom indexing. Even if a field is indexed a filter might still not be selective when: 1. The filter value includes null (for instance binding with a list that contains null) 2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times): Trigger.trg_Opportunity: line 15, column 1

...I was told that it has to do with an APEX trigger that I have set. I do not know how to go about turning off the APEX trigger or if there is something I can modify to allow the creation of manual Opportunities.

Please Advise.

Jerrad
Hi have made a vf page and a custom button on campaign members. when i click on the cutom button i had given the function of executing javascript.

window.open('https://c.cs8.visual.force.com/apex/Mobiles?id={!Campaign.Id}','','scrollbars=no,menubar=no,height=600,width=800,resizable=yes,toolbar=yes,location=yes,status=yes');

its opening the new window but i want to open it in new tab. Please help
hi i have two fields-
"Days Needed"-- Manual Entry
"Days Remaining"-- Should be a formula field in which when each day passes it subtract 1 from "Days Needed" and populate the value and stop when it is 0.
  let say "Days Needed" field has value-2 and today is 30th . on 31st the value in "Days Remaining" should be-1 and on 1st value on "Days Remaining" should be 0;
<apex:column headerValue="Weekdays" headerClass="clsCenter">
                    {!dayslst.Day}----------------------------------------> CAN WE MAKE ANY STYLE OR CSS TO PUT THIS TEXT IN THE MIDDLE OF COLUMn IN PAGEBLOCK TABLE
                </apex:column>
                <apex:column headerValue="Start" headerClass="clsCenter">
                <span style="color:red; font-weight: bold ; vertical-align:Center ; horizontal-align:Center">
                    <apex:outputField value="{!timesheet[dayWithApiname[dayslst.Day]]}">--------------------->>>> CAN WE MAKE ANY STYLE OR CSS TO PUT THIS FIELD IN THE MIDDLE OF COLUMn IN PAGEBLOCK TABLE
                        <apex:inlineEditSupport showOnEdit="saveButton, cancelButton" hideOnEdit="editButton" event="ondblclick" changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/>
                    </apex:outputField> 
                     </span>
                </apex:column>
I have created a dynamic soql in controller but while using it with IN operator its not showing the query properly....
<apex:page controller="dynamicsoql">
    <apex:form>
        <apex:pageBlock >
            <apex:pageBlockSection id="pbs">
                <apex:outputText>{!idinlist}</apex:outputText>
                <apex:inputTextarea value="{!query}" />
            </apex:pageBlockSection>
            <apex:commandButton action="{!showid}" value="showid" reRender="pbs"/>
            <apex:commandButton action="{!showquery}" value="showquery" reRender="pbs"/>
        </apex:pageBlock>
    </apex:form>
</apex:page>
.........................................................................
public class dynamicsoql {
    public list<j__c> recordid { get; set; }
    public string singleid{get;set;}
    public list<string> idinlist{get;set;}
    public string query {get;set;}
    public dynamicsoql()
    {
     recordid=[select id from j__c];
     idinlist=new list<string>();
    }
    public void showid()
    {
        for(j__c j: recordid)
        {
            singleid='\''+string.valueOf(j.id)+'\'';
            idinlist.add(singleid);
        }
    }
    public void showquery()
    {
        query ='select name from j__c where id in '+  idinlist ;
    }
}

In my controller their is a dynamic soql query----

(((((((((((query ='select name from j__c where id in '+  idinlist ;))))))))))))))))

in this query ""idinlist"" is a list of id's. If in the list their are only 10 id then its fine and the query is printed in the vf page in this form
select name from j__c where id in ('a019000000FRJDkAAP', 'a019000000FRJDzAAP', 'a019000000FRJEdAAP', 'a019000000FRJEeAAP', 'a019000000FRJFCAA5', 'a019000000FRJFDAA5', 'a019000000FRJFEAA5', 'a019000000FRJFFAA5', 'a019000000FRJFlAAP', 'a019000000FRJGSAA5')

but if  ""idinlist"" has more then 10 id's then its query is printed in this form

select name from j__c where id in ('a019000000FRJDkAAP', 'a019000000FRJDzAAP', 'a019000000FRJEdAAP', 'a019000000FRJEeAAP', 'a019000000FRJFCAA5', 'a019000000FRJFDAA5', 'a019000000FRJFEAA5', 'a019000000FRJFFAA5', 'a019000000FRJFlAAP', 'a019000000FRJGSAA5',...)

means after 10th id it's just showing '''...''' and no id. i had printed the query in vf page system debug every where it's the same.
and because of that my query is not working. Please help.


i want to repeat a pageblocksection in a vf page so that the title should change dynamically account to the values {get;set;} in controller.....
plz help.......

<apex:repeat values="DON'T KNOW WHAT TO PUT IN THIS PLACE">
<apex:pageBlockSection title="{!heading}">
            <Apex:repeat value="{!textvalues}" var="tv">
            {!tv}
            </Apex:repeat>
            </apex:pageBlockSection>
</repeat>
please help....
I am trying to create a new lead from inside an Apex Controller. For test purposes, I am simply running the following code:

insert new Lead(LastName='Smite', Company='Acme');

This works fine when run from an execure anonymous window, but when it runs in my controller I always get:

System.DmlException: Insert failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, invalid parameter value: []
Error is in expression '{!createLead}' in component <apex:commandButton> in page prospects

Why would this be happending? I have no triggers or workflows defined. 

Any help is greatly appreciated.