• nandac
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 4
    Replies

Dear Folks,

 

I have been struggling with trying to write a trigger to update a balance on a bill when a payment is made on it. The progress I have made is below:

 

trigger UpdateBalanceOnPayment on Payment__c (after insert) {
    for (Payment__c payment : Trigger.new) {
        Bill__c bill = [SELECT Id, Balance__c FROM Bill__c
            WHERE Id = :payment.Bill__c.Id];
    }
}

For some reason the Force.com IDE says invalid foreign key relationship and does not synchronize with the server.

Each payment will have a master detail relationship with the associated bill when it is saved and I want to reduce the balance on the bill by the amount made by the payment after the payment is saved.

 

However I have not even got to that stage yet because it looks like I have made a mistake in the query. I would appreciate any pointers you can lend on this problem.

 

Many Thanks

nandac

  • April 19, 2013
  • Like
  • 0

Dear Folks,

 

I have created  a site for an application I am building but am unable to login to the site. I have created a number of users but whenever I use their username and password I juts get the following error:

 

Your login attempt has failed. Make sure the username and password are correct.

 

I have also tried using the system administrator account but that does not work either.

 

I would appreciate any pointers on this matter.

 

Thanks,

 

  • April 18, 2013
  • Like
  • 0

Hi,

 

I working on a billing application where I have bill custom object that contains a balance custom field.

 

I want to set the balance custom field to the total amount on the bill on save when the bill is created. Should this be done through a trigger or a formula field?

 

i also need to update the balance field whenever a payment is made, and would like to know if a formula field can be updated, through  a workflow where a payment is made against a bill?

 

If there are better ways to do this please let me know.

 

Cheers

  • April 08, 2013
  • Like
  • 0

Dear Folks,

 

I have been struggling with trying to write a trigger to update a balance on a bill when a payment is made on it. The progress I have made is below:

 

trigger UpdateBalanceOnPayment on Payment__c (after insert) {
    for (Payment__c payment : Trigger.new) {
        Bill__c bill = [SELECT Id, Balance__c FROM Bill__c
            WHERE Id = :payment.Bill__c.Id];
    }
}

For some reason the Force.com IDE says invalid foreign key relationship and does not synchronize with the server.

Each payment will have a master detail relationship with the associated bill when it is saved and I want to reduce the balance on the bill by the amount made by the payment after the payment is saved.

 

However I have not even got to that stage yet because it looks like I have made a mistake in the query. I would appreciate any pointers you can lend on this problem.

 

Many Thanks

nandac

  • April 19, 2013
  • Like
  • 0

Dear Folks,

 

I have created  a site for an application I am building but am unable to login to the site. I have created a number of users but whenever I use their username and password I juts get the following error:

 

Your login attempt has failed. Make sure the username and password are correct.

 

I have also tried using the system administrator account but that does not work either.

 

I would appreciate any pointers on this matter.

 

Thanks,

 

  • April 18, 2013
  • Like
  • 0

Hi,

 

I working on a billing application where I have bill custom object that contains a balance custom field.

 

I want to set the balance custom field to the total amount on the bill on save when the bill is created. Should this be done through a trigger or a formula field?

 

i also need to update the balance field whenever a payment is made, and would like to know if a formula field can be updated, through  a workflow where a payment is made against a bill?

 

If there are better ways to do this please let me know.

 

Cheers

  • April 08, 2013
  • Like
  • 0