• joseph keuler 1
  • NEWBIE
  • 70 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 14
    Questions
  • 14
    Replies
So I have a custom object standard controller and I want to auto-populate a field on a form from the users account record.

In preparation to build my controller I need a valid SOQL statement and I'm getting nested semi-join sub selects error on the Workbench.

I'm getting errors on the SOQL query:
 
select agency_acronym__C from account 
   where id in (SELECT AccountId FROM Contact 
   where id in (SELECT ContactId FROM User 
   where id in (SELECT OwnerId FROM Application__c)))


if this where in SQL Syntax I'd just use joins. I'm new to SOQL
 
select agency_acronym__c from 
account inner join contact on account.accountID = contact.accountID
inner join user on contact.contactid = user.contactid
inner join application__c on user.id = application__c.ownerid

Thanks,
Joe
I can get the visualforce page to hide the input field but I'm unsure how to hide the associated label. How can I hide the label as well?
 
<apex:pageBlockSection id="yearInfoPageBlock" title="Fiscal Year Information">

    <apex:inputField value="{!Fiscal_Year__c.name}" onclick="test();"/>
    <apex:inputField value="{!Fiscal_Year__c.Is_Current__c}" id="isCurrent"/>

</apex:pageBlockSection>

<apex:includeScript value="{! $Resource.jQuery }"/>
    <script type="text/javascript">
        function test(){
            $('[id$="isCurrent"]').hide();

            $('[id$="isCurrent"]').hide();
        }
    </script>
Is it possible to create fields on a report?  In SQL I was able to do this fairly easily.  

An example would be:

Item ----  Qty ---- price --- total (qty*price)

Do I always need to have total on the object or can I create a non-grouped-by report and have a calculated field?
 
Is it possible to execute a trigger on a field by itself instead of an object?  

ObjectA.Field1  on update of Field1 run trigger.  On update of ObjectA.Field2 do nothing.
So I have an Apex method running off the process builder but when I try to update a record via the invoked method it says the record is locked. Perhaps the reason it won’t update is because the process hasn’t completed yet? How can I update a record via Apex triggered from the process builder?
 
@invocablemethod
public static void updateBenefit(list<ea_app__c> app){
                app[0].Benefit_Amount__c = calcBenefit(app[0].name);
    // ----> this is the issue here  <----
    update app;
}

public static decimal calcBenefit(string appID){
    decimal benefit = 0.0;
    integer coeff = getCoefficient('2015');
    decimal max = getMax(getfamilySize(appID));
    benefit = (1-(getIncome(appID)/max))*(getFuelCost(appID)/coeff);
    return benefit;        
}

 
Hi, 

I'm creating a visual force page that shows a new default list filter to override the standard page of a custom object.  How can I get the "NEW" button such that I can open a new form to create a new record.

<apex:commandLink action="{!URLFOR($Action.Fiscal_Year__c.NewFiscal_Year__c)}" value="Create New Fiscal Year"/>
         <apex:commandButton action="{! new}" value="create new fiscal year"/>

It seems creating a controller would be overkill because I simply want to go to the add fiscal year form vs adding one directly from this form.  Any ideas? 
Is it possible to edit muliple objects on 1 page layout.  I have a relational set of objects but it appears that a user can only edit one object at a time.    Should I be using Visualforce instead to achieve this?
I'm new to the platform so I'm trying to figure out how data entry forms should be designed.

Thanks,
Joe
Is there any other difference between master detail and lookup relationships outside of ownership behavior, security implications, and referential integrity between the objects?

Thanks,
Joe
So I keep getting the error:  The process did not set the correct Type value when approval outcome is Approved

see my attached setup.  

1) I added the options to the type account object
2) have the logic set on teh approval
3) have the field update options set to Pending for Intial, Customer for approval, Prospect for Rejections

Any ideas?User-added image
Why does this result in duplicate values for a single owner change event?
select Id, CreatedDate, Field, LeadId, NewValue, OldValue 
from LeadHistory
where (field = 'ownerAssignment' or field = 'Owner')
The lead history object has one record where the newvalue/oldvalue is the actual owner/ namequeue name, and then a duplicate record with the exact same CreatedDate time stamp that shows newvalue/oldvalue as the owner id/queue id.

What is going on here?  Why does lead history have 2 records for the exact same event?

User-added image