• LauraBTN
  • NEWBIE
  • 5 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 2
    Replies
I have a requirement to create a tiff file from a Visualforce page. The client cannot process a PDF - must have a tiff. This file can them be landed in a Salesforce folder available for an agent to process. 

I was hoping to use Microsoft Document Imaging for this but cannot figure out how.

Any help would be greatly appreciated!
I think I am punch drunk.

I am trying to prevent a user from adding a new record in a child related list when the status of the parent record is locked -

I created a formula field to bring the status value down to the Child object - it is CampaignStatusValue__c

AND ( ISNEW(Giveaway_Quantity__c ), CampaignStatusValue__c  = "LOCKED")

I keep getting: Error: Incorrect number of parameters for function 'ISNEW()'. Expected 0, received 1


Any help would be greatly appreciated



I am a true newbie in the Trigger world - I have this trigger I pulled together that works well when you are only checking Personal account types - has issues with Business accounts - I need to modify it so it will run only on Personal Accounts.  I have a custom field that I populate with (FirstName, LastName and Phone) to check for duplicates.  Would appreciate any help given:

Trigger:
trigger accountDuplicateFullNamePreventer on Account (before insert, before update) {

Map<String, Account> accountMap = new Map<String, Account>();
for (Account account : System.Trigger.New) {

// Make sure we don't treat an FullName__c  that
// isn't changing during an update as a duplicate.

if ((account.FullName__c !=null) && (System.Trigger.isInsert || (account.FullName__c != System.Trigger.oldMap.get(account.Id).FullName__c))) {
//make sure another new account isn't also a duplicate
if (accountMap.containsKey(account.FullName__c)) {

account.FullName__c.addError('Another new account has the '
+ 'same Name.');

} else {
accountMap.put(account.FullName__c, account);
}
}
}
//Using a single database query, find all the accounts in
//the database that have the same FullName as any
// of the accounts being inserted or updated.

for (Account account : [SELECT FullName__c FROM Account WHERE FullName__c IN :accountMap.KeySet()]) {
Account newAccount=accountMap.get(account.FullName__c);
newAccount.FullName__c.addError('An account with this Name and Phone Number already exists.');
}
}
I was following along in the Workbook successfully until I got to Workshop 201, Tutorial 3, Step 4.3,- I have checked and checked and do not see what I have done wrong.

Here is the code from the tutorial:
public class InvoiceUtilities {

// class method to renumber Line Items for a given Invoice number
// returns a string that indicates success or failure
public static String renumberLineItems(String invoiceName) {

// create a copy of the target Invoice object and it's Line Items
Invoice__c invoice = [Select i.Name, (Select Name From Line_Items__r ORDER BY Name)
From Invoice__c i
Where i.Name = :invoiceName LIMIT 1];

// loop through each Line Item, renumbering as you go
Integer i = 1;
for (Line_Item__c item : invoice.Line_Items__r) {
item.Name = String.valueOf(i);
System.debug(item.Name);
i++;
}

// update the Line Items in one transaction, rollback if any problems
// and return error messages to the calling environment
try {
database.update(invoice.Line_Items__r);
}
catch (DmlException e) {
return e.getMessage();
}

// on success, return a message to the calling program
return 'Line items renumbered successfully.';
}
}
It saved with no errors

Then I test it using this :
String s = InvoiceUtilities.renumberLineItems('INV-0004'); 

My inv-004 is correct (has line numbers out of sequence.

Here is the error I keep getting:
System.QueryException: List has no rows for assignment to SObject: Class.InvoiceUtilities.renumberLineItems: line 8, column 1
AnonymousBlock: line 1, column 1
AnonymousBlock: line 1, column 1

Can anyone help with this?  

Thanks
I am a true newbie in the Trigger world - I have this trigger I pulled together that works well when you are only checking Personal account types - has issues with Business accounts - I need to modify it so it will run only on Personal Accounts.  I have a custom field that I populate with (FirstName, LastName and Phone) to check for duplicates.  Would appreciate any help given:

Trigger:
trigger accountDuplicateFullNamePreventer on Account (before insert, before update) {

Map<String, Account> accountMap = new Map<String, Account>();
for (Account account : System.Trigger.New) {

// Make sure we don't treat an FullName__c  that
// isn't changing during an update as a duplicate.

if ((account.FullName__c !=null) && (System.Trigger.isInsert || (account.FullName__c != System.Trigger.oldMap.get(account.Id).FullName__c))) {
//make sure another new account isn't also a duplicate
if (accountMap.containsKey(account.FullName__c)) {

account.FullName__c.addError('Another new account has the '
+ 'same Name.');

} else {
accountMap.put(account.FullName__c, account);
}
}
}
//Using a single database query, find all the accounts in
//the database that have the same FullName as any
// of the accounts being inserted or updated.

for (Account account : [SELECT FullName__c FROM Account WHERE FullName__c IN :accountMap.KeySet()]) {
Account newAccount=accountMap.get(account.FullName__c);
newAccount.FullName__c.addError('An account with this Name and Phone Number already exists.');
}
}
I was following along in the Workbook successfully until I got to Workshop 201, Tutorial 3, Step 4.3,- I have checked and checked and do not see what I have done wrong.

Here is the code from the tutorial:
public class InvoiceUtilities {

// class method to renumber Line Items for a given Invoice number
// returns a string that indicates success or failure
public static String renumberLineItems(String invoiceName) {

// create a copy of the target Invoice object and it's Line Items
Invoice__c invoice = [Select i.Name, (Select Name From Line_Items__r ORDER BY Name)
From Invoice__c i
Where i.Name = :invoiceName LIMIT 1];

// loop through each Line Item, renumbering as you go
Integer i = 1;
for (Line_Item__c item : invoice.Line_Items__r) {
item.Name = String.valueOf(i);
System.debug(item.Name);
i++;
}

// update the Line Items in one transaction, rollback if any problems
// and return error messages to the calling environment
try {
database.update(invoice.Line_Items__r);
}
catch (DmlException e) {
return e.getMessage();
}

// on success, return a message to the calling program
return 'Line items renumbered successfully.';
}
}
It saved with no errors

Then I test it using this :
String s = InvoiceUtilities.renumberLineItems('INV-0004'); 

My inv-004 is correct (has line numbers out of sequence.

Here is the error I keep getting:
System.QueryException: List has no rows for assignment to SObject: Class.InvoiceUtilities.renumberLineItems: line 8, column 1
AnonymousBlock: line 1, column 1
AnonymousBlock: line 1, column 1

Can anyone help with this?  

Thanks
I think I am punch drunk.

I am trying to prevent a user from adding a new record in a child related list when the status of the parent record is locked -

I created a formula field to bring the status value down to the Child object - it is CampaignStatusValue__c

AND ( ISNEW(Giveaway_Quantity__c ), CampaignStatusValue__c  = "LOCKED")

I keep getting: Error: Incorrect number of parameters for function 'ISNEW()'. Expected 0, received 1


Any help would be greatly appreciated



I am a true newbie in the Trigger world - I have this trigger I pulled together that works well when you are only checking Personal account types - has issues with Business accounts - I need to modify it so it will run only on Personal Accounts.  I have a custom field that I populate with (FirstName, LastName and Phone) to check for duplicates.  Would appreciate any help given:

Trigger:
trigger accountDuplicateFullNamePreventer on Account (before insert, before update) {

Map<String, Account> accountMap = new Map<String, Account>();
for (Account account : System.Trigger.New) {

// Make sure we don't treat an FullName__c  that
// isn't changing during an update as a duplicate.

if ((account.FullName__c !=null) && (System.Trigger.isInsert || (account.FullName__c != System.Trigger.oldMap.get(account.Id).FullName__c))) {
//make sure another new account isn't also a duplicate
if (accountMap.containsKey(account.FullName__c)) {

account.FullName__c.addError('Another new account has the '
+ 'same Name.');

} else {
accountMap.put(account.FullName__c, account);
}
}
}
//Using a single database query, find all the accounts in
//the database that have the same FullName as any
// of the accounts being inserted or updated.

for (Account account : [SELECT FullName__c FROM Account WHERE FullName__c IN :accountMap.KeySet()]) {
Account newAccount=accountMap.get(account.FullName__c);
newAccount.FullName__c.addError('An account with this Name and Phone Number already exists.');
}
}