• ArkadiuszW
  • 0 Points
  • Member since 2010

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
  • 1

I created visualforce page for creating my custom object. I wanted to fill some date after user insert a part of it:



<apex:inputField value="{!Costs_Agreement__c.Type_of_cost__c}"> <apex:actionSupport event="onchange" action="{!valuesFromConfigRecord}" rerender="field" status="counterStatus"/> </apex:inputField> <apex:actionStatus id="counterStatus" startText=" (Retriving data...)" />

 If user change data in input field, two fields of object Costs_Agreement__c will be updated and input fields whit them should be refreshed.


<apex:outputPanel id="field"> <apex:inputField value="{!Costs_Agreement__c.MOR_account__c}"/> <apex:inputField value="{!Costs_Agreement__c.Cost_account__c}"/> </apex:outputPanel>


 But if i have on the same page an inputfield whit value from my object that is required and it is empty fields wont be refreshed. If i put any data in this required field then everything works fine. 

Should it work that way ? What if i would like to dynamical insert some data into required field ? 






I have a 'before insert trigger' on Opportunity. The trigger contains an SOQL select query which returns(may or may not) one record and assigns to an Opportunity variable.
The query statement is:
"Opportunity Opp_variable = [SELECT id,Counter__c,AccountId FROM Opportunity where (AccountId=:New_record.AccountId AND Counter__c!=null) ORDER BY Counter__c DESC LIMIT 1];"

After this statement I have "if(Opp_variable!=NULL)..statements",
But I get the Error message:
"System.QueryException: List has no rows for assignment to SObject"
This is caused because there is no record satisfying my query conditions.. But it should have returned NULL.. ?

Why Am I getting this error..!! SOQL query cannot return null value??

How can I sove this issue..? Please help me

Thanks in Advance..