function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Hari.gsHari.gs 

Log Writting

Hi,

 

Can i keep a log file in SFDC through Triggers.

 

ie, When a trigger fails i need to write some information in a log file and it should be accessible through salesforce.com.

 

Thanks and Regards

Hari G S

Best Answer chosen by Admin (Salesforce Developers) 
kiranmutturukiranmutturu

ya max u got the point.... but not only one text area field  what ever related info u can save that in different fields....error info in a text area field... some thing like this....

All Answers

kiranmutturukiranmutturu

create a log object and maintain what ever information that u need to track in the log with in repective fields ...when ever trigger fails create a log object in the trigger catch blog and create a record based on the requirement and error deatils...if salesforce itself is unavailable then u can't track this....

Hari.gsHari.gs

Hi,

Thanks for the reply.

 

Can i create an object at run time?

 

I read somewhere that we cannot be able to create a field or object dynamically.

kiranmutturukiranmutturu

nope create a custom object in the system and create the log record for that object.. thats what i am saying ... u can't create a object through apex....

Hari.gsHari.gs

 

Hi Kiran,

 

You mean I need to create aCustum object with a textarea field say Log and write to this field each time when my trigger fails. Is my understanding right?

 

Thanks

Hari G S

kiranmutturukiranmutturu

ya max u got the point.... but not only one text area field  what ever related info u can save that in different fields....error info in a text area field... some thing like this....

This was selected as the best answer
Hari.gsHari.gs

Thank you Kiran