You need to sign in to do that
Don't have an account?
sravanthi k 4
Integration with rest api
Hi every one,
Trough REST API i am capturing url for a particular image now ,i want to read the data from that url in blob format and then attach that image in sales force ,
can any please help to read the data from url
This is my trigger:
trigger AttachmentImage on Item__c (before insert,before update) {
list<Item__c> lst=[select id,URL__c from Item__c];
Blob pic ;
pic =blob.valueof('http://multisite.dhrusoff.com/wp-content/plugins/forces/img/ballon1949004662-300X300.jpg');
for(Item__c b:lst)
{
if(b.URL__c !=null) {
//pic=EncodingUtil.base64Decode(b.URL__c);
Attachment a = new Attachment (ParentId = b.id,Body = pic,Name = 'Item Image.jpeg');
System.debug('==========Attach======= - ' +a);
System.debug('==========Attach======= - ' +a.id);
insert a;
}
}
Trough REST API i am capturing url for a particular image now ,i want to read the data from that url in blob format and then attach that image in sales force ,
can any please help to read the data from url
This is my trigger:
trigger AttachmentImage on Item__c (before insert,before update) {
list<Item__c> lst=[select id,URL__c from Item__c];
Blob pic ;
pic =blob.valueof('http://multisite.dhrusoff.com/wp-content/plugins/forces/img/ballon1949004662-300X300.jpg');
for(Item__c b:lst)
{
if(b.URL__c !=null) {
//pic=EncodingUtil.base64Decode(b.URL__c);
Attachment a = new Attachment (ParentId = b.id,Body = pic,Name = 'Item Image.jpeg');
System.debug('==========Attach======= - ' +a);
System.debug('==========Attach======= - ' +a.id);
insert a;
}
}
Thanks
Jai