• shweta kumari 25
  • NEWBIE
  • 30 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 8
    Replies
I have a checkbox and a command button inside a visualforce page.

when page loads command button should be disabled.

Only when I check the checkbox then the command buton should be enabled and on click it will navigate to another page.

Please anyone post a working code for the scenario.

thanks

shweta
Hello all
This is an very urgent requirement.

I have a parent visualforce page called Med which has 4 fields say approver_1 , approver_2 , approver_3 and approver_4 which is lookup to user.

I have a button which opens a visualforce page as a popup.

The code for the popup visualforce page is as follows:

vf page:
=======
<apex:page standardController="MedConnect__FDA_3500A_MedWatch_Report__c" extensions="VY_InitiateApprovalProcess_Controller" lightningStylesheets="true">
<apex:includeScript value="{!$Resource.MedConnect__jquery}" />
    <apex:includeScript value="{!URLFOR($Resource.MedConnect__jquery_ui,'jquery-ui-1.10.3/ui/minified/jquery-ui.min.js')}"/>
    <apex:stylesheet value="{!URLFOR($Resource.MedConnect__jquery_ui,'jquery-ui-1.10.3/themes/base/jquery-ui.css')}"/>
<apex:form >
<apex:pageBlock mode="edit">
<apex:pageBlockSection title="Approvers" id="ApproversId">
    <apex:inputField Id="appId1" html-placeholder="Search People..." value="{!Approver.VY_Approver1__c}" />
    <apex:inputField Id="appId2" html-placeholder="Search People..." value="{!Approver.VY_Approver2__c}" />
    </apex:pageBlockSection>
    <apex:pageBlockSection >
    <apex:inputField Id="appId3" html-placeholder="Search People..." value="{!Approver.VY_Approver3__c}" />
    <apex:inputField Id="appId4" html-placeholder="Search People..." value="{!Approver.VY_Approver4__c}" />
    </apex:pageBlockSection>
    <apex:pageBlockButtons location="bottom" html-align="right">
    <button class="btn" onclick="window.open('/{!$CurrentPage.parameters.id}', target='_self');return false;">Cancel</button>
     <apex:commandButton action="{!customSave}" value="Save" onClick="Window.Close()" onomplete="window.top.location.reload()"/>
     
    </apex:pageBlockButtons>
    </apex:pageBlock>
</apex:form>
    <script language="JavaScript" type="text/javascript">
function CloseAndRefresh(){
window.opener.location.href="/{!$CurrentPage.parameters.ID}";
      self.close();
  }
</script>
</apex:page>

apex controller of poup page
======================
public with sharing class VY_InitiateApprovalProcess_Controller
{
    public id ReportIds;
    public MedConnect__FDA_3500A_MedWatch_Report__c Approver { get; set; }
   
    public VY_InitiateApprovalProcess_Controller(ApexPages.StandardController controller) {
        ReportIds = ApexPages.CurrentPage().getParameters().get('id');
        this.Approver = (MedConnect__FDA_3500A_MedWatch_Report__c)controller.getRecord();
        Approver =[SELECT Id,VY_Approver1__c,VY_Approver2__c,VY_Approver3__c,VY_Approver4__c
                            FROM
                            MedConnect__FDA_3500A_MedWatch_Report__c WHERE Id =:ReportIds];
    }
    public VY_InitiateApprovalProcess_Controller()
    {
        Approver = new MedConnect__FDA_3500A_MedWatch_Report__c();
    }
   
    public PageReference customSave()
    {
        PageReference pr;
        try{
            database.upsert(Approver);
            //closeWindow = true;
            pr = new PageReference('/'+Approver.Id );
        }catch( Exception e ){
            ApexPages.addMessages(e);
        }
        return Null;       
    }
   
}  

Once I hit the save button then it should close and the parent visualforce page should refresh showing the field values.

Also when I click cancel, then the popup page should close.

I am not able to get this straight.

Please respond with earliest and eloborate.

thanks
shweta

 
I have a simple lightning component. which has  <h1> tag in it.
<aura:component implements="flexipage:availableForAllPageTypes,lightning:isUrlAddressable" access="global" > <h1> I am F1 Comp </h1> </aura:component/>

I have account object.

when I click any record , it will open the record detail page.

On the record detail page I need want to have a custom button, on clicking this button it will open up the above component.

The point is I will add this custom button to the page layout.

I tried using a quick action button but I was unable to add to the detail page layout.

so I create a new button then how to call the above component.

I request the forum members to help me out very urgent.

thanks
shweta


 
I am not an expert in lightning components, so I had to post this question.

In lightning, I have an app page. There a is a primarycomponent kept on the lightning page.

PrimaryComponent.cmp
----------------------------
<aura:component implements="flexipage:availableForAllPageTypes,force:appHostable"
                access="global" >
 <lightning:button label="Neutral" 
                             title="Neutral action" 
                             onclick="{!c.handleF1Comp}"/>
</aura:component/>

Now I have another component say F1Comp.cmp

<aura:component implements="flexipage:availableForAllPageTypes"
                access="global" >
 <h1> I am F1 Comp </h1>
   </aura:component/>

My requirement is when I click the button In primarycomponentit should call the f1Comp.

How to achieve this?

Please eloborate and suggest approaches.
Thanks
shwet
I have custom object relationship as follows:

Course__c is a Master-Detail to Course_Delivery__c ; so Course__c is a Master and Course_Delivery__c  is child object

Course_Attendee__c is a Master-detail to Course_Delivery__c ; so Course_Attendee__c is a Master and Course_Delivery__c  is child object.

Course__c has fields like : location , startdate , instructor

records exists on all custom objects.

I have written a upward traversal soql as follows:

List<Course_Delivery__c> lsCourse_delivery=[select ID,
                                            Instructor__c,
                                            Start_Date__c,
                                            Course_Delivery__c.Course_Attendee__r.InstructorNotes__c,
                                            Course_Delivery__c.Course__r.Name
                                            from 
                                            Course_Delivery__c
                                            Order By Location__c];
system.debug(lsCourse_delivery);

I am getting an error as :  Course_Delivery__c.Course_Attendee__r.InstructorNotes__c ^ ERROR at Row:4:Column:45 Didn't understand relationship 'Course_Attendee__r' in field path.

Please help me

shweta
I have imported a managed package in my sandbox.
this package contains 1000 records of a picklist say countries and records of few other fiields.

Through investigation we came to know that the values in managed package picklist are wrong and some values need to be corrected.

I know we cannot edit a managed package.

so is there a way to achieve the above?

Like, I need these values into my custom  object, then I correct the error values,
I hope I am clear.

thanks
shweta
My requirement is to add about 10 opportunity line items when a new opporutntity gets created.

as of now I just have a trigger code which inserts one opportunity line item. If required I will share the code.

How to achieve this? Can I use a dataloader.

Please eloborate as required.

thanks
shweta

 
I have countries in custom settings and corresponding states in another custom setting.
I have a working code which will fetch the countries in picklist and then based on countries selection it will populatate the states picklist 

I need to write test class for the same; not sure how to go about it to cover the custom settings.(test cases)

Please let me know how we can achieve this

thanks
shweta
I have a Map defined as follows
Map<ID,List<Opportunity>> accMap = new Map<ID,List>Opportunity>>();

My requirement is I need to fill the List<Oppotunity> defined inside the map with data from the Opportunity object and accountIDs for the Map.

like select [ID,Name,Amount from opportunity to be filled inside the list and from opportunity we get the accountID and this will be in Map like
accMap.put(o.accountID) some thing like this.

I hope I am clear.

please let me code if possible how to achieve this scenario.

thanks
shweta


 
I have a cusotm event defined on the account object, say it starts at 10:00 am and completes at 11:00 am 

There is a custom field say counter in acocunt object which will hold a value when the custom event gets completed.

My requirement is to update the counter variable witht some value when the custom event completes.

How to check if the custom event has been completed?

My thought process is : create a worklfow on account object, field update on counter variable, in formula editor write some fomula

If anybody has any other approach please let me know.

Please share your thoughts on this scenario and wherevever required to elaborate pls do so..

Thanks
shweta
I have 2 custom objects i.e obA and ObjB.

ObjB is a lookup to objA.

ObjA  has fields as : Name , f1 , f2 , f3 and f4  (all type=text)

ObjB has only one field say name: ; values like ProductA , ProductB , ProductC etc.

Now I am creating a new record in custom object ObjA, so I will select ProductA, so when I select ProductA it should show only the fields f1 and f2.

similarly I create another record in custom object ObjA, so I will select ProductB, so when I select ProductB it should show only the fields f3 and f4.

How to achieve this functionality?

My though process is like create recordtype on ObjA , recordTypeA map to fields f1, f2 etc

alternatively, I thought of having a counter variable in objB for every product added. Then in a visualforce page when I select ProductA then I will reRender a pageBlock wich shows fields f 1 and f2 only.

I require some urgent input on this scenario; I request forum members to come up with their though process and eloborate whereever required.

I hope I am clear.

Thanks
shweta

 
Hello
I have two sfdc developer orgs i.e sfdc1(is the source) and sfdc2(is the destination).
I am consuming a webservice method defined on sfdc2 inti sfdc1.
I am using Named credentials as gien in the ur l:
http://www.jitendrazaa.com/blog/salesforce/login-to-salesforce-from-salesforce-using-authentication-provider/#more-4516

I have done with connected app and authorization provider but I have a doubt with the custom field in user object.
should it be a lookup field?

Thanks
shweta
Hello members
The question related to marketing cloud ; so right forum to ask?
I want to know difference between data extension and a list.

I know only one answer but there must be several.

In lists, emailadress is mandatory field ; in data extension emailaddress is not mandatory field i.e subscriber ID is mandatory.

Please let me know

thanks
shweta

 
I have a checkbox and a command button inside a visualforce page.

when page loads command button should be disabled.

Only when I check the checkbox then the command buton should be enabled and on click it will navigate to another page.

Please anyone post a working code for the scenario.

thanks

shweta
I have a Map defined as follows
Map<ID,List<Opportunity>> accMap = new Map<ID,List>Opportunity>>();

My requirement is I need to fill the List<Oppotunity> defined inside the map with data from the Opportunity object and accountIDs for the Map.

like select [ID,Name,Amount from opportunity to be filled inside the list and from opportunity we get the accountID and this will be in Map like
accMap.put(o.accountID) some thing like this.

I hope I am clear.

please let me code if possible how to achieve this scenario.

thanks
shweta


 
I have a simple lightning component. which has  <h1> tag in it.
<aura:component implements="flexipage:availableForAllPageTypes,lightning:isUrlAddressable" access="global" > <h1> I am F1 Comp </h1> </aura:component/>

I have account object.

when I click any record , it will open the record detail page.

On the record detail page I need want to have a custom button, on clicking this button it will open up the above component.

The point is I will add this custom button to the page layout.

I tried using a quick action button but I was unable to add to the detail page layout.

so I create a new button then how to call the above component.

I request the forum members to help me out very urgent.

thanks
shweta


 
I have custom object relationship as follows:

Course__c is a Master-Detail to Course_Delivery__c ; so Course__c is a Master and Course_Delivery__c  is child object

Course_Attendee__c is a Master-detail to Course_Delivery__c ; so Course_Attendee__c is a Master and Course_Delivery__c  is child object.

Course__c has fields like : location , startdate , instructor

records exists on all custom objects.

I have written a upward traversal soql as follows:

List<Course_Delivery__c> lsCourse_delivery=[select ID,
                                            Instructor__c,
                                            Start_Date__c,
                                            Course_Delivery__c.Course_Attendee__r.InstructorNotes__c,
                                            Course_Delivery__c.Course__r.Name
                                            from 
                                            Course_Delivery__c
                                            Order By Location__c];
system.debug(lsCourse_delivery);

I am getting an error as :  Course_Delivery__c.Course_Attendee__r.InstructorNotes__c ^ ERROR at Row:4:Column:45 Didn't understand relationship 'Course_Attendee__r' in field path.

Please help me

shweta
My requirement is to add about 10 opportunity line items when a new opporutntity gets created.

as of now I just have a trigger code which inserts one opportunity line item. If required I will share the code.

How to achieve this? Can I use a dataloader.

Please eloborate as required.

thanks
shweta

 
I have countries in custom settings and corresponding states in another custom setting.
I have a working code which will fetch the countries in picklist and then based on countries selection it will populatate the states picklist 

I need to write test class for the same; not sure how to go about it to cover the custom settings.(test cases)

Please let me know how we can achieve this

thanks
shweta
I have a Map defined as follows
Map<ID,List<Opportunity>> accMap = new Map<ID,List>Opportunity>>();

My requirement is I need to fill the List<Oppotunity> defined inside the map with data from the Opportunity object and accountIDs for the Map.

like select [ID,Name,Amount from opportunity to be filled inside the list and from opportunity we get the accountID and this will be in Map like
accMap.put(o.accountID) some thing like this.

I hope I am clear.

please let me code if possible how to achieve this scenario.

thanks
shweta