• vr8ce
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 6
    Replies
I'm missing really obvious, but I don't know what. I've simplified what I'm trying to do for example purposes.

I'm executing the below in an anonymous window. I'm getting 10 contacts, then writing the ID's of each to the debug log.
List<SObject> conts = [SELECT Id,Name FROM Contact LIMIT 10];
for (Sobject cont : conts) {
    System.debug('Cont is ' + cont.Id;
}
What I want to do is write the name of each of the contacts. But changing cont.Id to cont.Name on the System.debug line doesn't work, it says it's not a valid variable.
List<SObject> conts = [SELECT Id,Name FROM Contact LIMIT 10];
for (Sobject cont : conts) {
    System.debug('Cont is ' + cont.Name;
}

Line: 7, Column: 36
Variable does not exist: Name
But the debug shows this variable assignment. It has both the Id and the Name. (As well as the RecordTypeId, which is probably a question for another time.)
19:02:19:009 VARIABLE_ASSIGNMENT [6]|cont|{"Id":"0034N00001pc6T2QAI","Name":"John Doe","RecordTypeId":"01261000000X007AAC"}|0x692d38c6
Why can't I access the Name field?
  • October 03, 2019
  • Like
  • 0
The current (Spring 19) Metadata API documentation still says use the Force IDE. But the Force IDE documentation says it's deprecated now (no support) and going away completely in October (download links removed, etc.).

Nothing I can find in the VC Salesforce Extensions talks about the Metadata API.

So, in March 2019, is Force IDE still the best way to access the Metadata API? Or should we be doing something else?

Thanks!
  • March 11, 2019
  • Like
  • 0
Challenge: We have a list of codes. The list has four levels, represented in four fields on the code row, the last level being the detail. For example, a top-level row has something in level1 and nothing in level2-4. A detail row has something in level1-4. There are too many (1000+) rows to use as a picklist. We want to choose the level1 we want, then choose from the detail rows that have that level1.

Let's call the custom object Object1, and the codes object Codes.

I created Object1.Field1 as a lookup to Codes, with a filter of Codes.Level2-4 = "". So far, so good.
I want to create Object1.Field2 as a lookup to Codes, with a filter of "Object1.Field1 = Codes.Level1" and "Codes.Level4 <> "". In other words, choose from Codes where the top level matches the one I just picked, and only choose the rows that have all four levels.

When I try to use a "field" instead of "value" on the Field2 filter, it doesn't give me the fields from Object1 to choose from. So I don't have a way to restrict the lookup to just those that match the top-level I just picked.

Is there another way to solve this? Breaking up the codes into multiple objects won't work; it's the current record that it won't give me the fields for in the filter, not the lookup object. That is, it doesn't appear to allow filtering based on another value on the current (new) record.

I realize we could do it so the user could change the initial filter, and then just use one lookup. But the entry volume is too high, and the users too inexperienced, to make that practical. I really need to give them two picklists, the first one determining the values in the second, and the volume of the codes (and other considerations not relevant here) requires they be in an object.

Is there a way to do a two-step process so that we're not choosing from 1000+ codes (which we obviously can't do)?
  • December 05, 2018
  • Like
  • 0
Point-and-click is great until its time to do something repeatable. This is less of a "how to" question (although "how to" answers are welcome) and more of a "best practices" question.

We need to create a few new custom objects. We can do it in a sandbox, but the instant we refresh the sandbox the custom objects are gone, and we would have to create them again. Further, if we determine after creating them that we need to add another field or three, then we have to keep track of the fields for the next time we have to create them. It seems like 1) a lot of wasted time, and 2) errors waiting to happen.

In another world, e.g. SQL Server, we would script the object creation. But in that world, creeating the script is easy (no objects), and running the script is easier (SSMS).

What is the recommended method for Salesforce, and/or the generally accepted method? Do people generally just repeat the point-and-click every time, or do they create Apex scripts? (I would think the percentage of orgs who can do the latter is pretty small.)

I've done some web searches on this, but have not stumbled across the right combination of terms or something, because I have found almost no posts with any real information.
  • December 04, 2018
  • Like
  • 0
I have a couple of problems with Winter 19. It isn't working with Firefox 62 at all (get an error every time I login, which has been sent on to SF).
I then switched to Chrome, which seemed OK, until I tried to edit a report.

Editing a report tries to cram everything into the short section above the blue (the blue extends to the bottom of the browser window). This happens for every report, new or existing, when editing. When creating the report, it works fine (no blue section), but hitting the Edit button to edit results in the below every time, on every report.

This obviously did not and does not occur in Summer 18, on any platform or browser.

This is on stock (no extensions), current Chrome (69.0.3497.100), and has survived through two Chrome updates. It occurs on OSX 10.12 and Windows 7 and 10.

Anyone else having similar problems?

User-added image
  • September 20, 2018
  • Like
  • 0
The second component of the dashboard for the Reporting/Dashboard Superbadge includes "so choose a display type that takes advantage of this height and shows what percentage each case reason represents of the total for the category."

The only chart type I see that makes sense is stacked vertical bar chart, with "Stacked to 100%" checked. But, the badge is complaining "doesn't display case counts as a percentage of whole or doesn't arrange data as required." So, did I choose the wrong chart type, or is there a way I haven't found to put the % on each segment of the bar?

I'm not looking for the answer, just which thing I got wrong. I've tried all of the other chart types, and none of them make sense [to me], and/or fit in the 3x8 segment this is going in. Nor do I see any way to get the percentage on the segments. So I'm stymied as to which thing I've gotten wrong.
  • September 18, 2018
  • Like
  • 0
I'm missing really obvious, but I don't know what. I've simplified what I'm trying to do for example purposes.

I'm executing the below in an anonymous window. I'm getting 10 contacts, then writing the ID's of each to the debug log.
List<SObject> conts = [SELECT Id,Name FROM Contact LIMIT 10];
for (Sobject cont : conts) {
    System.debug('Cont is ' + cont.Id;
}
What I want to do is write the name of each of the contacts. But changing cont.Id to cont.Name on the System.debug line doesn't work, it says it's not a valid variable.
List<SObject> conts = [SELECT Id,Name FROM Contact LIMIT 10];
for (Sobject cont : conts) {
    System.debug('Cont is ' + cont.Name;
}

Line: 7, Column: 36
Variable does not exist: Name
But the debug shows this variable assignment. It has both the Id and the Name. (As well as the RecordTypeId, which is probably a question for another time.)
19:02:19:009 VARIABLE_ASSIGNMENT [6]|cont|{"Id":"0034N00001pc6T2QAI","Name":"John Doe","RecordTypeId":"01261000000X007AAC"}|0x692d38c6
Why can't I access the Name field?
  • October 03, 2019
  • Like
  • 0
Point-and-click is great until its time to do something repeatable. This is less of a "how to" question (although "how to" answers are welcome) and more of a "best practices" question.

We need to create a few new custom objects. We can do it in a sandbox, but the instant we refresh the sandbox the custom objects are gone, and we would have to create them again. Further, if we determine after creating them that we need to add another field or three, then we have to keep track of the fields for the next time we have to create them. It seems like 1) a lot of wasted time, and 2) errors waiting to happen.

In another world, e.g. SQL Server, we would script the object creation. But in that world, creeating the script is easy (no objects), and running the script is easier (SSMS).

What is the recommended method for Salesforce, and/or the generally accepted method? Do people generally just repeat the point-and-click every time, or do they create Apex scripts? (I would think the percentage of orgs who can do the latter is pretty small.)

I've done some web searches on this, but have not stumbled across the right combination of terms or something, because I have found almost no posts with any real information.
  • December 04, 2018
  • Like
  • 0
The second component of the dashboard for the Reporting/Dashboard Superbadge includes "so choose a display type that takes advantage of this height and shows what percentage each case reason represents of the total for the category."

The only chart type I see that makes sense is stacked vertical bar chart, with "Stacked to 100%" checked. But, the badge is complaining "doesn't display case counts as a percentage of whole or doesn't arrange data as required." So, did I choose the wrong chart type, or is there a way I haven't found to put the % on each segment of the bar?

I'm not looking for the answer, just which thing I got wrong. I've tried all of the other chart types, and none of them make sense [to me], and/or fit in the 3x8 segment this is going in. Nor do I see any way to get the percentage on the segments. So I'm stymied as to which thing I've gotten wrong.
  • September 18, 2018
  • Like
  • 0