Skip to main content
added 53 characters in body
Source Link
Phil B
  • 5k
  • 7
  • 42
  • 73

I'm trying this simple statement and getting null, shouldn't this be returning 1 since its a master-detail relationship? I've tried at API V40,41,42. Is my syntax wrong?

Here's the relevant documentation on DescribeFieldResult.

Anonymous script yielding null:

System.debug('relationshipOrder : ' + OpportunityLineItem.OpportunityId.getDescribe().getRelationshipOrder());

EDIT (My: My previous example was an attempt to make it more generic since not everyone has Work Orders enabled, my actual issue was with WorkOrderId on WorkOrderLineItem which is a MD relationship) Also getting also returning null from:.

https://i.sstatic.net/VuHYF.jpg (screenshot of relationship)

WorkOrderLineItem.WorkOrderId.getDescribe().getRelationshipOrder() 

I'm trying this simple statement and getting null, shouldn't this be returning 1 since its a master-detail relationship? I've tried at API V40,41,42. Is my syntax wrong?

Here's the relevant documentation on DescribeFieldResult.

Anonymous script yielding null:

System.debug('relationshipOrder : ' + OpportunityLineItem.OpportunityId.getDescribe().getRelationshipOrder());

EDIT (My previous example was an attempt to make it more generic since not everyone has Work Orders enabled, my actual issue was with WorkOrderId on WorkOrderLineItem which is a MD relationship) Also getting null from:

WorkOrderLineItem.WorkOrderId.getDescribe().getRelationshipOrder()

I'm trying this simple statement and getting null, shouldn't this be returning 1 since its a master-detail relationship? I've tried at API V40,41,42. Is my syntax wrong?

Here's the relevant documentation on DescribeFieldResult.

Anonymous script yielding null:

System.debug('relationshipOrder : ' + OpportunityLineItem.OpportunityId.getDescribe().getRelationshipOrder());

EDIT: My previous example was an attempt to make it more generic since not everyone has Work Orders enabled, my actual issue was with WorkOrderId on WorkOrderLineItem which is a MD relationship) also returning null.

https://i.sstatic.net/VuHYF.jpg (screenshot of relationship)

WorkOrderLineItem.WorkOrderId.getDescribe().getRelationshipOrder() 
added 196 characters in body
Source Link
Phil B
  • 5k
  • 7
  • 42
  • 73

I'm trying this simple statement and getting null, shouldn't this be returning 1 since its a master-detail relationship? I've tried at API V40,41,42. Is my syntax wrong?

Here's the relevant documentation on DescribeFieldResult.

Anonymous script yielding null:

System.debug('relationshipOrder : ' + OpportunityLineItem.OpportunityId.getDescribe().getRelationshipOrder());

AlsoEDIT (My previous example was an attempt to make it more generic since not everyone has Work Orders enabled, my actual issue was with WorkOrderId on WorkOrderLineItem which is a MD relationship) Also getting null from:

WorkOrderLineItem.WorkOrderId.getDescribe().getRelationshipOrder()

I'm trying this simple statement and getting null, shouldn't this be returning 1 since its a master-detail relationship? I've tried at API V40,41,42. Is my syntax wrong?

Here's the relevant documentation on DescribeFieldResult.

Anonymous script yielding null:

System.debug('relationshipOrder : ' + OpportunityLineItem.OpportunityId.getDescribe().getRelationshipOrder());

Also getting null from:

WorkOrderLineItem.WorkOrderId.getDescribe().getRelationshipOrder()

I'm trying this simple statement and getting null, shouldn't this be returning 1 since its a master-detail relationship? I've tried at API V40,41,42. Is my syntax wrong?

Here's the relevant documentation on DescribeFieldResult.

Anonymous script yielding null:

System.debug('relationshipOrder : ' + OpportunityLineItem.OpportunityId.getDescribe().getRelationshipOrder());

EDIT (My previous example was an attempt to make it more generic since not everyone has Work Orders enabled, my actual issue was with WorkOrderId on WorkOrderLineItem which is a MD relationship) Also getting null from:

WorkOrderLineItem.WorkOrderId.getDescribe().getRelationshipOrder()
added another example
Source Link
Phil B
  • 5k
  • 7
  • 42
  • 73

I'm trying this simple statement and getting null, shouldn't this be returning 1 since its a master-detail relationship? I've tried at API V40,41,42. Is my syntax wrong?

Here's the relevant documentation on DescribeFieldResult.

Anonymous script yielding null:

System.debug('relationshipOrder : ' + OpportunityLineItem.OpportunityId.getDescribe().getRelationshipOrder());

Also getting null from:

WorkOrderLineItem.WorkOrderId.getDescribe().getRelationshipOrder()

I'm trying this simple statement and getting null, shouldn't this be returning 1 since its a master-detail relationship? I've tried at API V40,41,42. Is my syntax wrong?

Here's the relevant documentation on DescribeFieldResult.

Anonymous script yielding null:

System.debug('relationshipOrder : ' + OpportunityLineItem.OpportunityId.getDescribe().getRelationshipOrder());

I'm trying this simple statement and getting null, shouldn't this be returning 1 since its a master-detail relationship? I've tried at API V40,41,42. Is my syntax wrong?

Here's the relevant documentation on DescribeFieldResult.

Anonymous script yielding null:

System.debug('relationshipOrder : ' + OpportunityLineItem.OpportunityId.getDescribe().getRelationshipOrder());

Also getting null from:

WorkOrderLineItem.WorkOrderId.getDescribe().getRelationshipOrder()
added 54 characters in body
Source Link
Adrian Larson
  • 151.4k
  • 38
  • 247
  • 431
Loading
Source Link
Phil B
  • 5k
  • 7
  • 42
  • 73
Loading