• cjarlie
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 8
    Replies

Hi Mates,

im kinda confused, cause i cannot see why this isnt working.. :|

 

 

My VF Code for the approach is: 

<apex:commandButton value="test" action="{!test}" rerender="yes"/>

 

 

 

 Apex Method:

public PageReference test() {

System.debug('try');

Consumer__c nCon = new Consumer__c();

insert nCon;

System.debug('succeed');

return null;

}

 

1) Why i'm not getting any new sObjects of Consumer__c?

2) Why is there no debug code in the system log? 

 

Message Edited by cjarlie on 11-18-2009 04:58 AM

Hi Everyone,

 

i've got some trouble by using Lookup Reference Fields from sObjects. 

Ive created a sObject called 'Shapes' with fields 'Shape' and 'Name' as autonummered id field. Secondly, ive created a sObject 'Materials' with an Look-up field related to 'Shapes':

 

 

for(Material__c mtr : [select Name, Shape_ID__c from Material__c]){ String shapeID = (mtr.Shape_ID__c);//...

 returns me a Reference (Exp: a07A0000000dVGCIA2

 How do i Approach the corresponding sObject to get its field value 'Shape' ?

 

Ive tried:

 

shapeC = [select Shape__c from Shape__c where Name = mtr.Shape_ID__c];

 but this is obv. not working...

 

andy ideas? 

 

 

 

Hi Everyone, ive got some trouble with the SOQL References.

 

Error Code:

 

System.SObjectException: SObject row was retrieved via SOQL without querying the requested field: Order__c.Legs__r Class.PurchaseRequestController.count: line 24, column 33 Class.PurchaseRequestController.getCount: line 4, column 28 External entry point

 

my syntax: (ive marked the affected lines red)

 

List<Integer> out = new List<Integer>();

for(Order__c ord : [select Name,Algorithm__c,ExpireDate__c,Legs__c,Slab__c,Screw__c,
Quantity__c from Order__c])
{
Integer quant = (ord.Quantity__c).scale();
out[Integer.valueOf(ord.Legs__r.Id)] += quant;
out[Integer.valueOf(ord.Slab__r.Id)] += quant;
out[Integer.valueOf(ord.Screw__c)] += quant;
}

 

 

 

 some solutions?

 

  • November 18, 2009
  • Like
  • 0

Hi Mates,

im kinda confused, cause i cannot see why this isnt working.. :|

 

 

My VF Code for the approach is: 

<apex:commandButton value="test" action="{!test}" rerender="yes"/>

 

 

 

 Apex Method:

public PageReference test() {

System.debug('try');

Consumer__c nCon = new Consumer__c();

insert nCon;

System.debug('succeed');

return null;

}

 

1) Why i'm not getting any new sObjects of Consumer__c?

2) Why is there no debug code in the system log? 

 

Message Edited by cjarlie on 11-18-2009 04:58 AM