• mritzi
  • SMARTIE
  • 1779 Points
  • Member since 2016
  • Certified Salesforce Developer


  • Chatter
    Feed
  • 54
    Best Answers
  • 1
    Likes Received
  • 2
    Likes Given
  • 2
    Questions
  • 244
    Replies
Hi All,

i have masterdetail relationship between quotes(parent) and quotelineitems(child)

and 

i also have lookup relationship between product(parent) and quotelineitems(child)

NOTE:there is no direct relationship between quotes and the product

REQUIREMENT:now i want to update a field in quotes object based on some condition in products object using Apex Trigger.

can anyone please let me know how can i proceed with this?
your help is much appreciated!
I attempted to add a field to this section of code but now I get the rendered="false"/> Error

Here is the original code;
<apex:pageBlockSection collapsible="false">
                        <apex:inputField value="{!oHoldMachine.Do_Not_Ship__c}" id="chkDoNotShip" onChange="jsRerenderDisplay();"/>
                        <apex:inputField value="{!oPRODUCT.leaseProduct.Requested_Delivery_Date__c}"
                                        label="{!$Label.Earliest_Requested_Delivery_Date}"
                                        rendered="{!NOT(oHoldMachine.Do_Not_Ship__c)}"/>
                        <apex:inputField value="{!oHoldMachine.Expedite_Delivery__c}" 
                                        rendered="{!NOT(oHoldMachine.Do_Not_Ship__c)}" 
                                        onChange="jsRerenderDisplay();"/>
                        <apex:pageBlockSectionItem />
                        <apex:inputField value="{!oHoldMachine.Expedited_Delivery_Date__c}" 
                                        rendered="{!AND(oHoldMachine.Expedite_Delivery__c
                                                    , NOT(oHoldMachine.Do_Not_Ship__c))}"/>
                        <apex:inputField value="{!oHoldMachine.Expedited_Delivery_Hours__c}" 
                                        rendered="{!AND(oHoldMachine.Expedite_Delivery__c
                                                    , NOT(oHoldMachine.Do_Not_Ship__c))}"/>
                    </apex:pageBlockSection>

                </apex:outputPanel>



Here is my change;
<apex:pageBlockSection collapsible="false">
                        <apex:inputField value="{!oHoldMachine.Do_Not_Ship__c}" id="chkDoNotShip" onChange="jsRerenderDisplay();"/>
                        <apex:pageBlockSectionItem />
                        <apex:inputField value="{!oPRODUCT.leaseProduct.Requested_Delivery_Date__c}"
                                        label="{!$Label.Requested_Delivery_Date}"
                                        rendered="{!NOT(oHoldMachine.Do_Not_Ship__c)}"/>
                        <apex:inputField value="{!oPRODUCT.leaseProduct.Today_Plus_Lead_Time__c}" 
                                        rendered="{!NOT(oHoldMachine.Do_Not_Ship__c)}"/>
                        <apex:inputField value="{!oHoldMachine.Expedite_Delivery__c}" 
                                        rendered="{!NOT(oHoldMachine.Do_Not_Ship__c)}" 
                                        onChange="jsRerenderDisplay();"/>
                        <apex:pageBlockSectionItem />
                        <apex:inputField value="{!oHoldMachine.Expedite_Reasons__c}"/>
                                        rendered="{!AND(oHoldMachine.Expedite_Delivery__c
                                                    , NOT(oHoldMachine.Do_Not_Ship__c))}"/>
						<apex:inputField value="{!oHoldMachine.Expedited_Delivery_Date__c}" 
                                        rendered="{!AND(oHoldMachine.Expedite_Delivery__c
                                                    , NOT(oHoldMachine.Do_Not_Ship__c))}"/>
                        <apex:inputField value="{!oHoldMachine.Expedited_Delivery_Hours__c}" 
                                        rendered="{!AND(oHoldMachine.Expedite_Delivery__c
                                                    , NOT(oHoldMachine.Do_Not_Ship__c))}"/>
                    </apex:pageBlockSection>

                </apex:outputPanel>


I added 
<apex:inputField value="{!oHoldMachine.Expedite_Reasons__c}"/>
                                        rendered="{!AND(oHoldMachine.Expedite_Delivery__c
                                                    , NOT(oHoldMachine.Do_Not_Ship__c))}"/>

Any help would be appreciated
Hi, I am trying to get three fields on an Account page layout to really stand out above the rest.  I'd like to build a visualforce page to look something like this:
User-added image
So I'd like not only the field values to have larger font but also the field labels and have the values listed under the label.  I'd also like to add in conditional formatting to the value on Account Status where if the value is "Active" then highlight it in green and if it is "Inactive" then highlight it in red.  I can't figure out how to do this.  Any help would be greatly appreciated!
Hi,
I had a query related to sharing a record

There are two fields in a record and in that you want that if the total of field is 100 or more then share the record with the user else if it less then keep it in private only

Can you please tell me how to do this using apex?
Hello ,



As i am trying to insert the child records,while opportunity has been created but record is not been creates,please have a look...


trigger Test01 on Demo_Object__c (before insert) {
    public list<Opportunity> opList;
    for(Demo_Object__c dc:trigger.new){
        opList=new list<Opportunity>();
        if(dc.Category__c=='Opportunity'){
            Opportunity op=new Opportunity();
            op.Name='sample';
            op.StageName='Prospecting';
            op.CloseDate=system.today();
            //insert op;
            opList.add(op);
            //dc.Opportunity__c=op.Id;
            
        }
    }
    insert opList;
}
Hi All,

I have requirement where i need schedule batch job 4 times in day. this are the timinings 1AM EST, 10 AM EST, 3PM EST, 8PM EST. I have schedule this using cron expression in dev console. i have prepared script below, please advise is this correct.


className c = new className();
String sch = '0 0 1,10,15,20 * * *';
system.schedule('Four times in day ', sch, c);

Thanks,
Anil Kumar
In my current scenario I am having two maps and I want them to print in same table.

Map<Custom Object, String 1> map1 ;
Map< String2, Custom Object, > map2 ;

In the above case String 2 is an calculated String not a custom Field
Table output will be like this

 
Column 1                             || Column 2 || Column 3
CustomObejct_ID                 || String1     ||String 2
  • August 01, 2018
  • Like
  • 0
What must I do to be able to select my VisualForce page on a custom button?
User-added image
My VisualForce page utilises a custom Controller and is pulling in two objects. 
Here is where the button is used:-
User-added image
Here is my VisualForce code:-
<apex:page lightningStyleSheets="true" Controller="myController" title="Apprentice Documentation">
    <apex:form >
    <!--myController refers to the Apex class I created called myController.apxc this is so I can use two object types in one form in place of a Standard controller
        For refrence ApprenticeObj = new Apprentice__c and ComponentsObj = new Apprenticeship_Component__c-->
        
    <!--Style-->
        <style>
        body{
        font-family: Arial,Helvetica,sans-serif;
        color: #000000;
        Padding:25px;
        }
        </style>
    <!--End of Style-->
        
        <apex:pageBlock >
            <apex:pageBlockSection columns="3">
                <apex:inputField value="{! ApprenticeObj.Name}"/>
            </apex:pageBlockSection>
         </apex:pageBlock>
        
     <!--Apprentice Details Section-->
        <apex:pageBlock title="Apprentice Details">
            <apex:pageBlockSection columns="2">
                <apex:inputField value="{! ApprenticeObj.Apprentice_name__c}"/>
                <apex:inputField value="{! ApprenticeObj.Curriculum_Verified__c}"/>
                <apex:inputField value="{! ApprenticeObj.ULN__c}"/>
                <apex:inputField value="{! ApprenticeObj.Employer__c}"/>
                <apex:inputField value="{! ApprenticeObj.Programme_Area__c}"/>
                <apex:inputField value="{! ApprenticeObj.Vacancy__c}"/>
                <apex:inputField value="{! ApprenticeObj.Learning_Start_Date__c}"/>
                <apex:inputField value="{! ApprenticeObj.Levy_Status__c}"/>
                <apex:inputField value="{! ApprenticeObj.Programme_Agreed_With_Employer__c}"/>
                <apex:inputField value="{! ApprenticeObj.Existing_Employee__c}"/>
            </apex:pageBlockSection>
         </apex:pageBlock>
        <!--End of Apprentice Details Section-->
        
        <!--Line Manager Details Section-->
         <apex:pageBlock title="Line Manager Details">
            <apex:pageBlockSection columns="2">
               <apex:inputField value="{! ApprenticeObj.Line_Manager__c}"/>
               <apex:inputField value="{! ApprenticeObj.Line_Manager_Phone__c}"/>
               <apex:inputField value="{! ApprenticeObj.Line_Manager_Email__c}"/>
               <apex:inputField value="{! ApprenticeObj.Line_Manager_Mobile__c}"/>
            </apex:pageBlockSection>
         </apex:pageBlock>
     <!--End ofLine Manager Details Section-->
        
     <!--Previous Education & Diagnostics-->
       <apex:pageBlock title="Previous Education & Diagnostics">
            <apex:pageBlockSection columns="2">
                <apex:inputField value="{! ApprenticeObj.English_Assessment__c}"/>
                <apex:inputField value="{! ApprenticeObj.Date_of_Birth__c}"/>
                <apex:inputField value="{! ApprenticeObj.Maths_Assessment__c}"/>
                <apex:inputField value="{! ApprenticeObj.Funding_Line__c}"/>
                <apex:inputField value="{! ApprenticeObj.Highest_Previous_Attainment__c}"/>
                <apex:inputField value="{! ApprenticeObj.Highest_ICT_Achievement__c}"/>
                <apex:inputField value="{! ApprenticeObj.Highest_English_Qual__c}"/>
                <apex:inputField value="{! ApprenticeObj.Prior_Learning_Record_Attached__c}"/>
                <apex:inputField value="{! ApprenticeObj.Highest_Maths_Qual__c}"/>
                <apex:inputField value="{! ApprenticeObj.Learning_Difficulties__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of Education & Diagnostics-->
        
        <!--Apprenticeship Programme-->
        
        <apex:pageBlock title="Apprenticeship Programme">
            <apex:pageBlockSection columns="2" >
                <apex:inputField value="{! ApprenticeObj.Apprenticeship_Title__c}"/>
                <apex:inputField value="{! ApprenticeObj.Minimum_Duration__c}"/>
                <apex:inputField value="{! ApprenticeObj.Apprenticeship_Pathway__c}"/>
                <apex:inputField value="{! ApprenticeObj.Prefered_Duration__c}"/>
                <apex:inputField value="{! ApprenticeObj.Apprenticeship_Level__c}"/>
                <apex:inputField value="{! ApprenticeObj.Development_Coach__c}"/>
                <apex:inputField value="{! ApprenticeObj.Apprenticeship_Type__c}"/>
                <apex:inputField value="{! ApprenticeObj.Usual_College_Day__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
        
      <!--End of Apprenticeship Programme-->
        
      <!--Functional Skills-->
        <apex:pageBlock title="Functional Skills">
            <apex:pageBlockSection columns="2" >
                <apex:inputField value="{! ApprenticeObj.Functional_Maths__c}"/>
                <apex:inputField value="{! ApprenticeObj.Maths_Status__c}"/>
                <apex:inputField value="{! ApprenticeObj.Functional_English__c}"/>
                <apex:inputField value="{! ApprenticeObj.English_Status__c}"/> 
                <apex:inputField value="{! ApprenticeObj.Functional_ICT__c}"/> 
                <apex:inputField value="{! ApprenticeObj.ICT_Status__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of Functional Skills-->
        
        <!--Existing Employer Details-->
        <apex:pageBlock title="Existing Employer Details">
            <apex:pageBlockSection columns="2" >
                <apex:inputField value="{! ApprenticeObj.Original_Start_Date__c}"/>
                <apex:inputField value="{! ApprenticeObj.Additional_Skills_Existing_Employee__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of Existing Employer Details-->
        
        <!--End Point Assessment (EPA)-->
        <apex:pageBlock title="End Point Assessment (EPA)">
            <apex:pageBlockSection columns="2" >
                <apex:inputField value="{! ApprenticeObj.Functional_Maths__c}"/>
                <apex:inputField value="{! ApprenticeObj.Maths_Status__c}"/>
                <apex:inputField value="{! ComponentsObj.Qual_Aim_Text__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of End Point Assessment (EPA)-->
        
      <!--Apprenticeship Components-->
        
        <apex:pageBlock title="Apprenticeship Components">
            <apex:pageBlockSection columns="1" >
                <apex:inputField value="{! ComponentsObj.Apprenticeship_Qualifications__c}"/> 
                <apex:inputField value="{! ComponentsObj.Learning_Aim_Code__c}"/>
                <apex:inputField value="{! ComponentsObj.Awarding_Organisation__c}"/>
                <apex:inputField value="{! ComponentsObj.Delivery_Location__c}"/>
                <apex:inputField value="{! ComponentsObj.Start_Date__c}"/>
                <apex:inputField value="{! ComponentsObj.Planned_End_date__c}"/>
                <apex:inputField value="{! ComponentsObj.Percentage_of_Aim_to_be_Delivered__c}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
      <!--End of Apprenticeship Components-->
        
      <!--Save/Cancel-->
       
        <apex:pageBlock >
        <apex:commandButton action="{!saveObjects }" value="Save" />
        </apex:pageBlock>
        
      <!--End of Save/Cancel-->
            

    </apex:form>
</apex:page>
Also my controller :- 
public class myController{
public Apprentice__c ApprenticeObj{get;set;}
public Apprenticeship_Component__c ComponentsObj{get;set;}
public Programme_Area__c ProgramArea {get;set;}
public myController(){
         ApprenticeObj = new Apprentice__c();
         ComponentsObj = new Apprenticeship_Component__c();
         ProgramArea = new Programme_Area__c ();
    }
    public void saveObjects(){
         ProgramArea.PA_Code__c = 'P12';
         insert ProgramArea;
         ApprenticeObj.Programme_area__c = ProgramArea.Id;
         ApprenticeObj.ULN__c = '56464646';         
         insert ApprenticeObj;
         ComponentsObj.Apprentice__c = ApprenticeObj.Id;
         
         insert ComponentsObj;
    }
}

Thankyou
 
Big Deal Alert : -
If your opportunity stage is in 'negotiation/review' stage, send an email to the opportunity owner indicating a big deal is being created. Big deal amount should be greater than 50k. Create email template also.

I dont want to execute this using workflow. I want using big deal alert property. Can anyone help?
  • July 21, 2018
  • Like
  • 0
I want to get all unique values of Store__c, so that I can use it to querry my store object later (I can't use group by here). My query looks like 
List<lead> listLead = [ SELECT  Store__c FROM Lead WHERE status = 'Eligible'];
Set<lead> random2 = new Set<lead>();
random2.addAll(listLead);
System.debug(random2);
The problem here is I am getting result for random2 as follows. I only want a set which has Store__c and not Id and RecordTypeId for lead
Lead: {Store__c=a0O1F000000R39cUAC, Id=00Q1F000002I6FFUA0, RecordTypeId=0121F000000B25UQAS}, 
Lead:{Store__c=a0O1F000000R4xqUAC, Id=00Q1F000002IBziUAG, RecordTypeId=0121F000000B25UQAS}}
Also, my next question is : how do I use this Set to query the Store__c object to get all unique Regions__c. (How do I iterate the list of stores in soql query) e.g select region__c from Store__c where id=  set of retrieved Store ids in previous query . Also, how efficient would it be?

Thanks

Hello,

I currently have an Event Trigger and the code coverage is only 80%. I need to assign the WhatID for an event. How may I do this with a test class? This is what I have so far:

...
Event someEvent = new Event(Subject = 'Test', 
                              ActivityDate = date.today(), 
                              StartDateTime = System.Now(),
                              EndDateTime = System.Now() + 5,
                              whatId = ???);
...
Do I need to get the whatID from a User, Account, Contact, or something else? Any help is greatly appreciated!

Sincerely,
Jackie
Hi All,

i have a SOSL in my Apex code which like below:
String searchQuery = 'FIND \'' + String.escapeSingleQuotes(searchInput) + '\' IN ALL FIELDS RETURNING contentVersion  (Title, Tagscsv, Id, Availability__c, Colour_Enabled__c' + queryWhere + ' ORDER BY Title LIMIT 500) ';

But, my requirement is lik, i should not search in ALL FIELDS, but i have some specific fields like Title and Tagcsv .. any suggestions to achieve this. 

Thanks in advance.

Regards,
Suma. 
 
Hey There, I'm trying to use a IF statement or a case statement and am having some trouble. I have a date field, and want to create a forumula field that creates a new date based on my criteria. Below is my formula:

IF(AND(ISPICKVAL(ERP__c,"QBO"), Salesforce_required_for_Go_Live__c = FALSE),Opportunity_Close_Date__c + 10 + Number_of_Subsidiaries__c, 
IF(AND (ISPICKVAL(ERP__c,"QBO"), Salesforce_required_for_Go_Live__c = TRUE), Opportunity_Close_Date__c + 19 + Number_of_Subsidiaries__c),
IF(AND (ISPICKVAL(ERP__c,"INTACCT"), Salesforce_required_for_Go_Live__c = FALSE), Opportunity_Close_Date__c + 18 + Number_of_Subsidiaries__c*3),
IF(AND (ISPICKVAL(ERP__c,"INTACCT"), Salesforce_required_for_Go_Live__c = TRUE), Opportunity_Close_Date__c + 27 + Number_of_Subsidiaries__c*3),
NULL)

Error is:  Error: Incorrect number of parameters for function 'IF()'. Expected 3, received 2

Any thoughts?
Pls help me....
Use case
-On Opportunity object
-  Create Fields FirstName,LastName,Email,Phone.
-  Create checkbox 'create account & contact'.
-create contact lookup on opportunity.
-  When opportunity record is saved, and the checkbox is set as true. Insert new Account & Contact and connect this opportunity with that Account & Contact.
- Only trigger event to take care of is Insert.

Trigger on opportutnity
pls any one help me n how to write in best practice....
I am trying to get a string value off the User object. When I run a debug it is returning not only the Sagitta_User_Code__C, but the ID as well. I just want to get the Sagitta_User_Code__c. How do I isolate just the value of the Sagitta_User_Code__c. 
 
List<User> accountOwner = [Select Sagitta_User_Code__c From User where id =: accnt.ownerid];
        System.debug('Sagitta Login: ' + '' + accountOwner);

Debug Log:
 
|USER_DEBUG|[22]|DEBUG|Sagitta Login: User:{Sagitta_User_Code__c=ral, Id=005400000032HgHAAU}

 
Please guide how to display collection items on vf page with iteration. Also while developing this what things I must remember?
Hi All,
I have a senariou like this, i have  Created Date field(custom field)  and   Expire Date __c (Formal Datefield). For Example Created date is 6/09/2016 then the Expiredate__c should add 15 working days(30/06/2016) (exclude sunday and saturday) to CreatedDate__C.
My logic for this is :
 CASE( MOD( date - DATE( CreatedDate__C ), 7 ),
3, date + 2 + 15,
4, date + 2 + 15,
5, date + 2 + 15,
6, date + 1 + 15,
   date + 15
)
But it is not working proparly. Any one please help me to over come this.

Thanks and Regards,
Raji
I am new to Lightning process builder.I have one custom object named as "Fee__c".There is lookup on Fee__c to Contact.Now,I want that if a new record is created in contact then that record should also create in Fee__c,and there is field named as Semester__c in Contact if Semester__c value changes/updated in Contact then also respective new record will create in Fee__c(want to use priorvalue to check previous and new value in Semester__c so that new record will create if only new value in semester is different from previous) and also if any other updations except the Semester__c field in contact then there will be no updation/creation of new records in Fee__c should be done.What should be best technique to do this?please guide me.
I have the different methods in controller and it is fetching the user.name based  login details.
Controller is having the different methods and each method want to check the user.name details in where clause of soql.
Please let me know how to write a method and to hold the user.name details and use the same in all the methos where clause.
hii everyone, how do I add 6 months to a date field in a formula? There are two  Date fields date of joining(DOJ_c) and  a formulafield  (Conformation_Date_c) ,if i put any date in date of joining (DOJ_c) field then in the conformation date =(date of joining + 6 month). kindly provide the formula for  conformation Date.
 
I am working on an Einstein Bot. The default Bot performance dashboard gives me info about how many times a Dialog is used [Top Last Dialogs card]. But the requirement is to know Top Dialogs group by Customer.

Currently we store unique customerId in LiveChatTranscript object, but I cant find any way to link EinsteinBotsV2 object with LiveChatTranscript.

EinsteinBotsV2 is not even visible in 'Object Manager'. It just shows up in the Einstein Bot Dashboard DataSet.

Has anyone been able to link any object with EinsteinBotsV2, or create custom field(s) in it.

Current Report
Dialog Name    Count
Dialog1             05
Dialog2             01

Requirement
CustomerId       Dialog Name      Count
cdxswe             Dialog1               02
cdxswe             Dialog2               01
zxcvb               Dialog1                03

As a last resort, I am thinking of creating a custom object and storing info into it using Apex/Flow when Dialog is changed. But would prefer any alternative that will allow me to work with existing objects.
  • August 02, 2019
  • Like
  • 1
I have tried to get a replacement of following onClick JavaScript button in Lightning, but so far I haven't been able to make progress.
 
{!REQUIRESCRIPT("/soap/ajax/31.0/connection.js")}
{!requireScript("/soap/ajax/31.0/apex.js")}



if("{!Opportunity.Number_of_Quotes__c}"=="0"){
alert("There must be atleast one Quote");
}
else{
window.open('/_ui/core/email/author/EmailAuthor?&p26={!Opportunity.Logged_In_User_Email__c}&p2_lkid={!Opportunity.AccountId}&p3_lkid={!Opportunity.Id}&template_id={!$Label.Quote_Template}&retURL=%2F{!Opportunity.Id}')

}

Any help would be highly appreciated
I am working on an Einstein Bot. The default Bot performance dashboard gives me info about how many times a Dialog is used [Top Last Dialogs card]. But the requirement is to know Top Dialogs group by Customer.

Currently we store unique customerId in LiveChatTranscript object, but I cant find any way to link EinsteinBotsV2 object with LiveChatTranscript.

EinsteinBotsV2 is not even visible in 'Object Manager'. It just shows up in the Einstein Bot Dashboard DataSet.

Has anyone been able to link any object with EinsteinBotsV2, or create custom field(s) in it.

Current Report
Dialog Name    Count
Dialog1             05
Dialog2             01

Requirement
CustomerId       Dialog Name      Count
cdxswe             Dialog1               02
cdxswe             Dialog2               01
zxcvb               Dialog1                03

As a last resort, I am thinking of creating a custom object and storing info into it using Apex/Flow when Dialog is changed. But would prefer any alternative that will allow me to work with existing objects.
  • August 02, 2019
  • Like
  • 1
Hi All,

I have tried posting a job multiple times on the Appexchange and none of the postings have gone live even though it agknowledges that it was submitted. I called Salesforce customer support and they advised they were unsure of how to help but that I should post it in the developers discussion forum to see if they could help. 
Hi All,

I have a one requirement , i have status__c f field in task   obj, once the status status  is changed to closed, i need to update two fields closedby & closedon , which i am not showing on UI .. how can i have achieve this using lightning component,

Regards
Pranav
Hi guys, my requirement is,

Create Renewal Opportunity - When opportunity stage is set to “Closed Won”, renewal
opportunity needs to be created with the following field mapping
Record type = “Renewal” (Create Opportunity Record Type, if not exist)
Account = Account of Original Opportunity
Type = Type of Original Opportunity
Stage = “Negotiation/Review”
Renewed from Opportunity = Original Opportunity (Create Lookup field of Opportunity on
Opportunity)
Close date = Close date of Original Opportunity + 10 Days
Name = “Renewal” + [SPACE] + Original Opportunity Name
2. Copy opportunity line Item to the renewal opportunity from Original Opportunity
  • August 24, 2019
  • Like
  • 0
I use the Salesforce lightning for a develope.
I want change the page layout from two cloumn to one column,
and i have setting in the [edit page],but didn`t work.
I thought that must be the page layout list was setting wrong,
but i dont`t know how to solve that right.
In my scenario i have a list of questions i need to capture the selected options to an object on submiting the questionaire. SelectRadio is placed inside a repeat to load questions from a master object. 

I need to get the question id and selected value of the questions and save it to an object.

VF Page
 <apex:repeat value="{!QuesList}" var="a">
     
      <apex:pageBlockSection columns="1" >
                 <apex:pageBlockSectionItem ><B>{!a.MSWq1__c}</B>
                      </apex:pageBlockSectionItem>
                 <apex:pageBlockSectionItem >
                 <apex:selectRadio layout="pageDirection" styleClass="test">
                    <apex:selectOption itemLabel="{!a.Option1__c}" itemValue="A"></apex:selectOption>
                    <apex:selectOption itemLabel="{!a.option2__c}" itemvalue="B"></apex:selectOption>
                    <apex:selectOption itemlabel="{!a.option3__c}" itemvalue="C"></apex:selectOption>
                     <apex:selectOption itemlabel="{!a.option4__c}" itemvalue="D"></apex:selectOption>
                    </apex:selectRadio> 
                 </apex:pageBlockSectionItem>
                  </apex:pageBlockSection> 
     </apex:repeat>
    </apex:pageBlock>
Controller 
 
public class ctrlQuestions {

public Assessment__c main{get; set;}
public List<master__c> QuesList {get; set;}

public ctrlQuestions(){
main=newAssessment__c();
QuesList = new List<master__c>();
QuesList = [select Name,MSWq1__c,Option1__c,Option2__c,Option3__c,Option4__c,Correct_Option_Choice__c from MSW_master__c where Isactive__c= true];
}
public PageReference saveandred() {
   insert main; 
        
        return new PageReference('/Test/'+main.Id);
    }
}

 
Is there a way, with Apex, to deliver the folowing requirement:

When Now() falls withing 45 days before a deadline DateTime on the Account, then in such scenario:

First: verify if this Account already has a Case with criteria xyz; if such Case record already exist, update it;

Second: if no such Case exists, then create a Case with attributes xyz.

 
  • August 02, 2019
  • Like
  • 0
Hi All,

i have masterdetail relationship between quotes(parent) and quotelineitems(child)

and 

i also have lookup relationship between product(parent) and quotelineitems(child)

NOTE:there is no direct relationship between quotes and the product

REQUIREMENT:now i want to update a field in quotes object based on some condition in products object using Apex Trigger.

can anyone please let me know how can i proceed with this?
your help is much appreciated!
Hi, 
trigger OpportuntiyDelete on Opportunity (Before Delete) {
 
    list<SBQQ__Quote__c> qt = [select id from SBQQ__Quote__c where  SBQQ__Opportunity2__c = :trigger.oldmap.keyset()]; // Here it is always returning 0 even if it has data to return. 
   
   for(opportunity opp: trigger.old){

      opp.adderror('Opportunity record cannot be deleted' + ' '  + qt.size() + ' ' + opp.id + ' ' + cpqid  + ' ' + trigger.oldmap.keyset());

    }
}

This list is returning 0 values even if data existing for opportunity. 

  list<SBQQ__Quote__c> qt = [select id from SBQQ__Quote__c where  SBQQ__Opportunity2__c = :trigger.oldmap.keyset()]; 

SBQQ__Quote__c is not a child object it has a lookup value of opportunity there is a no master child relationship. Please suggest me how to fix. 

Thanks
Sudhir

 
I am trying to assign max value to an auto number field in order to generate a student number that can only be a certain amount of digits. The auto number may only increment until 9999 - meaning it cannot exceed 4 digits. So once it reaches 9999, it must reset and start at 0 again. Is this possible? Any help would be so appreciated! Thank you.
Hi All, 

I have phone field that i need to add "+" or 00 to dial for country how can i add this prefix using dml statments. here is my current one: 
 
list <lead>cs = [select name, id, phone, MobilePhone from lead]; 
for (lead c:cs) {
    c.Phone= c.MobilePhone; 
}
Update cs;

i want to add ' + then  c.MobilePhone 
Hello everyone,
I am facing a new behavior in the user debug log. I get one line such as below:
16:41:29.18 (18684983)|USER_INFO|[EXTERNAL]|00520000001LzfN|admin@ccnfr.org.ccnussb|Eastern Standard Time|GMT-04:00
for each access to a sObject field in the page, either in the VF page such as {!sObject record} OR accessed through Javascript. Problem is that I get 50+ of these lines in some busy pages and the log quits before the end at a line like this.
????????  Does anyone have the same issue?
Any idea? Is this a bug?  Can I remove these lines through the filters?  i tried all day long, with no sucess; Even setting Apex debug level to none brings these lines back.
Thansks in advance for your help.
Jerome
Hi, 

For a couple of days I've been receiving this kind of line in my debug logs. I guess this is realated to the new API version (v37.0). 
I would n't care about this if didn't receive thousands of lines like this one in all my traces. 

17:02:42.238 (238882742)|USER_INFO|[EXTERNAL]Salesforce user id| username| GMT time

My debugs levels are: 

Database               INFO
Workflow                INFO
Validation               INFO
Callouts                 INFO
Apex Code            INFO
Apex Profiling        DEBUG
Visualforce            NONE
System                 NONE

Thanks