• shra1_dev
  • NEWBIE
  • 380 Points
  • Member since 2010

  • Chatter
    Feed
  • 13
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 47
    Questions
  • 111
    Replies
Hi Guys,

I'm trying to build a lightning component which will be used on Opportunity lightning UI. The component is placed in the right panel. The component loads pretty well on any Opportunity record view.

The problem here is when I try to update the opportunity record (which comes as popup block) the component in the right panel is not getting refreshed. By this the updated values are not showing up on the lightint component.

Need to find a way to refresh the lightning component on record save.

Any help would be appreciated!! 

Thanks
Shravan 

An org already has profiles assigned to specific users. The org installs a new application. The new application has profiles defined for users to interact with the new application. The new application also has permission sets with access similar to the profiles.

 

Hi, Here is my scenario

 

1. I have a CFO PROFILE which announces the budget to buy some media (Stored in 'Media Finance' object). The STATUS field in this object is updated to 'BUDGET ALLOCATED' immediately.

2. The BUYER PROFILE buys the media one by one to create the line items. 

3. After creating the media line items, the buyer indicates that his purchases are DONE by clicking a 'PURCHASE DONE' CUSTOM button in the screen. This calls JAVASCRIPT function asking 'Are you sure?'. Now, if he presses 'Yes', then STATUS field in the 'Media Finance' object should go to 'MEDIA PURCHASED'. 

3. The 'Media Finance' object is the master for 'Media line items' object.

 

Constraints:

----------------

1. ORG DEFAULT for Media Finance object - PUBLIC READ ONLY

2. Media finance object has  START DATE, END DATE, BUDGET fields which are REQUIRED in the DB. I cannot make it to be 'required' only in the UI. These are absolutely required for the records in the DB.

3. I don't want to change the 'public read only' because all the fields on 'Media Finance' object should be absolutely read only for the BUYER profile.

 

What I tried:

----------------

1. I gave a 'MODIFY ALL' for BUYER PROFILE on 'Media Finance' object. This makes START DATE, END DATE, BUDGET also editable in the UI which is a chaos for BUYER.

2. I wrote a validation rule to make sure buyer is not updating START DATE, END DATE, BUDGET fields, but it does not solve the purpose. It still confuses the BUYER to do something other than pressing 'PURCHASE DONE' button.

3. Tried to update the record through JAVASCRIPT using sforce.connection method and it fails 'coz there is no permission.

4. My understanding is that, there is no way to give permission to edit only one field (while some other fields are 'required' in DB) in salesforce.

 

Is there any other better way to handle this situation? Your help is much appreciated.

 

Let's say I have two objects, Parent and Child, where Child is a related list of Parent.  

I can write a query to get all children named 'One' from all parents.  And this works.

SELECT Name, (SELECT Name FROM Child__r WHERE Name = 'One') FROM Parent__c

But, what if I wanted to get all children with the same name as their parent?  

I think this would look something like:  

SELECT Name, (SELECT Name FROM Child__r WHERE Name = Parent__r.Name) FROM Parent__c

But this is always returning a malformed query exception where Parent__r is an unexpected token.  Is it possible to do what I'm trying to do?  Or do I have to get the parents, then make a separate query for each parent to get the children that match that parents' name?

 

Hi All, 

 

    I have VF Page with scrolling. This scrolling is working as expected when I open the VF Page. Now I kept this VF Page as Homepage Component. When We scroll the home page from top to bottom, once Its reached to the VF Page, then all the data inside the VF Page was scrolling first then the Home Page is scrolling next.  

 

Please see the Jing video Url :  

http://screencast.com/t/QHSxd7yc   

 

Any help would be greatly appreciated. 

Hi

  I have created a VF page and in the controller it contain a list of object fields records. I have wrote a condition in it, if the condition is true then an error message should dispaly else the record should be displayed. 

 

eg: - in a object A.  i have fields b c d.

 

in a list i have the records of  b, c  and d. 

list contain 10 records. The first 3 the condition is true then  a error messag is shown else the value is dispalyes. 

 

The issue is i am getting an error message but it is diplaying 3 times according to the example. That mean it is displayes according to the number of condition gets true.

I want it to be displayed only once. 

Please help me to solve this problem.

 

Thanks

Anu 

Hi developers,

 

I am new into Salesforce but already got something! I created a custom view lead page and custom edit lead page.

 

Now I want to connect this two pages.

 

1)I created a custom button, that when the user will click on it, will redirect him to the edit visualforce page. The name of the button is "Edit_Fiscal_Info".

 

2) And here is my question: I want to add this button to the custom visualforce page of the lead, but I get lost in here.

 

Could someone please provide me with the necessary steps? I think i need to create a standard controller to add this button, but I dont know how to do it....

 

Thanks a lot.

 

Antonio

Is there any way in which I can fetch a single record by specifying the primary key?

Thank you.

 

~VK

I have developed a page where all users are shown,field i have made is Selected user

Selected user is not working with custom fields but is working with standard fields

 

eg

I wrote Account_Owner__c=:selecteduser;

then its not showing the desired result

 

but when i use createdbyid=:selecteduser;

it shows the record

 

Hi Devs,

 

Recently I come across with a strange Issue....

Have you ever come across..

 

I'm just trying to return list of Accounts. It says like thisStrange Issue

http://screencast.com/t/vxgtNJUG3

 

What could be the reason?

 

Thanks & Regards,

Shravan

Hi all,

 

Hopefully this is a simple one but I have a visualforce form which users use to load a lead, however, I want to populate a lookup field with the userid only when the user comes under a certain role.

 

I have tried this query to create the string

 

String userbasedid = [select ID from user where (userRoleid = '00EE0000000gXTj' AND id = :UserInfo.getUserId()].id;   

 

Piece of Form Code:

IdentifyUser = userbasedid

      

So the form works fine when the users role equals the above userroleid, however, as soon as a different user with a different user role uses it I get the error:

 

List has no rows for assignment to SObject.

 

So I need to figure a way that when the query result is null it doesn't try to populate the identifyuser field.

 

Thanks

Kev 

 

Hi All,

     I have to covered my apex class but there is issue due to param value setting

                         <apex:commandLink style="color:blue" action="{!ResubmitRequest}">Resubmit
<apex:param name="role" value="{!t1.Name}"/>
</apex:commandLink>

in apex code we getting the values as - 

public string change = ApexPages.currentPage().getParameters().get('role');

and now query on a object based on change condition.

 

i have my test method-

           PageReference pageRef = Page.myVFPage;
           ApexPages.currentPage().getParameters().put('role', testObj.Name);
           Test.setCurrentPage(pageRef);
           ApexPages.StandardController thecontroller = new ApexPages.StandardController(testFO);          
           CoverageHistory controller = new CoverageHistory(thecontroller);
controller.ResubmitRequest();


Issue is change values always getting null value.

Hi.

 

I want to ask how to create a test method for apex batch where there is method calling external web service? the external web service is created from generate apex from wsdl.. Any suggestions would be great..

Thanks..

Hi

 

<apex:page controller="Customer">
<script>
     function validate(){
     if (frm.pg.fname = ""
        alert("Name Cannot Be blank");
        return false;
        )
        else
        return true;
        }
</script>
    <apex:form id="frm" onsubmit="return validate()" >
        <apex:pageBlock id="pg" title="New Customer Entry">
            <p>First Name:
               <apex:inputText id="fname" value="{!firstName}"/></p>
            <p>Last Name:
               <apex:inputText value="{!lastName}"/></p>
            <p>Company Name:
               <apex:inputText value="{!companyName}"/></p>
            <p># Employees:
               <apex:inputText value="{!numEmployees}"/></p>
            <p>Department:
               <apex:inputText value="{!department}"/></p>
            <p>Email:
               <apex:inputText value="{!email}"/></p>
            <p>Phone:
               <apex:inputText value="{!phone}"/></p>
            <p>Title:
               <apex:inputText value="{!title}"/></p>
            <p>Address</p>
            <p>Street:
               <apex:inputText value="{!streetAddress}"/></p>
            <p>City:
               <apex:inputText value="{!cityAddress}"/></p>
            <p>State:
               <apex:inputText value="{!stateAddress}"/></p>
            <p>Zip:
               <apex:inputText value="{!postalCodeAddress}"/></p>
            <p>Country:
               <apex:inputText value="{!countryAddress}"/></p>

            <p><apex:commandButton action="{!save}"
               value="Save New Customer"/></p>
        </apex:pageBlock>
    </apex:form>
      <!-- Add related lists here -->
</apex:page

 

What is wrong in this form tag  "onsubmit="return validate()" "

When i don't write it is working fine , it adds record . I have put this condition to chech through Script that user should not enter blank First Name

 

Thanks

Hi Folks, I have a question regarding an example from the CookBook: "Retrieving a User's Location from a GPS-enabled Phone"

The issue is that I cannot get the latitude/longitude values to display on the form using an iPhone.

I'll use "longitude" as the example.  The functions look like this:

            function updateLocation(lat,lon) {
                document.getElementById('{!$Component.for.block1.longitude}').value="1.01"; /* lon; */
                document.getElementById('{!$Component.for.block1.latitude}').value="2.02";  /* lat; */
            }
            function getLocation() {
                mobileforce.device.getLocation(updateLocation);
                //work around required for Blackberry
                if (window.blackberry)
                    setInterval("getLocation()", 10000);
                    return false;
            }

 

And the apex:form like this:

    <apex:pageblock id="block1">
    Sales Visit Name: <br />
    <apex:inputField value="{!visit.name}" /><br />
    Sales Visit Description: <br />
    <apex:inputField value="{!visit.Description__c}" /><br />
    Longitude: <br />
    <apex:inputField  id="longitude" value="{!visit.Longitude__c}" /><br />
    Latitude: <br />
    <apex:inputField value="{!visit.Latitude__c}" /><br />
    <button type="button" value="GPS" onclick="getLocation();"> Get location </button>

 

On the Apex:inputfield tag for "longitude", I tried adding an "id" value but that did not appear to make a difference.

The original tutorial does not incldue this param.

What am I missing here?   I searched the forums but did not find any reference. I am sure that it is my lack of understanding JS.   thanks for any help.  -doug



 

Hi,

 

How to redirect to the previous page from current page(the page which has got by clicking a button/link in the previous page) through javascript.

 

I tried by using window.location(-1) and history.goback(-1). These are not working..

 

I don't want to specify the path of previous page in the action back button/link. Because the same page is used by two different roles and thier previous pages are different.

 

please help me.........