• MPS Dev
  • NEWBIE
  • 0 Points
  • Member since 2017

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

Hello, 
I have 2 custom objects and 1 standard(Project, Task, Assignment). Each Project can have multiple tasks, Each Task has 1 Assignment.
I can query it like this 

SELECT Assignment.Name FROM Task WHERE WhatId = 'RecordId'
I thought it might be cool to do something like this
SELECT ( SELECT (SELECT Name FROM Assignment) FROM Task) FROM Project
BUT I can't seem to get the second query to compile, any insight would be appericiated!
trigger TestTrigger on TestObj2__c (after insert) {
    Set<Id> ids = new Set<Id>();
    
    for(TestObj2__c a: Trigger.New) {
        ids.add(a.Account__c);
    }
    Account[] acs = [select Id from Account where Id in :ids];
    for(Account b :acs) {
        b.TestField__c = 'BECOMING A PROGRAMMER';
    }

}

Expectation: After I create a record of object TestObj2__c, a field of it's master object Account will get populated with "BECOMING A PROGRAMMER".

It does not do that though. Even wrote a test method for this, says the same:
 
@isTest
public class TestTestTrigger {
    @isTest static void td(){
        Account a = new Account(Name = 'fun');
        insert a;
        TestObj2__c b = new TestObj2__c();
        b.Name = 'Fun';
        b.Account__c = a.Id;
        insert b;
        
        Account isPopulated = [select TestField__c from Account where id = :b.Account__c];
        System.assertEquals('BECOMING A PROGRAMMER', isPopulated.TestField__c);
    
    }

}
Error Message	System.AssertException: Assertion Failed: Expected: BECOMING A PROGRAMMER, Actual: test
Stack Trace	Class.TestTestTrigger.td: line 12, column 1


Can anyone tell me what's missing in the puzzle?
 
Hello there,
We have custom buttons in custom objects which is placed in classic through page layout but those buttons not visible into lightning. Is there have any possible reasons.
Thanks