• astraea
  • NEWBIE
  • 0 Points
  • Member since 2009

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 15
    Questions
  • 10
    Replies

Hi all,

 

I'm trying to update campaign member status with Apex.

 

I created Visualforce page.

In save() method, I tried to update campaign member status.

 

Here is my code.

 

//current value CampaignMemberStatus oldDefault = [select Id from CampaignMemberStatus where CampaignId = :currentId and isDefault = true LIMIT 1]; CampaignMemberStatus oldRespond = [select Id from CampaignMemberStatus where CampaignId = :currentId and HasResponded = true LIMIT 1]; //update label (It's a default) CampaignMemberStatus oldstatus = new CampaignMemberStatus( Id = oldDefault.Id, Label = 'entry'); update oldstatus; //change sortorder (It's hasResponded) CampaignMemberStatus oldorder = new CampaignMemberStatus( Id = oldRespond.Id, SortOrder = 3); update oldorder; //add attend CampaignMemberStatus newstatus = new CampaignMemberStatus( CampaignId = currentId, Label = 'attend', SortOrder = 2, isDefault = false, HasResponded = false); insert newstatus;

 

I can change SortOrder and insert attend(not default and not hasresponded value).

But I can't update the default's label.

 

Is it impossible?

How can I do?

 

Any solution to this problem is greatly appreciated.

 

astraea

Hi,

 

I have a problem about lookup dialog.

Now there are two users including me. Both have administrator rights and both roles are the same.

 

My coworker and I created three custom objects called Enquete, Select and Interest.

Interest and Select have a Master-detail relationship.

 

                                                          --- Interest(Master)

Lead -(lookup)- Enquete -(lookup)- Select(Detail)

 

Enquete has two fields.

 -- Lead__c

 -- Select__c

Both are lookups.

 

When I select Lead, I can see owner-independent leads on lookup dialog.

But, when I select Select, I can only see my selects (owner is me).

 

What is wrong?

I also created three object like them.

At that time, I can see all data in lookup dialog !!

 

I guess the security setting is wrong, but I can't find that mistake.

Where should I check?

 

 

 

Any solution to this problem is greatly appreciated.

astraea

Message Edited by astraea on 07-10-2009 04:05 PM
Message Edited by astraea on 07-10-2009 05:41 PM

Hi,

 

I have two custom objects related to Lead.

"---" means relationships.

Interest has a status.

 

 

Lead ---  Enquete --- Interest

                                     status (active/inatcive)

 

When I make a record of Enquete, I need to choose lead and interest.

And I would like to choose from all interest records.

 

But only my interests (owner is me) show in Lookup dialog.

 

Can I show all others' records?

 

Thanks,

astraea

Hi all,

 

My "Lead" has a related list called "Interest". It's a custom object.

 

Interest has a custom field called "isActive". It's a checkbox.

 

What I would like to do are

 -- if isActive is true, that Interest item is shown on the related list.

 -- if isActive is false, that Interest item is not shown on the related list.

 

I know that I can customize what field I show on Lead layout page.

I can choose fields, ex Name,Code,isActive and so on.

 

But I can't find the filtering setting.

 

Is there that setting?

 

If yes, where?

If no, how can I make filtered related list?

 

By VisualForce page?

If so, how can I set on Lead layout page?

 

Thanks,

astraea

Hi guys,

 

Campaign's Search Look up has the scope of the search.

 - My Active Campaign

 - My Campaign

 - All Active Campaign

 - All Campaign

 

I would like to use only All Active Campaign.

Can I hide other scopes?

 

I have another question.

I created a custom object called 'Interest' and the relationship between Lead and it.

'Interest' has a combo box "display" (show/hide).

"Show" means Active Interest.

 

When I search Interest from Lead page, I would like to display only "Show" Interest on search lookup.

Can I create the scope on search lookup  like campaign search lookup?

 

Thanks in advance,

astraea

Hi all,

 

I would like to use common signature and reply to mail address in our salesforce org.

These are not related to recipients.

 

Are there any way to work out ?

 

Thanks,

astraea

Hi,

 

I made an Apex trigger to change status into completed.

So, I would like to display only archival record on Lead layout.

-- I'm using Japanese version, so I don't know an English name of related list:smileysad:

 

But, that related list only have "LogCall" button.

 

Can I add a "New Task" button ?

 

If it's not possible, does anyone have alternative solutions?

 

Thanks in advance,

astraea

Hi, all

 

I would like to add email template id and folder id on Task page.

I plan to use template folders as our service's codes, and template id for marketing.

 

I would like to display them on send mail page and / or task page.

 

Can I get them?

 

Do tasks keep them in the database ?

 

 

I know how to get all email template id.

EmailTemplate[] tList = [select id,name,folderid from emailtemplate]

But I don't know how to match them, because subjects and comments that have already sent might be changed.

 

 

Thanks in advance,

astraea

Hi, all

 

I'm customizing Tasks.

 

I plan to use Activities, but I don't want to use Events.

 

Sometimes I saw the button that means "Save & New Event"  below Task form.

 

It confuses me.

 

Can I hide or delete this button?

 

Thanks,

astraea

Hi,

 

I customized standard objects on Dev Edition.

 

For example:

- custom item

- label name

- picklists' options

 

Can I move these objects to new environment?

 

Best regards,

astraea

Hi,

 

I wolud like to customize standard objects as many as I can.

For example, the data type of "Email Opt Out" is a checkbox.

Can I change checkbox into picklist?

 

If I would like to use so , is it the only way to make a custom item?

 

Regards,

astraea

 

 

 

Hi,

 

I would like to customize standard objects on development environment and use on production environment.

 

I read documents about packaging, but they are written about just custom objects.

 

Can I port customized standard objects to production environment?

 

 

Regards,

astraea

Hi,

 

I tried to execute Database.executeBatch()..But I couldn't.:smileysad:

 

I'm using Japanese salesforce.com, so I don't know an original error message.

The message means "you don't have a permission. So you can't execute the request. Please ask owner or system administrator.".

 

 

I have a permission of system administrator and I made all custom object,Apex Trigger and classes.

 

Code is very simple:

trigger TestScript on Batch_Script__c bulk (after update) {
//if checkbox is checked, run the script
for (Batch_Script__c bs : Trigger.new) {
if (bs.Test_Script_Run__c == true) {

Job j = new Job();
Database.executeBatch(j);


//update status of Batch Script instance
Batch_Script__c ourBS = new Batch_Script__c (
Id = bs.Id,
Test_Script_Run__c=false,
Test_Script_Last_Run_Date__c=system.today()
);
update ourBS;
}
}
}

 

global class Job implements Database.Batchable<toTable__c>{

global database.Querylocator start(){
return Database.getQueryLocator([select Name__c,Run_Date__c from fromTable__c]);
}
global void executeBatch(SObject[] ttb){
List<fromTable__c> ftbl = [select Name__c,Run_Date__c from fromTable__c]; List<toTable__c> ttbl = new List<toTable__c>();

for(fromTable__c l : ftbl){
toTable__c ttbc = new toTable__c();
ttbc.Name__c = l.Name__c;
ttbc.Run_Date__c = system.today();

ttbl.add(ttbc);
}
insert ttbl;

}
global void finish(){ }
}

Hi,

 

I'm using Data Loader 15 and Developer Edition.

I read Data Loader developer's Guide.

But I couldn't understand what server host I should use.

 

And my company uses proxy servers. The port digit is 5.

But Data Loader Settings allows 4 digit :smileysad:

 

Can anyone help me?

 

Thanks,

astraea

My data has parent-child relations between email and active.

 

Ex, 

I sent one email about the campaign.

The lead called to me. So, I made an active.

 

email

 |---Call

 |---Call

 

 

I would like to see an email and archival records at the same time.

Can I do that?

Hi all,

 

My "Lead" has a related list called "Interest". It's a custom object.

 

Interest has a custom field called "isActive". It's a checkbox.

 

What I would like to do are

 -- if isActive is true, that Interest item is shown on the related list.

 -- if isActive is false, that Interest item is not shown on the related list.

 

I know that I can customize what field I show on Lead layout page.

I can choose fields, ex Name,Code,isActive and so on.

 

But I can't find the filtering setting.

 

Is there that setting?

 

If yes, where?

If no, how can I make filtered related list?

 

By VisualForce page?

If so, how can I set on Lead layout page?

 

Thanks,

astraea

Hi guys,

 

Campaign's Search Look up has the scope of the search.

 - My Active Campaign

 - My Campaign

 - All Active Campaign

 - All Campaign

 

I would like to use only All Active Campaign.

Can I hide other scopes?

 

I have another question.

I created a custom object called 'Interest' and the relationship between Lead and it.

'Interest' has a combo box "display" (show/hide).

"Show" means Active Interest.

 

When I search Interest from Lead page, I would like to display only "Show" Interest on search lookup.

Can I create the scope on search lookup  like campaign search lookup?

 

Thanks in advance,

astraea

Hi all,

 

I would like to use common signature and reply to mail address in our salesforce org.

These are not related to recipients.

 

Are there any way to work out ?

 

Thanks,

astraea

Hi,

 

I made an Apex trigger to change status into completed.

So, I would like to display only archival record on Lead layout.

-- I'm using Japanese version, so I don't know an English name of related list:smileysad:

 

But, that related list only have "LogCall" button.

 

Can I add a "New Task" button ?

 

If it's not possible, does anyone have alternative solutions?

 

Thanks in advance,

astraea

Hi, all

 

I'm customizing Tasks.

 

I plan to use Activities, but I don't want to use Events.

 

Sometimes I saw the button that means "Save & New Event"  below Task form.

 

It confuses me.

 

Can I hide or delete this button?

 

Thanks,

astraea

Hi,

 

I wolud like to customize standard objects as many as I can.

For example, the data type of "Email Opt Out" is a checkbox.

Can I change checkbox into picklist?

 

If I would like to use so , is it the only way to make a custom item?

 

Regards,

astraea

 

 

 

Hi,

 

I would like to customize standard objects on development environment and use on production environment.

 

I read documents about packaging, but they are written about just custom objects.

 

Can I port customized standard objects to production environment?

 

 

Regards,

astraea

Hi,

 

I tried to execute Database.executeBatch()..But I couldn't.:smileysad:

 

I'm using Japanese salesforce.com, so I don't know an original error message.

The message means "you don't have a permission. So you can't execute the request. Please ask owner or system administrator.".

 

 

I have a permission of system administrator and I made all custom object,Apex Trigger and classes.

 

Code is very simple:

trigger TestScript on Batch_Script__c bulk (after update) {
//if checkbox is checked, run the script
for (Batch_Script__c bs : Trigger.new) {
if (bs.Test_Script_Run__c == true) {

Job j = new Job();
Database.executeBatch(j);


//update status of Batch Script instance
Batch_Script__c ourBS = new Batch_Script__c (
Id = bs.Id,
Test_Script_Run__c=false,
Test_Script_Last_Run_Date__c=system.today()
);
update ourBS;
}
}
}

 

global class Job implements Database.Batchable<toTable__c>{

global database.Querylocator start(){
return Database.getQueryLocator([select Name__c,Run_Date__c from fromTable__c]);
}
global void executeBatch(SObject[] ttb){
List<fromTable__c> ftbl = [select Name__c,Run_Date__c from fromTable__c]; List<toTable__c> ttbl = new List<toTable__c>();

for(fromTable__c l : ftbl){
toTable__c ttbc = new toTable__c();
ttbc.Name__c = l.Name__c;
ttbc.Run_Date__c = system.today();

ttbl.add(ttbc);
}
insert ttbl;

}
global void finish(){ }
}

Hi,

 

I'm using Data Loader 15 and Developer Edition.

I read Data Loader developer's Guide.

But I couldn't understand what server host I should use.

 

And my company uses proxy servers. The port digit is 5.

But Data Loader Settings allows 4 digit :smileysad:

 

Can anyone help me?

 

Thanks,

astraea