What is abbreviation of a state in Apex?

The abbreviation of a state and so the abbreviation is what’s referred to as the region ID but remember I said that maps like to default to region name so what we need to do is we need to modify this so that it’s no longer trying to use region name but actually region ID to do this we need to edit our map attributes so remember if we click on this customer map node this is the containing region this is the outside like everything here on the outside but we want to change something specific to this map so we need to go click on the attributes node and notice here that the map region column it defaults to reach a name and we’re going to change this to region ID here are all the different options we can configure the title how things display if we want to allow them to zoom we can say zooming is no good and we can say navigation panel no we don’t want you to do that, of course, we can adjust the layout change the scheme let me just I’ll change my scheme to two ok say save and run okay.

So now I can see that I have some different sales in different areas, okay I still have a cut of a way to navigate if I need to I can center but I can’t zoom okay, so maps are a pretty straightforward thing here and there’s if you want to add a link to a map let me go back over here the to the designer and really you can you should be able to add that to the series notice it says use value of link column so notice that the click link is null so if I want to procedurally write my own link I can or I could change this to a custom target and define my link so I should be able to actually I don’t have 0 actually I think on page one I have that state select list I do and I can set it to the region ID which I know is the state abbreviation which is in that select list so I’m going to go to page one ok I’m not going to clear cache everything should be fine and safe so now what should happen when I run this and refresh my page here I when I click on California nothing happens.

But when I click on a value that has some sort of selection here okay so here you can see it didn’t like my region ID you can see at the region ID that it’s setting to is still a substitution string and this is a little bonkers to me because now suddenly I feel like if I go back here because even though I picked it from here does it really want me to do an ampersand diet and it didn’t like that either um, so what are you barking at why are you barking at me region ID I believe I spelled that right yeah there’s now that should be fine yeah so I don’t know why it’s not subbing that out if the built-in and if you have an issue with the built-in link defining a link you can always go back and we can just make our own link here so to do that I’ll provide you with this equal statement here you can do apex until dot repair URL and I’ll put this in chat in just a second let me get my magnifying glass we go and f? P equals I want to stay in the same application.

I want to go to page one I want to maintain the same session and I want to set the value of the item I think it was p 1 I think it was States and then I’m just going to go ahead and concatenate just state because this is before it’s aliased so coming from the demo customers table it’s still called us state ok now we’re going to link to hips value of link column I don’t think we have to Elias it back to link I really just think it needs to be the first column but we’ll see yeah it just needs to be the first call so then I’m going to guess here and I’m going to try something a little different I think I know the answer I’m going to go back and I’m going to change this link to custom target and I had a brain thought of what’s happening here and let me guess and instead I’m going to do label like this and let’s see what happens to see if this works ha it works okay so why does that work does anyone have an idea why that label why they think maybe that why that label worked.

But the other substitution strings didn’t well remember that I said these charts are essentially just maps and the maps and I’m sorry the charts decoratively only let you use link label and value so I basically was just treating this like a chart and how I would decoratively build a link for a chart when I whenever I had the right value that I wanted for the label so in other words doesn’t matter that I called this region ID and its really the position the first position is going to be this is going to be linked with that comment is very dark but I’ll put that in chat this is going to be and actually I can I’ll do hash there I’ll put this in chat and you’ll see it much better this is label and this is going to be value okay and so this is kind of one of the silly things about working with charts and apex and they really like these positional parameters rather than going by the column alias which is kind of silly to me but whatever it should still work even though I have those comments just I hope so.

Click on New York should set the value to New York okay perfect any questions on creating maps did anybody so did anybody does anybody need to do the workshop still if you created the map then you did the that you did the workshop are there any questions about creating links from a map or different types of maps custom link or which of the two variations with CM oh the target yep the the the target and was to be able to I I generally prefer to use the custom link because there’s much more control kind of bundled into that and once you’re this the second you become comfortable with just kind of just riding an apex link kinda I feel like the better off you are kind of as an apex developer because it just kind of opens you up to there’s no what you’re not limited to whatever apex had implemented for that particular component right because you can just say well I’ll just write the link myself and it will just work.

And given that you’re still doing that kind of in the apex framework in other words and you’re configuring a property essentially that apex provided you and then I think that’s still okay and what I mean by that is and I don’t like to just completely disregard the framework and just do my own thing and just write my own code to do whatever because ultimately you’re signing up for more maintenance and this is just using a different property that the framework provides other than the UI link builder yeah so well either one will work, and either way is fine for the workshop just as long as when you if you click a link and actually was there let me look at the workshop real quick I don’t know if it had us necessarily add a link maybe it did yeah actually no there was no activity there’s now was no need to really link the workshop and I was just kind of showing you that you could and the big takeaway here and was that I remember.

So that the one thing to remember the one kind of gotcha is that we usually tend to store and state information as the abbreviations right so CA for California AL for Alabama and that what you need to change on the attributes level it’s going to ask you for the map region column you want to set this to region ID this is the equivalent of the state abbreviations.

Leave a comment